END_TEST START_TEST (test_L3_Parameter_units) { char *units = "volume"; fail_unless( !Parameter_isSetUnits(P) ); Parameter_setUnits(P, units); fail_unless( !strcmp(Parameter_getUnits(P), units) ); fail_unless( Parameter_isSetUnits(P) ); if (Parameter_getUnits(P) == units) { fail("Parameter_setUnits(...) did not make a copy of string."); } Parameter_unsetUnits(P); fail_unless( !Parameter_isSetUnits(P) ); if (Parameter_getUnits(P) != NULL) { fail("Parameter_unsetUnits(P, NULL) did not clear string."); } }
END_TEST START_TEST (test_Parameter_setUnits2) { int i = Parameter_setUnits(P, "litre"); fail_unless( i == LIBSBML_OPERATION_SUCCESS ); fail_unless( Parameter_isSetUnits(P) ); i = Parameter_unsetUnits(P); fail_unless( i == LIBSBML_OPERATION_SUCCESS ); fail_unless( !Parameter_isSetUnits(P) ); }
END_TEST START_TEST (test_Parameter_setUnits1) { int i = Parameter_setUnits(P, "1cell"); fail_unless( i == LIBSBML_INVALID_ATTRIBUTE_VALUE ); fail_unless( !Parameter_isSetUnits(P) ); i = Parameter_unsetUnits(P); fail_unless( i == LIBSBML_OPERATION_SUCCESS ); fail_unless( !Parameter_isSetUnits(P) ); }