public void test_Model_createConstraint() { Model m = new Model(2,2); Constraint p = m.createConstraint(); assertTrue( m.getNumConstraints() == 1 ); assertTrue( (p).getLevel() == 2 ); assertTrue( (p).getVersion() == 2 ); m = null; }
public void test_Model_addConstraint2() { Model m = new Model(2,2); Constraint c = new Constraint(2,3); c.setMath(libsbml.parseFormula("a+b")); int i = m.addConstraint(c); assertTrue( i == libsbml.LIBSBML_VERSION_MISMATCH ); assertTrue( m.getNumConstraints() == 0 ); c = null; m = null; }
public void test_Model_addConstraint3() { Model m = new Model(2,2); Constraint c = null; int i = m.addConstraint(c); assertTrue( i == libsbml.LIBSBML_OPERATION_FAILED ); assertTrue( m.getNumConstraints() == 0 ); m = null; }
public void test_Model_addConstraint1() { Model m = new Model(2,2); Constraint c = new Constraint(2,2); int i = m.addConstraint(c); assertTrue( i == libsbml.LIBSBML_INVALID_OBJECT ); c.setMath(libsbml.parseFormula("a+b")); i = m.addConstraint(c); assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS ); assertTrue( m.getNumConstraints() == 1 ); c = null; m = null; }