COPASI API  4.16.103
Public Member Functions | Static Protected Attributes | Private Member Functions | List of all members
test000068 Class Reference

#include <test000068.h>

Inheritance diagram for test000068:
Inheritance graph
[legend]
Collaboration diagram for test000068:
Collaboration graph
[legend]

Public Member Functions

void setUp ()
 
void tearDown ()
 
void test_bug1068 ()
 

Static Protected Attributes

static const char * MODEL_STRING1
 
static CCopasiDataModelpCOPASIDATAMODEL = NULL
 

Private Member Functions

 CPPUNIT_TEST (test_bug1068)
 
 CPPUNIT_TEST_SUITE (test000068)
 
 CPPUNIT_TEST_SUITE_END ()
 

Detailed Description

Definition at line 26 of file test000068.h.

Member Function Documentation

test000068::CPPUNIT_TEST ( test_bug1068  )
private
test000068::CPPUNIT_TEST_SUITE ( test000068  )
private
test000068::CPPUNIT_TEST_SUITE_END ( )
private
void test000068::setUp ( )

Definition at line 33 of file test000068.cpp.

References CCopasiRootContainer::addDatamodel(), CCopasiRootContainer::init(), and pCOPASIDATAMODEL.

34 {
35  // Create the root container.
36  CCopasiRootContainer::init(0, NULL, false);
37  // Create the global data model.
39 }
static CCopasiDataModel * pCOPASIDATAMODEL
Definition: test000068.h:34
static CCopasiDataModel * addDatamodel()
static void init(int argc, char *argv[], const bool &withGui=false)
void test000068::tearDown ( )

Definition at line 41 of file test000068.cpp.

References CCopasiRootContainer::destroy().

void test000068::test_bug1068 ( )

Definition at line 46 of file test000068.cpp.

References CModelEntity::ASSIGNMENT, CCopasiDataModel::exportSBMLToString(), CModelEntity::FIXED, CCopasiDataModel::getCurrentSBMLDocument(), CCopasiDataModel::getModel(), CCopasiDataModel::importSBMLFromString(), CModel::l, MODEL_STRING1, CModel::Mol, CCopasiDataModel::newModel(), CModelEntity::ODE, pCOPASIDATAMODEL, CModelEntity::REACTIONS, CModel::s, and CEvaluationTree::UserDefined.

