57 CPPUNIT_ASSERT(pDataModel->
getModel() != NULL);
60 CPPUNIT_ASSERT(pDocument != NULL);
61 Model* pModel = pDocument->getModel();
62 CPPUNIT_ASSERT(pModel != NULL);
65 CPPUNIT_ASSERT(pModel->getNumCompartments() == 1);
66 Compartment* pCompartment = pModel->getCompartment(0);
67 CPPUNIT_ASSERT(pCompartment->getConstant() ==
true);
68 CPPUNIT_ASSERT(pModel->getNumParameters() == 0);
69 CPPUNIT_ASSERT(pModel->getNumSpecies() == 1);
70 const Species* pSpecies = pModel->getSpecies(0);
71 std::string idSpeciesA = pSpecies->getId();
72 CPPUNIT_ASSERT(pSpecies->getHasOnlySubstanceUnits() ==
false);
73 CPPUNIT_ASSERT(pModel->getNumRules() == 1);
74 AssignmentRule* pRule =
dynamic_cast<AssignmentRule*
>(pModel->getRule(0));
75 CPPUNIT_ASSERT(pRule != NULL);
76 CPPUNIT_ASSERT(pRule->getVariable() == idSpeciesA);
77 const ASTNode* pMath = pRule->getMath();
78 CPPUNIT_ASSERT(pMath != NULL);
81 CPPUNIT_ASSERT(pMath->getType() == AST_FUNCTION_PIECEWISE);
82 CPPUNIT_ASSERT(pMath->getNumChildren() == 3);
83 CPPUNIT_ASSERT(pMath->getChild(0) != NULL);
84 CPPUNIT_ASSERT(pMath->getChild(0)->getType() == AST_REAL);
85 CPPUNIT_ASSERT(pMath->getChild(0)->getReal() < 1e-6);
86 CPPUNIT_ASSERT(pMath->getChild(2) != NULL);
87 CPPUNIT_ASSERT(pMath->getChild(2)->getType() == AST_REAL);
88 CPPUNIT_ASSERT(fabs((pMath->getChild(2)->getReal() - 10.0) / 10.0) < 1e-3);
89 pMath = pMath->getChild(1);
90 CPPUNIT_ASSERT(pMath != NULL);
91 CPPUNIT_ASSERT(pMath->getType() == AST_RELATIONAL_LT);
92 CPPUNIT_ASSERT(pMath->getNumChildren() == 2);
93 CPPUNIT_ASSERT(pMath->getChild(0) != NULL);
94 CPPUNIT_ASSERT(pMath->getChild(0)->getType() == AST_NAME_TIME);
95 CPPUNIT_ASSERT(pMath->getChild(1) != NULL);
96 CPPUNIT_ASSERT(pMath->getChild(1)->getType() == AST_REAL);
97 CPPUNIT_ASSERT(fabs((pMath->getChild(1)->getReal() - 5.0) / 5.0) < 1e-3);
98 CPPUNIT_ASSERT(pModel->getNumReactions() == 0);
SBMLDocument * getCurrentSBMLDocument()
std::string exportSBMLToString(CProcessReport *pExportHandler, int sbmlLevel, int sbmlVersion)
static const char * MODEL_STRING
bool load_cps_model_from_stream(std::istream &is, CCopasiDataModel &dataModel)
static CCopasiDataModel * pCOPASIDATAMODEL