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

#include <test000069.h>

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

Public Member Functions

void setUp ()
 
void tearDown ()
 
void test_bug1069 ()
 

Static Protected Attributes

static const char * MODEL_STRING1
 
static CCopasiDataModelpCOPASIDATAMODEL = NULL
 

Private Member Functions

 CPPUNIT_TEST (test_bug1069)
 
 CPPUNIT_TEST_SUITE (test000069)
 
 CPPUNIT_TEST_SUITE_END ()
 

Detailed Description

Definition at line 26 of file test000069.h.

Member Function Documentation

test000069::CPPUNIT_TEST ( test_bug1069  )
private
test000069::CPPUNIT_TEST_SUITE ( test000069  )
private
test000069::CPPUNIT_TEST_SUITE_END ( )
private
void test000069::setUp ( )

Definition at line 38 of file test000069.cpp.

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

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

Definition at line 46 of file test000069.cpp.

References CCopasiRootContainer::destroy().

void test000069::test_bug1069 ( )

Definition at line 51 of file test000069.cpp.

References CModelEntity::ASSIGNMENT, CCopasiDataModel::exportSBMLToString(), CModelEntity::FIXED, CModel::getCompartments(), CCopasiDataModel::getCurrentSBMLDocument(), CModel::getMetabolites(), CCopasiDataModel::getModel(), CModel::getModelValues(), CModel::getQuantityUnitEnum(), CModel::getReactions(), CModel::getTimeUnitEnum(), CModel::getVolumeUnitEnum(), CModel::l, load_cps_model_from_stream(), MODEL_STRING1, CModel::Mol, CModelEntity::ODE, pCOPASIDATAMODEL, CModelEntity::REACTIONS, CModel::s, CCopasiVector< T >::size(), and CEvaluationTree::UserDefined.

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

Member Data Documentation

const char * test000069::MODEL_STRING1
staticprotected

Definition at line 33 of file test000069.h.

Referenced by test_bug1069().

CCopasiDataModel * test000069::pCOPASIDATAMODEL = NULL
staticprotected

These tests are supposed to make sure that assignments on a species with the hasOnlySubstanceUnits flag set are exported correctly. It tests rules and event assignments with and without the flag set.

Definition at line 34 of file test000069.h.

Referenced by setUp(), and test_bug1069().


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