47 {
48  CCopasiDataModel* pDataModel = pCOPASIDATAMODEL;
49  CPPUNIT_ASSERT(pDataModel->importSBMLFromString(MODEL_STRING1));
50  CModel* pModel = pDataModel->getModel();
51  CPPUNIT_ASSERT(pModel != NULL);
52  CPPUNIT_ASSERT(pModel->getQuantityUnitEnum() == CModel::Mol);
53  CPPUNIT_ASSERT(pModel->getVolumeUnitEnum() == CModel::l);
54  CPPUNIT_ASSERT(pModel->getTimeUnitEnum() == CModel::s);
55  CPPUNIT_ASSERT(pModel->getCompartments().size() == 1);
56  const CCompartment* pCompartment = pModel->getCompartments()[0];
57  CPPUNIT_ASSERT(pCompartment != NULL);
58  CPPUNIT_ASSERT(pCompartment->getStatus() == CModelEntity::FIXED);
59  CPPUNIT_ASSERT(pModel->getMetabolites().size() == 6);
60  // check metabolites
61  const CMetab* pMetab = pModel->getMetabolites()[0];
62  CPPUNIT_ASSERT(pMetab != NULL);
63  CPPUNIT_ASSERT(pMetab->getObjectName() == "A");
64  CPPUNIT_ASSERT(pMetab->getStatus() == CModelEntity::REACTIONS);
65  pMetab = pModel->getMetabolites()[1];
66  CPPUNIT_ASSERT(pMetab != NULL);
67  CPPUNIT_ASSERT(pMetab->getObjectName() == "B");
68  CPPUNIT_ASSERT(pMetab->getStatus() == CModelEntity::REACTIONS);
69 
70  pMetab = pModel->getMetabolites()[2];
71  CPPUNIT_ASSERT(pMetab != NULL);
72  CPPUNIT_ASSERT(pMetab->getObjectName() == "C");
73  CPPUNIT_ASSERT(pMetab->getStatus() == CModelEntity::ASSIGNMENT);
74  // check assignment
75  const CEvaluationTree* pTree = pMetab->getExpressionPtr();
76  CPPUNIT_ASSERT(pTree != NULL);
77  const CEvaluationNode* pRoot = pTree->getRoot();
78  CPPUNIT_ASSERT(pRoot != NULL);
79  CPPUNIT_ASSERT(dynamic_cast<const CEvaluationNodeCall*>(pRoot) != NULL);
80  CPPUNIT_ASSERT(dynamic_cast<const CEvaluationNodeCall*>(pRoot)->getData() == "function_5");
81 
82  pMetab = pModel->getMetabolites()[3];
83  CPPUNIT_ASSERT(pMetab != NULL);
84  CPPUNIT_ASSERT(pMetab->getObjectName() == "D");
85  CPPUNIT_ASSERT(pMetab->getStatus() == CModelEntity::ODE);
86  // check ode
87  pTree = pMetab->getExpressionPtr();
88  CPPUNIT_ASSERT(pTree != NULL);
89  pRoot = pTree->getRoot();
90  CPPUNIT_ASSERT(pRoot != NULL);
91  CPPUNIT_ASSERT(dynamic_cast<const CEvaluationNodeCall*>(pRoot) != NULL);
92  CPPUNIT_ASSERT(dynamic_cast<const CEvaluationNodeCall*>(pRoot)->getData() == "function_2");
93 
94  pMetab = pModel->getMetabolites()[4];
95  CPPUNIT_ASSERT(pMetab != NULL);
96  CPPUNIT_ASSERT(pMetab->getObjectName() == "E");
97  CPPUNIT_ASSERT(pMetab->getStatus() == CModelEntity::ODE);
98  // check ode
99  pTree = pMetab->getExpressionPtr();
100  CPPUNIT_ASSERT(pTree != NULL);
101  pRoot = pTree->getRoot();
102  CPPUNIT_ASSERT(pRoot != NULL);
103  CPPUNIT_ASSERT(dynamic_cast<const CEvaluationNodeCall*>(pRoot) != NULL);
104  CPPUNIT_ASSERT(dynamic_cast<const CEvaluationNodeCall*>(pRoot)->getData() == "function_4");
105 
106  pMetab = pModel->getMetabolites()[5];
107  CPPUNIT_ASSERT(pMetab != NULL);
108  CPPUNIT_ASSERT(pMetab->getObjectName() == "F");
109  CPPUNIT_ASSERT(pMetab->getStatus() == CModelEntity::ODE);
110  // check ode
111  pTree = pMetab->getExpressionPtr();
112  CPPUNIT_ASSERT(pTree != NULL);
113  pRoot = pTree->getRoot();
114  CPPUNIT_ASSERT(pRoot != NULL);
115  CPPUNIT_ASSERT(dynamic_cast<const CEvaluationNodeCall*>(pRoot) != NULL);
116  CPPUNIT_ASSERT(dynamic_cast<const CEvaluationNodeCall*>(pRoot)->getData() == "function_6");
117 
118  // check model values
119  CPPUNIT_ASSERT(pModel->getModelValues().size() == 3);
120  const CModelValue* pModelValue = pModel->getModelValues()[0];
121  CPPUNIT_ASSERT(pModelValue != NULL);
122  CPPUNIT_ASSERT(pModelValue->getObjectName() == "K1");
123  CPPUNIT_ASSERT(pModelValue->getStatus() == CModelEntity::ASSIGNMENT);
124  // check assignment
125  pTree = pModelValue->getExpressionPtr();
126  CPPUNIT_ASSERT(pTree != NULL);
127  pRoot = pTree->getRoot();
128  CPPUNIT_ASSERT(pRoot != NULL);
129  CPPUNIT_ASSERT(dynamic_cast<const CEvaluationNodeCall*>(pRoot) != NULL);
130  CPPUNIT_ASSERT(dynamic_cast<const CEvaluationNodeCall*>(pRoot)->getData() == "function_1");
131 
132  pModelValue = pModel->getModelValues()[1];
133  CPPUNIT_ASSERT(pModelValue != NULL);
134  CPPUNIT_ASSERT(pModelValue->getObjectName() == "K2");
135  CPPUNIT_ASSERT(pModelValue->getStatus() == CModelEntity::FIXED);
136 
137  pModelValue = pModel->getModelValues()[2];
138  CPPUNIT_ASSERT(pModelValue != NULL);
139  CPPUNIT_ASSERT(pModelValue->getObjectName() == "K3");
140  // check assignment
141  pTree = pModelValue->getExpressionPtr();
142  CPPUNIT_ASSERT(pTree != NULL);
143  pRoot = pTree->getRoot();
144  CPPUNIT_ASSERT(pRoot != NULL);
145  CPPUNIT_ASSERT(dynamic_cast<const CEvaluationNodeCall*>(pRoot) != NULL);
146  CPPUNIT_ASSERT(dynamic_cast<const CEvaluationNodeCall*>(pRoot)->getData() == "function_3");
147 
148  CPPUNIT_ASSERT(pModel->getReactions().size() == 6);
149  // check reactions
150  const CReaction* pReaction = pModel->getReactions()[0];
151  CPPUNIT_ASSERT(pReaction != NULL);
152  CPPUNIT_ASSERT(pReaction->getChemEq().getSubstrates().size() == 1);
153  CPPUNIT_ASSERT(pReaction->getChemEq().getProducts().size() == 1);
154  CPPUNIT_ASSERT(pReaction->getChemEq().getModifiers().size() == 0);
155  CPPUNIT_ASSERT(pReaction->isReversible() == true);
156  // check the kinetic law
157  CPPUNIT_ASSERT(pReaction->getParameters().size() == 1);
158  const CFunction* pFunction = pReaction->getFunction();
159  CPPUNIT_ASSERT(pFunction != NULL);
160  CPPUNIT_ASSERT(pFunction->getType() == CEvaluationTree::UserDefined);
161  CPPUNIT_ASSERT(pFunction->getObjectName() == "Function for reaction1");
162  pRoot = pFunction->getRoot();
163  CPPUNIT_ASSERT(pRoot != NULL);
164 
165  pReaction = pModel->getReactions()[1];
166  CPPUNIT_ASSERT(pReaction != NULL);
167  CPPUNIT_ASSERT(pReaction->getChemEq().getSubstrates().size() == 1);
168  CPPUNIT_ASSERT(pReaction->getChemEq().getProducts().size() == 1);
169  CPPUNIT_ASSERT(pReaction->getChemEq().getModifiers().size() == 0);
170  CPPUNIT_ASSERT(pReaction->isReversible() == true);
171  // check the kinetic law
172  CPPUNIT_ASSERT(pReaction->getParameters().size() == 2);
173  pFunction = pReaction->getFunction();
174  CPPUNIT_ASSERT(pFunction != NULL);
175  CPPUNIT_ASSERT(pFunction->getType() == CEvaluationTree::UserDefined);
176  CPPUNIT_ASSERT(pFunction->getObjectName() == "Function for reaction2");
177  pRoot = pFunction->getRoot();
178  CPPUNIT_ASSERT(pRoot != NULL);
179 
180  pReaction = pModel->getReactions()[2];
181  CPPUNIT_ASSERT(pReaction != NULL);
182  CPPUNIT_ASSERT(pReaction->getChemEq().getSubstrates().size() == 1);
183  CPPUNIT_ASSERT(pReaction->getChemEq().getProducts().size() == 1);
184  CPPUNIT_ASSERT(pReaction->getChemEq().getModifiers().size() == 0);
185  CPPUNIT_ASSERT(pReaction->isReversible() == true);
186  // check the kinetic law
187  CPPUNIT_ASSERT(pReaction->getParameters().size() == 1);
188  pFunction = pReaction->getFunction();
189  CPPUNIT_ASSERT(pFunction != NULL);
190  CPPUNIT_ASSERT(pFunction->getType() == CEvaluationTree::UserDefined);
191  CPPUNIT_ASSERT(pFunction->getObjectName() == "Function for reaction3");
192  pRoot = pFunction->getRoot();
193  CPPUNIT_ASSERT(pRoot != NULL);
194 
195  pReaction = pModel->getReactions()[3];
196  CPPUNIT_ASSERT(pReaction != NULL);
197  CPPUNIT_ASSERT(pReaction->getChemEq().getSubstrates().size() == 1);
198  CPPUNIT_ASSERT(pReaction->getChemEq().getProducts().size() == 1);
199  CPPUNIT_ASSERT(pReaction->getChemEq().getModifiers().size() == 0);
200  CPPUNIT_ASSERT(pReaction->isReversible() == true);
201  // check the kinetic law
202  CPPUNIT_ASSERT(pReaction->getParameters().size() == 0);
203  pFunction = pReaction->getFunction();
204  CPPUNIT_ASSERT(pFunction != NULL);
205  CPPUNIT_ASSERT(pFunction->getType() == CEvaluationTree::UserDefined);
206  CPPUNIT_ASSERT(pFunction->getObjectName() == "Function for reaction4");
207  pRoot = pFunction->getRoot();
208  CPPUNIT_ASSERT(pRoot != NULL);
209 
210  pReaction = pModel->getReactions()[4];
211  CPPUNIT_ASSERT(pReaction != NULL);
212  CPPUNIT_ASSERT(pReaction->getChemEq().getSubstrates().size() == 1);
213  CPPUNIT_ASSERT(pReaction->getChemEq().getProducts().size() == 1);
214  CPPUNIT_ASSERT(pReaction->getChemEq().getModifiers().size() == 0);
215  CPPUNIT_ASSERT(pReaction->isReversible() == true);
216  // check the kinetic law
217  CPPUNIT_ASSERT(pReaction->getParameters().size() == 2);
218  pFunction = pReaction->getFunction();
219  CPPUNIT_ASSERT(pFunction != NULL);
220  CPPUNIT_ASSERT(pFunction->getType() == CEvaluationTree::UserDefined);
221  CPPUNIT_ASSERT(pFunction->getObjectName() == "Function for reaction5");
222  pRoot = pFunction->getRoot();
223  CPPUNIT_ASSERT(pRoot != NULL);
224 
225  pReaction = pModel->getReactions()[5];
226  CPPUNIT_ASSERT(pReaction != NULL);
227  CPPUNIT_ASSERT(pReaction->getChemEq().getSubstrates().size() == 1);
228  CPPUNIT_ASSERT(pReaction->getChemEq().getProducts().size() == 1);
229  CPPUNIT_ASSERT(pReaction->getChemEq().getModifiers().size() == 0);
230  CPPUNIT_ASSERT(pReaction->isReversible() == true);
231  // check the kinetic law
232  CPPUNIT_ASSERT(pReaction->getParameters().size() == 3);
233  pFunction = pReaction->getFunction();
234  CPPUNIT_ASSERT(pFunction != NULL);
235  CPPUNIT_ASSERT(pFunction->getType() == CEvaluationTree::UserDefined);
236  CPPUNIT_ASSERT(pFunction->getObjectName() == "Function for reaction6");
237  pRoot = pFunction->getRoot();
238  CPPUNIT_ASSERT(pRoot != NULL);
239 
240  // export to SBML
241  std::string s = pDataModel->exportSBMLToString(NULL, 1, 2);
242  CPPUNIT_ASSERT(s.empty() == false);
243  // due to the bugfix for Bug 1086 and some issues with libsbml and the current exporter,
244  // we now no longer have a L1 document in the datamodel if there was an SBMLDocument prior
245  // to exporting to L1 already.
246  // To test now, we have to call newModel on the datamodel to delete the old sbml document,
247  // and reimport the exported model
248  // This will also lead to a Level 2 Version 1 model since we convert all Level 1 model to
249  // Level 2 Version 1 on import, but we can at least test if the export worked.
250  pCOPASIDATAMODEL->newModel(NULL, true);
251  CPPUNIT_ASSERT(pCOPASIDATAMODEL->importSBMLFromString(s));
252  // check the sbml model
253  const SBMLDocument* pDocument = pCOPASIDATAMODEL->getCurrentSBMLDocument();
254  CPPUNIT_ASSERT(pDocument != NULL);
255  CPPUNIT_ASSERT(pDocument->getLevel() == 2);
256  CPPUNIT_ASSERT(pDocument->getVersion() == 1);
257  const Model* pSBMLModel = pDocument->getModel();
258  CPPUNIT_ASSERT(pSBMLModel != NULL);
259 
260  CPPUNIT_ASSERT(pSBMLModel->getListOfFunctionDefinitions()->size() == 0);
261  CPPUNIT_ASSERT(pSBMLModel->getListOfCompartments()->size() == 1);
262  CPPUNIT_ASSERT(pSBMLModel->getListOfSpecies()->size() == 6);
263  CPPUNIT_ASSERT(pSBMLModel->getListOfParameters()->size() == 3);
264  CPPUNIT_ASSERT(pSBMLModel->getListOfRules()->size() == 6);
265  CPPUNIT_ASSERT(pSBMLModel->getListOfReactions()->size() == 6);
266 
267  std::map<std::string, const Rule*> ruleMap;
268  unsigned int i, iMax = pSBMLModel->getListOfRules()->size();
269  const Rule* pRule = NULL;
270 
271  for (i = 0; i < iMax; ++i)
272  {
273  pRule = pSBMLModel->getRule(i);
274  ruleMap.insert(std::pair<std::string, const Rule*>(pRule->getVariable(), pRule));
275  }
276 
277  // check the rules
278  std::map<std::string, const Rule*>::const_iterator pos = ruleMap.find("parameter_1");
279  CPPUNIT_ASSERT(pos != ruleMap.end());
280  pRule = pos->second;
281  CPPUNIT_ASSERT(pRule != NULL);
282  CPPUNIT_ASSERT(pRule->getVariable() == "parameter_1");
283  const ASTNode* pMath = pRule->getMath();
284  CPPUNIT_ASSERT(pMath != NULL);
285  // only check the infix
286  std::string formula = pRule->getFormula();
287  CPPUNIT_ASSERT(formula == "3 * 4.5");
288 
289  pos = ruleMap.find("parameter_3");
290  CPPUNIT_ASSERT(pos != ruleMap.end());
291  pRule = pos->second;
292  CPPUNIT_ASSERT(pRule != NULL);
293  CPPUNIT_ASSERT(pRule->getVariable() == "parameter_3");
294  pRule->getMath();
295  CPPUNIT_ASSERT(pMath != NULL);
296  // only check the infix
297  formula = pRule->getFormula();
298  CPPUNIT_ASSERT(formula == "parameter_1 - 2 * 1.3");
299 
300  pos = ruleMap.find("species_3");
301  CPPUNIT_ASSERT(pos != ruleMap.end());
302  pRule = pos->second;
303  CPPUNIT_ASSERT(pRule != NULL);
304  CPPUNIT_ASSERT(pRule->getVariable() == "species_3");
305  pRule->getMath();
306  CPPUNIT_ASSERT(pMath != NULL);
307  // only check the infix
308  formula = pRule->getFormula();
309  CPPUNIT_ASSERT(formula == "parameter_1 - 3.5 * 1.3 + (3 * 2.4 - 5.23)");
310 
311  pos = ruleMap.find("species_4");
312  CPPUNIT_ASSERT(pos != ruleMap.end());
313  pRule = pos->second;
314  CPPUNIT_ASSERT(pRule != NULL);
315  CPPUNIT_ASSERT(pRule->getVariable() == "species_4");
316  pRule->getMath();
317  CPPUNIT_ASSERT(pMath != NULL);
318  // only check the infix
319  formula = pRule->getFormula();
320  CPPUNIT_ASSERT(formula == "3.4 + parameter_1");
321 
322  pos = ruleMap.find("species_5");
323  CPPUNIT_ASSERT(pos != ruleMap.end());
324  pRule = pos->second;
325  CPPUNIT_ASSERT(pRule != NULL);
326  CPPUNIT_ASSERT(pRule->getVariable() == "species_5");
327  pRule->getMath();
328  CPPUNIT_ASSERT(pMath != NULL);
329  // only check the infix
330  formula = pRule->getFormula();
331  CPPUNIT_ASSERT(formula == "(parameter_2 + 1.4) / 2");
332 
333  pos = ruleMap.find("species_6");
334  CPPUNIT_ASSERT(pos != ruleMap.end());
335  pRule = pos->second;
336  CPPUNIT_ASSERT(pRule != NULL);
337  CPPUNIT_ASSERT(pRule->getVariable() == "species_6");
338  pRule->getMath();
339  CPPUNIT_ASSERT(pMath != NULL);
340  // only check the infix
341  formula = pRule->getFormula();
342  CPPUNIT_ASSERT(formula == "parameter_3 - 3.4 * 1.3 + (3 * parameter_1 - 5.23)");
343 
344  // check the reactions
345  const Reaction* pSBMLReaction = pSBMLModel->getReaction(0);
346  CPPUNIT_ASSERT(pSBMLReaction != NULL);
347  CPPUNIT_ASSERT(pSBMLReaction->getListOfReactants()->size() == 1);
348  CPPUNIT_ASSERT(pSBMLReaction->getListOfProducts()->size() == 1);
349  CPPUNIT_ASSERT(pSBMLReaction->getListOfModifiers()->size() == 0);
350  CPPUNIT_ASSERT(pSBMLReaction->getReversible() == true);
351  CPPUNIT_ASSERT(pSBMLReaction->getKineticLaw() != NULL);
352  CPPUNIT_ASSERT(pSBMLReaction->getKineticLaw()->getListOfParameters()->size() == 0);
353  pMath = pSBMLReaction->getKineticLaw()->getMath();
354  CPPUNIT_ASSERT(pMath != NULL);
355  formula = pSBMLReaction->getKineticLaw()->getFormula();
356  CPPUNIT_ASSERT(formula == "compartment_1 * 3 * parameter_1");
357 
358  pSBMLReaction = pSBMLModel->getReaction(1);
359  CPPUNIT_ASSERT(pSBMLReaction != NULL);
360  CPPUNIT_ASSERT(pSBMLReaction->getListOfReactants()->size() == 1);
361  CPPUNIT_ASSERT(pSBMLReaction->getListOfProducts()->size() == 1);
362  CPPUNIT_ASSERT(pSBMLReaction->getListOfModifiers()->size() == 0);
363  CPPUNIT_ASSERT(pSBMLReaction->getReversible() == true);
364  CPPUNIT_ASSERT(pSBMLReaction->getKineticLaw() != NULL);
365  CPPUNIT_ASSERT(pSBMLReaction->getKineticLaw()->getListOfParameters()->size() == 0);
366  pMath = pSBMLReaction->getKineticLaw()->getMath();
367  CPPUNIT_ASSERT(pMath != NULL);
368  formula = pSBMLReaction->getKineticLaw()->getFormula();
369  CPPUNIT_ASSERT(formula == "compartment_1 * (parameter_2 + parameter_1)");
370 
371  pSBMLReaction = pSBMLModel->getReaction(2);
372  CPPUNIT_ASSERT(pSBMLReaction != NULL);
373  CPPUNIT_ASSERT(pSBMLReaction->getListOfReactants()->size() == 1);
374  CPPUNIT_ASSERT(pSBMLReaction->getListOfProducts()->size() == 1);
375  CPPUNIT_ASSERT(pSBMLReaction->getListOfModifiers()->size() == 0);
376  CPPUNIT_ASSERT(pSBMLReaction->getReversible() == true);
377  CPPUNIT_ASSERT(pSBMLReaction->getKineticLaw() != NULL);
378  CPPUNIT_ASSERT(pSBMLReaction->getKineticLaw()->getListOfParameters()->size() == 0);
379  pMath = pSBMLReaction->getKineticLaw()->getMath();
380  CPPUNIT_ASSERT(pMath != NULL);
381  formula = pSBMLReaction->getKineticLaw()->getFormula();
382  CPPUNIT_ASSERT(formula == "compartment_1 * (species_2 - parameter_1 * 1.3)");
383 
384  pSBMLReaction = pSBMLModel->getReaction(3);
385  CPPUNIT_ASSERT(pSBMLReaction != NULL);
386  CPPUNIT_ASSERT(pSBMLReaction->getListOfReactants()->size() == 1);
387  CPPUNIT_ASSERT(pSBMLReaction->getListOfProducts()->size() == 1);
388  CPPUNIT_ASSERT(pSBMLReaction->getListOfModifiers()->size() == 0);
389  CPPUNIT_ASSERT(pSBMLReaction->getReversible() == true);
390  CPPUNIT_ASSERT(pSBMLReaction->getKineticLaw() != NULL);
391  CPPUNIT_ASSERT(pSBMLReaction->getKineticLaw()->getListOfParameters()->size() == 0);
392  pMath = pSBMLReaction->getKineticLaw()->getMath();
393  CPPUNIT_ASSERT(pMath != NULL);
394  formula = pSBMLReaction->getKineticLaw()->getFormula();
395  CPPUNIT_ASSERT(formula == "compartment_1 * ((species_2 + species_1) / 2)");
396 
397  pSBMLReaction = pSBMLModel->getReaction(4);
398  CPPUNIT_ASSERT(pSBMLReaction != NULL);
399  CPPUNIT_ASSERT(pSBMLReaction->getListOfReactants()->size() == 1);
400  CPPUNIT_ASSERT(pSBMLReaction->getListOfProducts()->size() == 1);
401  CPPUNIT_ASSERT(pSBMLReaction->getListOfModifiers()->size() == 0);
402  CPPUNIT_ASSERT(pSBMLReaction->getReversible() == true);
403  CPPUNIT_ASSERT(pSBMLReaction->getKineticLaw() != NULL);
404  CPPUNIT_ASSERT(pSBMLReaction->getKineticLaw()->getListOfParameters()->size() == 0);
405  pMath = pSBMLReaction->getKineticLaw()->getMath();
406  CPPUNIT_ASSERT(pMath != NULL);
407  formula = pSBMLReaction->getKineticLaw()->getFormula();
408  CPPUNIT_ASSERT(formula == "compartment_1 * (parameter_1 - species_2 * 1.3 + (3 * parameter_3 - 5.23))");
409 
410  pSBMLReaction = pSBMLModel->getReaction(5);
411  CPPUNIT_ASSERT(pSBMLReaction != NULL);
412  CPPUNIT_ASSERT(pSBMLReaction->getListOfReactants()->size() == 1);
413  CPPUNIT_ASSERT(pSBMLReaction->getListOfProducts()->size() == 1);
414  CPPUNIT_ASSERT(pSBMLReaction->getListOfModifiers()->size() == 0);
415  CPPUNIT_ASSERT(pSBMLReaction->getReversible() == true);
416  CPPUNIT_ASSERT(pSBMLReaction->getKineticLaw() != NULL);
417  CPPUNIT_ASSERT(pSBMLReaction->getKineticLaw()->getListOfParameters()->size() == 0);
418  pMath = pSBMLReaction->getKineticLaw()->getMath();
419  CPPUNIT_ASSERT(pMath != NULL);
420  formula = pSBMLReaction->getKineticLaw()->getFormula();
421  CPPUNIT_ASSERT(formula == "compartment_1 * (parameter_1 - parameter_3 * 1.3 + (3 * parameter_2 - 5.23))");
422 }
SBMLDocument * getCurrentSBMLDocument()
std::string exportSBMLToString(CProcessReport *pExportHandler, int sbmlLevel, int sbmlVersion)
static const char * MODEL_STRING1
Definition: test000068.h:33
bool newModel(CProcessReport *pProcessReport, const bool &deleteOldData)
Definition: CMetab.h:178
static CCopasiDataModel * pCOPASIDATAMODEL
Definition: test000068.h:34
bool importSBMLFromString(const std::string &sbmlDocumentText, CProcessReport *pImportHandler=NULL, const bool &deleteOldData=true)
The class for handling a chemical kinetic function.
Definition: CFunction.h:29
Definition: CModel.h:50

Member Data Documentation

const char * test000068::MODEL_STRING1
staticprotected

Definition at line 33 of file test000068.h.

Referenced by test_bug1068().

CCopasiDataModel * test000068::pCOPASIDATAMODEL = NULL
staticprotected

Definition at line 34 of file test000068.h.

Referenced by setUp(), and test_bug1068().


The documentation for this class was generated from the following files: