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

#include <test000086.h>

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

Public Member Functions

void setUp ()
 
void tearDown ()
 
void test_import_compartment_units_1 ()
 
void test_import_compartment_units_10 ()
 
void test_import_compartment_units_11 ()
 
void test_import_compartment_units_2 ()
 
void test_import_compartment_units_3 ()
 
void test_import_compartment_units_4 ()
 
void test_import_compartment_units_5 ()
 
void test_import_compartment_units_6 ()
 
void test_import_compartment_units_7 ()
 
void test_import_compartment_units_8 ()
 
void test_import_compartment_units_9 ()
 

Static Protected Attributes

static const char * MODEL_STRING1
 
static const char * MODEL_STRING10
 
static const char * MODEL_STRING11
 
static const char * MODEL_STRING2
 
static const char * MODEL_STRING3
 
static const char * MODEL_STRING4
 
static const char * MODEL_STRING5
 
static const char * MODEL_STRING6
 
static const char * MODEL_STRING7
 
static const char * MODEL_STRING8
 
static const char * MODEL_STRING9
 
static CCopasiDataModelpCOPASIDATAMODEL = NULL
 

Private Member Functions

 CPPUNIT_TEST (test_import_compartment_units_1)
 
 CPPUNIT_TEST (test_import_compartment_units_2)
 
 CPPUNIT_TEST (test_import_compartment_units_3)
 
 CPPUNIT_TEST (test_import_compartment_units_4)
 
 CPPUNIT_TEST (test_import_compartment_units_5)
 
 CPPUNIT_TEST (test_import_compartment_units_6)
 
 CPPUNIT_TEST (test_import_compartment_units_7)
 
 CPPUNIT_TEST (test_import_compartment_units_8)
 
 CPPUNIT_TEST (test_import_compartment_units_9)
 
 CPPUNIT_TEST (test_import_compartment_units_10)
 
 CPPUNIT_TEST (test_import_compartment_units_11)
 
 CPPUNIT_TEST_SUITE (test000086)
 
 CPPUNIT_TEST_SUITE_END ()
 

Detailed Description

Definition at line 28 of file test000086.h.

Member Function Documentation

test000086::CPPUNIT_TEST ( test_import_compartment_units_1  )
private
test000086::CPPUNIT_TEST ( test_import_compartment_units_2  )
private
test000086::CPPUNIT_TEST ( test_import_compartment_units_3  )
private
test000086::CPPUNIT_TEST ( test_import_compartment_units_4  )
private
test000086::CPPUNIT_TEST ( test_import_compartment_units_5  )
private
test000086::CPPUNIT_TEST ( test_import_compartment_units_6  )
private
test000086::CPPUNIT_TEST ( test_import_compartment_units_7  )
private
test000086::CPPUNIT_TEST ( test_import_compartment_units_8  )
private
test000086::CPPUNIT_TEST ( test_import_compartment_units_9  )
private
test000086::CPPUNIT_TEST ( test_import_compartment_units_10  )
private
test000086::CPPUNIT_TEST ( test_import_compartment_units_11  )
private
test000086::CPPUNIT_TEST_SUITE ( test000086  )
private
test000086::CPPUNIT_TEST_SUITE_END ( )
private
void test000086::setUp ( )

Definition at line 36 of file test000086.cpp.

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

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

Definition at line 44 of file test000086.cpp.

References CCopasiRootContainer::destroy().

void test000086::test_import_compartment_units_1 ( )

Definition at line 49 of file test000086.cpp.

References CCopasiMessage::getLastMessage(), CCopasiDataModel::getModel(), CCopasiMessage::getNumber(), CCopasiDataModel::importSBMLFromString(), MCSBML, MODEL_STRING1, pCOPASIDATAMODEL, and CCopasiMessage::size().

50 {
51  CCopasiDataModel* pDataModel = pCOPASIDATAMODEL;
52  CPPUNIT_ASSERT(pDataModel->importSBMLFromString(MODEL_STRING1));
53  CModel* pModel = pDataModel->getModel();
54  CPPUNIT_ASSERT(pModel->getCompartments().size() == 1);
55  CPPUNIT_ASSERT(pModel != NULL);
56  // make sure there is no warning about inconsistent units
57  unsigned int i = 0, iMax = CCopasiMessage::size();
58  unsigned int found24 = 0;
59  unsigned int found55 = 0;
60  unsigned int found66 = 0;
61  unsigned int found79 = 0;
62 
63  while (i < iMax)
64  {
66 
67  // check for messages about inconsistent units
68  if (message.getNumber() == MCSBML + 24)
69  {
70  ++found24;
71  }
72 
73  // check for import errors
74  if (message.getNumber() == MCSBML + 55)
75  {
76  ++found55;
77  }
78 
79  // check for import errors
80  if (message.getNumber() == MCSBML + 66)
81  {
82  ++found66;
83  }
84 
85  // check for import errors
86  if (message.getNumber() == MCSBML + 79)
87  {
88  ++found79;
89  }
90 
91  ++i;
92  }
93 
94  CPPUNIT_ASSERT(found55 == 0);
95  CPPUNIT_ASSERT(found24 == 0);
96  CPPUNIT_ASSERT(found66 == 0);
97  CPPUNIT_ASSERT(found79 == 1);
98 }
static CCopasiDataModel * pCOPASIDATAMODEL
Definition: test000086.h:81
static const char * MODEL_STRING1
Definition: test000086.h:49
const size_t & getNumber() const
#define MCSBML
static size_t size()
static CCopasiMessage getLastMessage()
bool importSBMLFromString(const std::string &sbmlDocumentText, CProcessReport *pImportHandler=NULL, const bool &deleteOldData=true)
Definition: CModel.h:50
void test000086::test_import_compartment_units_10 ( )

Definition at line 480 of file test000086.cpp.

References CCopasiMessage::getLastMessage(), CCopasiDataModel::getModel(), CCopasiMessage::getNumber(), CCopasiDataModel::importSBMLFromString(), MCSBML, MODEL_STRING10, pCOPASIDATAMODEL, and CCopasiMessage::size().

481 {
482  CCopasiDataModel* pDataModel = pCOPASIDATAMODEL;
483  CPPUNIT_ASSERT(pDataModel->importSBMLFromString(MODEL_STRING10));
484  CModel* pModel = pDataModel->getModel();
485  CPPUNIT_ASSERT(pModel->getCompartments().size() == 1);
486  CPPUNIT_ASSERT(pModel != NULL);
487  // make sure there is no warning about inconsistent units
488  unsigned int i = 0, iMax = CCopasiMessage::size();
489  unsigned int found24 = 0;
490  unsigned int found55 = 0;
491  unsigned int found66 = 0;
492  unsigned int found79 = 0;
493 
494  while (i < iMax)
495  {
497 
498  // check for messages about inconsistent units
499  if (message.getNumber() == MCSBML + 24)
500  {
501  ++found24;
502  }
503 
504  // check for import errors
505  if (message.getNumber() == MCSBML + 55)
506  {
507  ++found55;
508  }
509 
510  // check for import errors
511  if (message.getNumber() == MCSBML + 66)
512  {
513  ++found66;
514  }
515 
516  // check for import errors
517  if (message.getNumber() == MCSBML + 79)
518  {
519  ++found79;
520  }
521 
522  ++i;
523  }
524 
525  CPPUNIT_ASSERT(found55 == 0);
526  CPPUNIT_ASSERT(found24 == 0);
527  CPPUNIT_ASSERT(found66 == 0);
528  CPPUNIT_ASSERT(found79 == 1);
529 }
static CCopasiDataModel * pCOPASIDATAMODEL
Definition: test000086.h:81
const size_t & getNumber() const
#define MCSBML
static size_t size()
static CCopasiMessage getLastMessage()
bool importSBMLFromString(const std::string &sbmlDocumentText, CProcessReport *pImportHandler=NULL, const bool &deleteOldData=true)
Definition: CModel.h:50
static const char * MODEL_STRING10
Definition: test000086.h:76
void test000086::test_import_compartment_units_11 ( )

Definition at line 531 of file test000086.cpp.

References CCopasiMessage::getLastMessage(), CCopasiDataModel::getModel(), CCopasiMessage::getNumber(), CCopasiDataModel::importSBMLFromString(), MCSBML, MODEL_STRING11, pCOPASIDATAMODEL, and CCopasiMessage::size().

532 {
533  CCopasiDataModel* pDataModel = pCOPASIDATAMODEL;
534  CPPUNIT_ASSERT(pDataModel->importSBMLFromString(MODEL_STRING11));
535  CModel* pModel = pDataModel->getModel();
536  CPPUNIT_ASSERT(pModel->getCompartments().size() == 2);
537  CPPUNIT_ASSERT(pModel != NULL);
538  // make sure there is no warning about inconsistent units
539  unsigned int i = 0, iMax = CCopasiMessage::size();
540  unsigned int found24 = 0;
541  unsigned int found55 = 0;
542  unsigned int found66 = 0;
543  unsigned int found79 = 0;
544 
545  while (i < iMax)
546  {
548 
549  // check for messages about inconsistent units
550  if (message.getNumber() == MCSBML + 24)
551  {
552  ++found24;
553  }
554 
555  // check for import errors
556  if (message.getNumber() == MCSBML + 55)
557  {
558  ++found55;
559  }
560 
561  // check for import errors
562  if (message.getNumber() == MCSBML + 66)
563  {
564  ++found66;
565  }
566 
567  // check for import errors
568  if (message.getNumber() == MCSBML + 79)
569  {
570  ++found79;
571  }
572 
573  ++i;
574  }
575 
576  CPPUNIT_ASSERT(found55 == 0);
577  CPPUNIT_ASSERT(found24 == 0);
578  CPPUNIT_ASSERT(found66 == 0);
579  CPPUNIT_ASSERT(found79 == 0);
580 }
static CCopasiDataModel * pCOPASIDATAMODEL
Definition: test000086.h:81
static const char * MODEL_STRING11
Definition: test000086.h:79
const size_t & getNumber() const
#define MCSBML
static size_t size()
static CCopasiMessage getLastMessage()
bool importSBMLFromString(const std::string &sbmlDocumentText, CProcessReport *pImportHandler=NULL, const bool &deleteOldData=true)
Definition: CModel.h:50
void test000086::test_import_compartment_units_2 ( )

Definition at line 100 of file test000086.cpp.

References CCopasiMessage::getLastMessage(), CCopasiDataModel::getModel(), CCopasiMessage::getNumber(), CCopasiDataModel::importSBMLFromString(), MCSBML, MODEL_STRING2, pCOPASIDATAMODEL, and CCopasiMessage::size().

101 {
102  CCopasiDataModel* pDataModel = pCOPASIDATAMODEL;
103  CPPUNIT_ASSERT(pDataModel->importSBMLFromString(MODEL_STRING2));
104  CModel* pModel = pDataModel->getModel();
105  CPPUNIT_ASSERT(pModel->getCompartments().size() == 1);
106  CPPUNIT_ASSERT(pModel != NULL);
107  // make sure there is no warning about inconsistent units
108  unsigned int i = 0, iMax = CCopasiMessage::size();
109  unsigned int found24 = 0;
110  unsigned int found55 = 0;
111  unsigned int found66 = 0;
112  unsigned int found79 = 0;
113 
114  while (i < iMax)
115  {
117 
118  // check for messages about inconsistent units
119  if (message.getNumber() == MCSBML + 24)
120  {
121  ++found24;
122  }
123 
124  // check for import errors
125  if (message.getNumber() == MCSBML + 55)
126  {
127  ++found55;
128  }
129 
130  // check for import errors
131  if (message.getNumber() == MCSBML + 66)
132  {
133  ++found66;
134  }
135 
136  // check for import errors
137  if (message.getNumber() == MCSBML + 79)
138  {
139  ++found79;
140  }
141 
142  ++i;
143  }
144 
145  CPPUNIT_ASSERT(found55 == 0);
146  CPPUNIT_ASSERT(found24 == 0);
147  CPPUNIT_ASSERT(found66 == 0);
148  CPPUNIT_ASSERT(found79 == 1);
149 }
static CCopasiDataModel * pCOPASIDATAMODEL
Definition: test000086.h:81
const size_t & getNumber() const
#define MCSBML
static const char * MODEL_STRING2
Definition: test000086.h:52
static size_t size()
static CCopasiMessage getLastMessage()
bool importSBMLFromString(const std::string &sbmlDocumentText, CProcessReport *pImportHandler=NULL, const bool &deleteOldData=true)
Definition: CModel.h:50
void test000086::test_import_compartment_units_3 ( )

Definition at line 151 of file test000086.cpp.

References CCopasiMessage::getLastMessage(), CCopasiDataModel::getModel(), CCopasiMessage::getNumber(), CCopasiDataModel::importSBMLFromString(), MCSBML, MODEL_STRING3, pCOPASIDATAMODEL, and CCopasiMessage::size().

152 {
153  CCopasiDataModel* pDataModel = pCOPASIDATAMODEL;
154  CPPUNIT_ASSERT(pDataModel->importSBMLFromString(MODEL_STRING3));
155  CModel* pModel = pDataModel->getModel();
156  CPPUNIT_ASSERT(pModel->getCompartments().size() == 1);
157  CPPUNIT_ASSERT(pModel != NULL);
158  // make sure there is no warning about inconsistent units
159  unsigned int i = 0, iMax = CCopasiMessage::size();
160  unsigned int found24 = 0;
161  unsigned int found55 = 0;
162  unsigned int found66 = 0;
163  unsigned int found79 = 0;
164 
165  while (i < iMax)
166  {
168 
169  // check for messages about inconsistent units
170  if (message.getNumber() == MCSBML + 24)
171  {
172  ++found24;
173  }
174 
175  // check for import errors
176  if (message.getNumber() == MCSBML + 55)
177  {
178  ++found55;
179  }
180 
181  // check for import errors
182  if (message.getNumber() == MCSBML + 66)
183  {
184  ++found66;
185  }
186 
187  // check for import errors
188  if (message.getNumber() == MCSBML + 79)
189  {
190  ++found79;
191  }
192 
193  ++i;
194  }
195 
196  CPPUNIT_ASSERT(found55 == 0);
197  CPPUNIT_ASSERT(found24 == 0);
198  CPPUNIT_ASSERT(found66 == 0);
199  CPPUNIT_ASSERT(found79 == 0);
200 }
static CCopasiDataModel * pCOPASIDATAMODEL
Definition: test000086.h:81
static const char * MODEL_STRING3
Definition: test000086.h:55
const size_t & getNumber() const
#define MCSBML
static size_t size()
static CCopasiMessage getLastMessage()
bool importSBMLFromString(const std::string &sbmlDocumentText, CProcessReport *pImportHandler=NULL, const bool &deleteOldData=true)
Definition: CModel.h:50
void test000086::test_import_compartment_units_4 ( )

Definition at line 202 of file test000086.cpp.

References CCopasiMessage::getLastMessage(), CCopasiDataModel::getModel(), CCopasiMessage::getNumber(), CCopasiDataModel::importSBMLFromString(), MCSBML, MODEL_STRING4, pCOPASIDATAMODEL, and CCopasiMessage::size().

203 {
204  CCopasiDataModel* pDataModel = pCOPASIDATAMODEL;
205  CPPUNIT_ASSERT(pDataModel->importSBMLFromString(MODEL_STRING4));
206  CModel* pModel = pDataModel->getModel();
207  CPPUNIT_ASSERT(pModel->getCompartments().size() == 1);
208  CPPUNIT_ASSERT(pModel != NULL);
209  // make sure there is no warning about inconsistent units
210  unsigned int i = 0, iMax = CCopasiMessage::size();
211  unsigned int found24 = 0;
212  unsigned int found55 = 0;
213  unsigned int found66 = 0;
214  unsigned int found79 = 0;
215 
216  while (i < iMax)
217  {
219 
220  // check for messages about inconsistent units
221  if (message.getNumber() == MCSBML + 24)
222  {
223  ++found24;
224  }
225 
226  // check for import errors
227  if (message.getNumber() == MCSBML + 55)
228  {
229  ++found55;
230  }
231 
232  // check for import errors
233  if (message.getNumber() == MCSBML + 66)
234  {
235  ++found66;
236  }
237 
238  // check for import errors
239  if (message.getNumber() == MCSBML + 79)
240  {
241  ++found79;
242  }
243 
244  ++i;
245  }
246 
247  CPPUNIT_ASSERT(found55 == 0);
248  CPPUNIT_ASSERT(found24 == 0);
249  CPPUNIT_ASSERT(found66 == 0);
250  CPPUNIT_ASSERT(found79 == 1);
251 }
static CCopasiDataModel * pCOPASIDATAMODEL
Definition: test000086.h:81
const size_t & getNumber() const
#define MCSBML
static const char * MODEL_STRING4
Definition: test000086.h:58
static size_t size()
static CCopasiMessage getLastMessage()
bool importSBMLFromString(const std::string &sbmlDocumentText, CProcessReport *pImportHandler=NULL, const bool &deleteOldData=true)
Definition: CModel.h:50
void test000086::test_import_compartment_units_5 ( )

Definition at line 253 of file test000086.cpp.

References CCopasiMessage::getLastMessage(), CCopasiDataModel::getModel(), CCopasiMessage::getNumber(), CCopasiDataModel::importSBMLFromString(), MCSBML, MODEL_STRING5, pCOPASIDATAMODEL, and CCopasiMessage::size().

254 {
255  CCopasiDataModel* pDataModel = pCOPASIDATAMODEL;
256  CPPUNIT_ASSERT(pDataModel->importSBMLFromString(MODEL_STRING5));
257  CModel* pModel = pDataModel->getModel();
258  CPPUNIT_ASSERT(pModel->getCompartments().size() == 1);
259  CPPUNIT_ASSERT(pModel != NULL);
260  // make sure there is no warning about inconsistent units
261  unsigned int i = 0, iMax = CCopasiMessage::size();
262  unsigned int found24 = 0;
263  unsigned int found55 = 0;
264  unsigned int found66 = 0;
265  unsigned int found79 = 0;
266 
267  while (i < iMax)
268  {
270 
271  // check for messages about inconsistent units
272  if (message.getNumber() == MCSBML + 24)
273  {
274  ++found24;
275  }
276 
277  // check for import errors
278  if (message.getNumber() == MCSBML + 55)
279  {
280  ++found55;
281  }
282 
283  // check for import errors
284  if (message.getNumber() == MCSBML + 66)
285  {
286  ++found66;
287  }
288 
289  // check for import errors
290  if (message.getNumber() == MCSBML + 79)
291  {
292  ++found79;
293  }
294 
295  ++i;
296  }
297 
298  CPPUNIT_ASSERT(found55 == 0);
299  CPPUNIT_ASSERT(found24 == 0);
300  CPPUNIT_ASSERT(found66 == 0);
301  CPPUNIT_ASSERT(found79 == 1);
302 }
static CCopasiDataModel * pCOPASIDATAMODEL
Definition: test000086.h:81
const size_t & getNumber() const
#define MCSBML
static size_t size()
static const char * MODEL_STRING5
Definition: test000086.h:61
static CCopasiMessage getLastMessage()
bool importSBMLFromString(const std::string &sbmlDocumentText, CProcessReport *pImportHandler=NULL, const bool &deleteOldData=true)
Definition: CModel.h:50
void test000086::test_import_compartment_units_6 ( )

Definition at line 304 of file test000086.cpp.

References CCopasiMessage::getLastMessage(), CCopasiDataModel::getModel(), CCopasiMessage::getNumber(), CCopasiDataModel::importSBMLFromString(), MCSBML, MODEL_STRING6, pCOPASIDATAMODEL, and CCopasiMessage::size().

305 {
306  CCopasiDataModel* pDataModel = pCOPASIDATAMODEL;
307  CPPUNIT_ASSERT(pDataModel->importSBMLFromString(MODEL_STRING6));
308  CModel* pModel = pDataModel->getModel();
309  CPPUNIT_ASSERT(pModel->getCompartments().size() == 1);
310  CPPUNIT_ASSERT(pModel != NULL);
311  // make sure there is no warning about inconsistent units
312  unsigned int i = 0, iMax = CCopasiMessage::size();
313 
314  while (i < iMax)
315  {
317  // make sure there is no message about units not being consistent
318  CPPUNIT_ASSERT(message.getNumber() != MCSBML + 24);
319  // make sure all units were imported
320  CPPUNIT_ASSERT(message.getNumber() != MCSBML + 55);
321  CPPUNIT_ASSERT(message.getNumber() != MCSBML + 66);
322  CPPUNIT_ASSERT(message.getNumber() != MCSBML + 79);
323  ++i;
324  }
325 }
static CCopasiDataModel * pCOPASIDATAMODEL
Definition: test000086.h:81
const size_t & getNumber() const
#define MCSBML
static size_t size()
static const char * MODEL_STRING6
Definition: test000086.h:64
static CCopasiMessage getLastMessage()
bool importSBMLFromString(const std::string &sbmlDocumentText, CProcessReport *pImportHandler=NULL, const bool &deleteOldData=true)
Definition: CModel.h:50
void test000086::test_import_compartment_units_7 ( )

Definition at line 327 of file test000086.cpp.

References CCopasiMessage::getLastMessage(), CCopasiDataModel::getModel(), CCopasiMessage::getNumber(), CCopasiDataModel::importSBMLFromString(), MCSBML, MODEL_STRING7, pCOPASIDATAMODEL, and CCopasiMessage::size().

328 {
329  CCopasiDataModel* pDataModel = pCOPASIDATAMODEL;
330  CPPUNIT_ASSERT(pDataModel->importSBMLFromString(MODEL_STRING7));
331  CModel* pModel = pDataModel->getModel();
332  CPPUNIT_ASSERT(pModel->getCompartments().size() == 1);
333  CPPUNIT_ASSERT(pModel != NULL);
334  // make sure there is no warning about inconsistent units
335  unsigned int i = 0, iMax = CCopasiMessage::size();
336  unsigned int found24 = 0;
337  unsigned int found55 = 0;
338  unsigned int found66 = 0;
339  unsigned int found79 = 0;
340 
341  while (i < iMax)
342  {
344 
345  // check for messages about inconsistent units
346  if (message.getNumber() == MCSBML + 24)
347  {
348  ++found24;
349  }
350 
351  // check for import errors
352  if (message.getNumber() == MCSBML + 55)
353  {
354  ++found55;
355  }
356 
357  // check for import errors
358  if (message.getNumber() == MCSBML + 66)
359  {
360  ++found66;
361  }
362 
363  // check for import errors
364  if (message.getNumber() == MCSBML + 79)
365  {
366  ++found79;
367  }
368 
369  ++i;
370  }
371 
372  CPPUNIT_ASSERT(found55 == 0);
373  CPPUNIT_ASSERT(found24 == 0);
374  CPPUNIT_ASSERT(found66 == 0);
375  CPPUNIT_ASSERT(found79 == 1);
376 }
static CCopasiDataModel * pCOPASIDATAMODEL
Definition: test000086.h:81
const size_t & getNumber() const
#define MCSBML
static size_t size()
static CCopasiMessage getLastMessage()
bool importSBMLFromString(const std::string &sbmlDocumentText, CProcessReport *pImportHandler=NULL, const bool &deleteOldData=true)
Definition: CModel.h:50
static const char * MODEL_STRING7
Definition: test000086.h:67
void test000086::test_import_compartment_units_8 ( )

