59 CPPUNIT_ASSERT(pDataModel->
getModel() != NULL);
61 CPPUNIT_ASSERT(pDocument == NULL);
64 const Model* pSBMLModel = pDocument->getModel();
65 CPPUNIT_ASSERT(pSBMLModel != NULL);
66 CPPUNIT_ASSERT(pSBMLModel->getNumFunctionDefinitions() == 3);
67 CPPUNIT_ASSERT(pSBMLModel->getNumCompartments() == 1);
68 CPPUNIT_ASSERT(pSBMLModel->getNumSpecies() == 3);
69 CPPUNIT_ASSERT(pSBMLModel->getNumReactions() == 8);
70 CPPUNIT_ASSERT(pSBMLModel->getNumRules() == 0);
71 CPPUNIT_ASSERT(pSBMLModel->getNumParameters() == 0);
76 CPPUNIT_ASSERT(pModifiedMM != NULL);
78 CPPUNIT_ASSERT(pModifiedCF != NULL);
80 CPPUNIT_ASSERT(pConstantFlux != NULL);
81 unsigned int i, iMax = pSBMLModel->getListOfReactions()->size();
82 const Reaction* pReaction = NULL;
83 const ASTNode* pRoot = NULL;
84 const std::map<CCopasiObject*, SBase*>& copasi2sbmlmap = pDataModel->
getCopasi2SBMLMap();
85 std::map<CCopasiObject*, SBase*>::const_iterator mappos;
87 for (i = 0; i < iMax; ++i)
89 pReaction = pSBMLModel->getReaction(i);
90 CPPUNIT_ASSERT(pReaction != NULL);
91 CPPUNIT_ASSERT(pReaction->getKineticLaw() != NULL);
92 pRoot = pReaction->getKineticLaw()->getMath();
93 CPPUNIT_ASSERT(pRoot != NULL);
94 CPPUNIT_ASSERT(pRoot->getType() == AST_TIMES);
96 if (pRoot->getChild(0)->getType() == AST_NAME && pRoot->getChild(0)->getName() == pSBMLModel->getCompartment(0)->getId())
98 pRoot = pRoot->getChild(1);
102 pRoot = pRoot->getChild(0);
105 if (pReaction->getName() ==
"y0Prod" || pReaction->getName() ==
"y1Prod" || pReaction->getName() ==
"xProdLin")
108 CPPUNIT_ASSERT(pRoot->getType() == AST_FUNCTION);
109 mappos = copasi2sbmlmap.find(pModifiedCF);
110 CPPUNIT_ASSERT(mappos != copasi2sbmlmap.end());
111 CPPUNIT_ASSERT(mappos->second != NULL);
112 CPPUNIT_ASSERT(pRoot->getName() == mappos->second->getId());
114 else if (pReaction->getName() ==
"xDegMM")
117 CPPUNIT_ASSERT(pRoot->getType() == AST_FUNCTION);
118 mappos = copasi2sbmlmap.find(pModifiedMM);
119 CPPUNIT_ASSERT(mappos != copasi2sbmlmap.end());
120 CPPUNIT_ASSERT(mappos->second != NULL);
121 CPPUNIT_ASSERT(pRoot->getName() == mappos->second->getId());
123 else if (pReaction->getName() ==
"xProd")
126 CPPUNIT_ASSERT(pRoot->getType() == AST_FUNCTION);
127 mappos = copasi2sbmlmap.find(pConstantFlux);
128 CPPUNIT_ASSERT(mappos != copasi2sbmlmap.end());
129 CPPUNIT_ASSERT(mappos->second != NULL);
130 CPPUNIT_ASSERT(pRoot->getName() == mappos->second->getId());
135 CPPUNIT_ASSERT(pRoot->getType() == AST_TIMES);
SBMLDocument * getCurrentSBMLDocument()
std::string exportSBMLToString(CProcessReport *pExportHandler, int sbmlLevel, int sbmlVersion)
static bool checkIfIdsUnique(const Model *pSBMLModel)
static const char * MODEL_STRING1
bool load_cps_model_from_stream(std::istream &is, CCopasiDataModel &dataModel)
static CFunctionDB * getFunctionList()
static CCopasiDataModel * pCOPASIDATAMODEL
std::map< CCopasiObject *, SBase * > & getCopasi2SBMLMap()
CFunction * findFunction(const std::string &functionName)