END_TEST START_TEST (test_KineticLaw_removeParameter) { Parameter_t *o1, *o2, *o3; o1 = KineticLaw_createParameter(kl); o2 = KineticLaw_createParameter(kl); o3 = KineticLaw_createParameter(kl); Parameter_setId(o3,"test"); fail_unless( KineticLaw_removeParameter(kl,0) == o1 ); fail_unless( KineticLaw_getNumParameters(kl) == 2 ); fail_unless( KineticLaw_removeParameter(kl,0) == o2 ); fail_unless( KineticLaw_getNumParameters(kl) == 1 ); fail_unless( KineticLaw_removeParameterById(kl,"test") == o3 ); fail_unless( KineticLaw_getNumParameters(kl) == 0 ); Parameter_free(o1); Parameter_free(o2); Parameter_free(o3); }
END_TEST START_TEST (test_KineticLaw_createParameter) { KineticLaw_t *kl = KineticLaw_create(2, 2); Parameter_t *p = KineticLaw_createParameter(kl); fail_unless( KineticLaw_getNumParameters(kl) == 1); fail_unless( SBase_getLevel((SBase_t *) (p)) == 2 ); fail_unless( SBase_getVersion((SBase_t *) (p)) == 2 ); KineticLaw_free(kl); }
END_TEST START_TEST (test_SBMLConvert_convertToL3_localParameters) { SBMLDocument_t *d = SBMLDocument_createWithLevelAndVersion(1, 2); Model_t *m = SBMLDocument_createModel(d); Compartment_t *c = Model_createCompartment(m); Compartment_setId ( c, "c" ); Species_t *s = Model_createSpecies(m); Species_setId(s, "s"); Species_setCompartment(s, "c"); Reaction_t * r = Model_createReaction(m); SpeciesReference_t *sr = Reaction_createReactant(r); SpeciesReference_setSpecies(sr, "s"); KineticLaw_t *kl = Reaction_createKineticLaw(r); KineticLaw_setFormula(kl, "s*k"); Parameter_t *p = KineticLaw_createParameter(kl); Parameter_setId(p, "k"); fail_unless(KineticLaw_getNumLocalParameters(kl) == 0); fail_unless( SBMLDocument_setLevelAndVersionNonStrict(d, 3, 1) == 1 ); m = SBMLDocument_getModel(d); r = Model_getReaction(m,0); kl = Reaction_getKineticLaw(r); fail_unless(KineticLaw_getNumLocalParameters(kl) == 1); LocalParameter_t *lp = KineticLaw_getLocalParameter(kl, 0); SBMLDocument_free(d); }