Definition at line 378 of file test000086.cpp.

References CCopasiMessage::getLastMessage(), CCopasiDataModel::getModel(), CCopasiMessage::getNumber(), CCopasiDataModel::importSBMLFromString(), MCSBML, MODEL_STRING8, pCOPASIDATAMODEL, and CCopasiMessage::size().

379 {
380  CCopasiDataModel* pDataModel = pCOPASIDATAMODEL;
381  CPPUNIT_ASSERT(pDataModel->importSBMLFromString(MODEL_STRING8));
382  CModel* pModel = pDataModel->getModel();
383  CPPUNIT_ASSERT(pModel->getCompartments().size() == 1);
384  CPPUNIT_ASSERT(pModel != NULL);
385  // make sure there is no warning about inconsistent units
386  unsigned int i = 0, iMax = CCopasiMessage::size();
387  unsigned int found24 = 0;
388  unsigned int found55 = 0;
389  unsigned int found66 = 0;
390  unsigned int found79 = 0;
391 
392  while (i < iMax)
393  {
395 
396  // check for messages about inconsistent units
397  if (message.getNumber() == MCSBML + 24)
398  {
399  ++found24;
400  }
401 
402  // check for import errors
403  if (message.getNumber() == MCSBML + 55)
404  {
405  ++found55;
406  }
407 
408  // check for import errors
409  if (message.getNumber() == MCSBML + 66)
410  {
411  ++found66;
412  }
413 
414  // check for import errors
415  if (message.getNumber() == MCSBML + 79)
416  {
417  ++found79;
418  }
419 
420  ++i;
421  }
422 
423  CPPUNIT_ASSERT(found55 == 0);
424  CPPUNIT_ASSERT(found24 == 0);
425  CPPUNIT_ASSERT(found66 == 0);
426  CPPUNIT_ASSERT(found79 == 0);
427 }
static CCopasiDataModel * pCOPASIDATAMODEL
Definition: test000086.h:81
const size_t & getNumber() const
static const char * MODEL_STRING8
Definition: test000086.h:70
#define MCSBML
static size_t size()
static CCopasiMessage getLastMessage()
bool importSBMLFromString(const std::string &sbmlDocumentText, CProcessReport *pImportHandler=NULL, const bool &deleteOldData=true)
Definition: CModel.h:50
void test000086::test_import_compartment_units_9 ( )

Definition at line 429 of file test000086.cpp.

References CCopasiMessage::getLastMessage(), CCopasiDataModel::getModel(), CCopasiMessage::getNumber(), CCopasiDataModel::importSBMLFromString(), MCSBML, MODEL_STRING9, pCOPASIDATAMODEL, and CCopasiMessage::size().

430 {
431  CCopasiDataModel* pDataModel = pCOPASIDATAMODEL;
432  CPPUNIT_ASSERT(pDataModel->importSBMLFromString(MODEL_STRING9));
433  CModel* pModel = pDataModel->getModel();
434  CPPUNIT_ASSERT(pModel->getCompartments().size() == 1);
435  CPPUNIT_ASSERT(pModel != NULL);
436  // make sure there is no warning about inconsistent units
437  unsigned int i = 0, iMax = CCopasiMessage::size();
438  unsigned int found24 = 0;
439  unsigned int found55 = 0;
440  unsigned int found66 = 0;
441  unsigned int found79 = 0;
442 
443  while (i < iMax)
444  {
446 
447  // check for messages about inconsistent units
448  if (message.getNumber() == MCSBML + 24)
449  {
450  ++found24;
451  }
452 
453  // check for import errors
454  if (message.getNumber() == MCSBML + 55)
455  {
456  ++found55;
457  }
458 
459  // check for import errors
460  if (message.getNumber() == MCSBML + 66)
461  {
462  ++found66;
463  }
464 
465  // check for import errors
466  if (message.getNumber() == MCSBML + 79)
467  {
468  ++found79;
469  }
470 
471  ++i;
472  }
473 
474  CPPUNIT_ASSERT(found55 == 0);
475  CPPUNIT_ASSERT(found24 == 0);
476  CPPUNIT_ASSERT(found66 == 0);
477  CPPUNIT_ASSERT(found79 == 1);
478 }
static CCopasiDataModel * pCOPASIDATAMODEL
Definition: test000086.h:81
const size_t & getNumber() const
static const char * MODEL_STRING9
Definition: test000086.h:73
#define MCSBML
static size_t size()
static CCopasiMessage getLastMessage()
bool importSBMLFromString(const std::string &sbmlDocumentText, CProcessReport *pImportHandler=NULL, const bool &deleteOldData=true)
Definition: CModel.h:50

Member Data Documentation

