62 CPPUNIT_ASSERT(pDataModel->
getModel() != NULL);
64 CPPUNIT_ASSERT(pDocument == NULL);
66 CPPUNIT_ASSERT(pModel != NULL);
68 CPPUNIT_ASSERT(!sbmlString.empty());
71 CPPUNIT_ASSERT(pDocument != NULL);
72 const Model* pSBMLModel = pDocument->getModel();
73 CPPUNIT_ASSERT(pSBMLModel != NULL);
75 CPPUNIT_ASSERT(pSBMLModel->getListOfFunctionDefinitions()->size() == 1);
76 const FunctionDefinition* pFunDef = pSBMLModel->getFunctionDefinition(0);
77 CPPUNIT_ASSERT(pFunDef != NULL);
78 CPPUNIT_ASSERT(pFunDef->getName() ==
"sqrt_call");
79 const ASTNode* pMath = pFunDef->getMath();
80 CPPUNIT_ASSERT(pMath != NULL);
82 pMath = pMath->getChild(pMath->getNumChildren() - 1);
83 CPPUNIT_ASSERT(pMath != NULL);
85 CPPUNIT_ASSERT(pMath->getType() == AST_FUNCTION_ROOT);
89 CPPUNIT_ASSERT(pMath->getNumChildren() == 1 || pMath->getNumChildren() == 2);
91 if (pMath->getNumChildren() == 2)
93 CPPUNIT_ASSERT(pMath->getChild(0) != NULL);
94 CPPUNIT_ASSERT(pMath->getChild(0)->getType() == AST_INTEGER);
95 CPPUNIT_ASSERT(pMath->getChild(0)->getInteger() == 2);
96 pMath = pMath->getChild(1);
97 CPPUNIT_ASSERT(pMath != NULL);
98 CPPUNIT_ASSERT(pMath->getType() == AST_NAME);
99 CPPUNIT_ASSERT(pMath->getName() == std::string(
"k"));
101 else if (pMath->getNumChildren() == 1)
103 pMath = pMath->getChild(0);
104 CPPUNIT_ASSERT(pMath != NULL);
105 CPPUNIT_ASSERT(pMath->getType() == AST_NAME);
106 CPPUNIT_ASSERT(pMath->getName() == std::string(
"k"));
SBMLDocument * getCurrentSBMLDocument()
std::string exportSBMLToString(CProcessReport *pExportHandler, int sbmlLevel, int sbmlVersion)
bool load_cps_model_from_stream(std::istream &is, CCopasiDataModel &dataModel)
static const char * MODEL_STRING1
bool importSBMLFromString(const std::string &sbmlDocumentText, CProcessReport *pImportHandler=NULL, const bool &deleteOldData=true)
static CCopasiDataModel * pCOPASIDATAMODEL