const char * test000086::MODEL_STRING1
staticprotected
Initial value:
=
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
"<sbml xmlns=\"http://www.sbml.org/sbml/level2\" level=\"2\" version=\"1\">"
" <model id=\"Model_1\" name=\"New Model\">"
" <notes>"
" <body xmlns=\"http://www.w3.org/1999/xhtml\">"
" <p>L2V1 model with a compartment with length units.</p>"
" </body>"
" </notes>"
" <listOfCompartments>"
" <compartment id=\"compartment_1\" name=\"compartment\" size=\"1\" spatialDimensions=\"0\" units=\"length\"/>"
" </listOfCompartments>"
" </model>"
"</sbml>"

Definition at line 49 of file test000086.h.

Referenced by test_import_compartment_units_1().

const char * test000086::MODEL_STRING10
staticprotected
Initial value:
=
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
"<sbml xmlns=\"http://www.sbml.org/sbml/level2\" level=\"2\" version=\"1\">"
" <model id=\"Model_1\" name=\"New Model\">"
" <notes>"
" <body xmlns=\"http://www.w3.org/1999/xhtml\">"
" <p>L2V1 model with a 0D compartment with substance units.</p>"
" </body>"
" </notes>"
" <listOfCompartments>"
" <compartment id=\"compartment_1\" name=\"compartment\" size=\"1\" spatialDimensions=\"0\" units=\"substance\"/>"
" </listOfCompartments>"
" </model>"
"</sbml>"

Definition at line 76 of file test000086.h.

Referenced by test_import_compartment_units_10().

const char * test000086::MODEL_STRING11
staticprotected
Initial value:
=
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
"<sbml xmlns=\"http://www.sbml.org/sbml/level2\" level=\"2\" version=\"1\">"
" <model id=\"Model_1\" name=\"New Model\">"
" <notes>"
" <body xmlns=\"http://www.w3.org/1999/xhtml\">"
" <p>L2V1 model with two compartments. One has no unit, the other uses dimensionless as the unit.</p>"
" </body>"
" </notes>"
" <listOfCompartments>"
" <compartment id=\"compartment_1\" name=\"compartment\" size=\"1\" spatialDimensions=\"0\" />"
" <compartment id=\"compartment_2\" name=\"compartment_2\" size=\"1\" spatialDimensions=\"0\" units=\"dimensionless\"/>"
" </listOfCompartments>"
" </model>"
"</sbml>"

Definition at line 79 of file test000086.h.

Referenced by test_import_compartment_units_11().

const char * test000086::MODEL_STRING2
staticprotected
Initial value:
=
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
"<sbml xmlns=\"http://www.sbml.org/sbml/level2\" level=\"2\" version=\"1\">"
" <model id=\"Model_1\" name=\"New Model\">"
" <notes>"
" <body xmlns=\"http://www.w3.org/1999/xhtml\">"
" <p>L2V1 model with a compartment with metre units.</p>"
" </body>"
" </notes>"
" <listOfCompartments>"
" <compartment id=\"compartment_1\" name=\"compartment\" size=\"1\" spatialDimensions=\"0\" units=\"metre\"/>"
" </listOfCompartments>"
" </model>"
"</sbml>"

Definition at line 52 of file test000086.h.

Referenced by test_import_compartment_units_2().

const char * test000086::MODEL_STRING3
staticprotected
Initial value:
=
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
"<sbml xmlns=\"http://www.sbml.org/sbml/level2\" level=\"2\" version=\"1\">"
" <model id=\"Model_1\" name=\"New Model\">"
" <notes>"
" <body xmlns=\"http://www.w3.org/1999/xhtml\">"
" <p>L2V1 model with a compartment with no units.</p>"
" </body>"
" </notes>"
" <listOfCompartments>"
" <compartment id=\"compartment_1\" name=\"compartment\" size=\"1\" spatialDimensions=\"0\" />"
" </listOfCompartments>"
" </model>"
"</sbml>"

Definition at line 55 of file test000086.h.

Referenced by test_import_compartment_units_3().

const char * test000086::MODEL_STRING4
staticprotected
Initial value:
=
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
"<sbml xmlns=\"http://www.sbml.org/sbml/level2\" level=\"2\" version=\"1\">"
" <model id=\"Model_1\" name=\"New Model\">"
" <notes>"
" <body xmlns=\"http://www.w3.org/1999/xhtml\">"
" <p>L2V1 model with a 0D compartment with volume units.</p>"
" </body>"
" </notes>"
" <listOfCompartments>"
" <compartment id=\"compartment_1\" name=\"compartment\" size=\"1\" spatialDimensions=\"0\" units=\"volume\"/>"
" </listOfCompartments>"
" </model>"
"</sbml>"

Definition at line 58 of file test000086.h.

Referenced by test_import_compartment_units_4().

const char * test000086::MODEL_STRING5
staticprotected
Initial value:
=
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
"<sbml xmlns=\"http://www.sbml.org/sbml/level2\" level=\"2\" version=\"1\">"
" <model id=\"Model_1\" name=\"New Model\">"
" <notes>"
" <body xmlns=\"http://www.w3.org/1999/xhtml\">"
" <p>L2V1 model with a 0D compartment with area units.</p>"
" </body>"
" </notes>"
" <listOfCompartments>"
" <compartment id=\"compartment_1\" name=\"compartment\" size=\"1\" spatialDimensions=\"0\" units=\"area\"/>"
" </listOfCompartments>"
" </model>"
"</sbml>"

Definition at line 61 of file test000086.h.

Referenced by test_import_compartment_units_5().

const char * test000086::MODEL_STRING6
staticprotected
Initial value:
=
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
"<sbml xmlns=\"http://www.sbml.org/sbml/level2\" level=\"2\" version=\"1\">"
" <model id=\"Model_1\" name=\"New Model\">"
" <notes>"
" <body xmlns=\"http://www.w3.org/1999/xhtml\">"
" <p>L2V1 model with a 0D compartment with dimensionless units.</p>"
" </body>"
" </notes>"
" <listOfCompartments>"
" <compartment id=\"compartment_1\" name=\"compartment\" size=\"1\" spatialDimensions=\"0\" units=\"dimensionless\"/>"
" </listOfCompartments>"
" </model>"
"</sbml>"

Definition at line 64 of file test000086.h.

Referenced by test_import_compartment_units_6().

const char * test000086::MODEL_STRING7
staticprotected
Initial value:
=
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
"<sbml xmlns=\"http://www.sbml.org/sbml/level2\" level=\"2\" version=\"1\">"
" <model id=\"Model_1\" name=\"New Model\">"
" <notes>"
" <body xmlns=\"http://www.w3.org/1999/xhtml\">"
" <p>L2V1 model with a 0D compartment with m^2 units.</p>"
" </body>"
" </notes>"
" <listOfUnitDefinitions>"
" <unitDefinition id=\"my_dimensionless\">"
" <listOfUnits>"
" <unit kind=\"metre\" scale=\"0\" exponent=\"2\" />"
" </listOfUnits>"
" </unitDefinition>"
" </listOfUnitDefinitions>"
" <listOfCompartments>"
" <compartment id=\"compartment_1\" name=\"compartment\" size=\"1\" spatialDimensions=\"0\" units=\"my_dimensionless\"/>"
" </listOfCompartments>"
" </model>"
"</sbml>"

Definition at line 67 of file test000086.h.

Referenced by test_import_compartment_units_7().

const char * test000086::MODEL_STRING8
staticprotected
Initial value:
=
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
"<sbml xmlns=\"http://www.sbml.org/sbml/level2\" level=\"2\" version=\"1\">"
" <model id=\"Model_1\" name=\"New Model\">"
" <notes>"
" <body xmlns=\"http://www.w3.org/1999/xhtml\">"
" <p>L2V1 model with a 0D compartment with dimensionless units.</p>"
" </body>"
" </notes>"
" <listOfUnitDefinitions>"
" <unitDefinition id=\"my_dimensionless\">"
" <listOfUnits>"
" <unit kind=\"dimensionless\" scale=\"0\" />"
" </listOfUnits>"
" </unitDefinition>"
" </listOfUnitDefinitions>"
" <listOfCompartments>"
" <compartment id=\"compartment_1\" name=\"compartment\" size=\"1\" spatialDimensions=\"0\" units=\"my_dimensionless\"/>"
" </listOfCompartments>"
" </model>"
"</sbml>"

Definition at line 70 of file test000086.h.

Referenced by test_import_compartment_units_8().

const char * test000086::MODEL_STRING9
staticprotected
Initial value:
=
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
"<sbml xmlns=\"http://www.sbml.org/sbml/level2\" level=\"2\" version=\"1\">"
" <model id=\"Model_1\" name=\"New Model\">"
" <notes>"
" <body xmlns=\"http://www.w3.org/1999/xhtml\">"
" <p>L2V1 model with a 0D compartment with mole units.</p>"
" </body>"
" </notes>"
" <listOfUnitDefinitions>"
" <unitDefinition id=\"my_dimensionless\">"
" <listOfUnits>"
" <unit kind=\"mole\" scale=\"0\" />"
" </listOfUnits>"
" </unitDefinition>"
" </listOfUnitDefinitions>"
" <listOfCompartments>"
" <compartment id=\"compartment_1\" name=\"compartment\" size=\"1\" spatialDimensions=\"0\" units=\"my_dimensionless\"/>"
" </listOfCompartments>"
" </model>"
"</sbml>"

Definition at line 73 of file test000086.h.

Referenced by test_import_compartment_units_9().

CCopasiDataModel * test000086::pCOPASIDATAMODEL = NULL
staticprotected

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