COPASI API  4.16.103
test000084.cpp
Go to the documentation of this file.
1 // Begin CVS Header
2 // $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/sbml/unittests/test000084.cpp,v $
3 // $Revision: 1.3 $
4 // $Name: $
5 // $Author: gauges $
6 // $Date: 2010/03/11 11:55:16 $
7 // End CVS Header
8 
9 // Copyright (C) 2010 by Pedro Mendes, Virginia Tech Intellectual
10 // Properties, Inc., University of Heidelberg, and The University
11 // of Manchester.
12 // All rights reserved.
13 
14 // Copyright (C) 2008 by Pedro Mendes, Virginia Tech Intellectual
15 // Properties, Inc., EML Research, gGmbH, University of Heidelberg,
16 // and The University of Manchester.
17 // All rights reserved.
18 
19 #include "test000084.h"
20 
21 #include <sstream>
22 #include "utilities.hpp"
25 #include "copasi/model/CModel.h"
26 
27 #include "sbml/SBMLDocument.h"
28 #include "sbml/Model.h"
29 #include "sbml/Compartment.h"
30 #include "sbml/UnitDefinition.h"
31 #include "sbml/Unit.h"
32 #include "sbml/UnitKind.h"
33 
34 CCopasiDataModel* test000084::pCOPASIDATAMODEL = NULL;
35 
37 {
38  // Create the root container.
39  CCopasiRootContainer::init(0, NULL, false);
40  // Create the global data model.
42 }
43 
45 {
47 }
48 
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  CPPUNIT_ASSERT(pModel->getAreaUnitEnum() == CModel::nm2);
57  // make sure there is no warning about inconsistent units
58  unsigned int i = 0, iMax = CCopasiMessage::size();
59 
60  while (i < iMax)
61  {
63  // make sure there is no message about units not being consistent
64  CPPUNIT_ASSERT(message.getNumber() != MCSBML + 24);
65  // make sure all units were imported
66  CPPUNIT_ASSERT(message.getNumber() != MCSBML + 55);
67  CPPUNIT_ASSERT(message.getNumber() != MCSBML + 66);
68  CPPUNIT_ASSERT(message.getNumber() != MCSBML + 79);
69  ++i;
70  }
71 }
72 
74 {
75  CCopasiDataModel* pDataModel = pCOPASIDATAMODEL;
76  CPPUNIT_ASSERT(pDataModel->importSBMLFromString(MODEL_STRING2));
77  CModel* pModel = pDataModel->getModel();
78  CPPUNIT_ASSERT(pModel->getCompartments().size() == 1);
79  CPPUNIT_ASSERT(pModel != NULL);
80  CPPUNIT_ASSERT(pModel->getAreaUnitEnum() == CModel::m2);
81  unsigned int i = 0, iMax = CCopasiMessage::size();
82 
83  while (i < iMax)
84  {
86 
87  // make sure there is a message about the unit not being recognized by
88  // COPASI since the scale is off
89  if (message.getNumber() == MCSBML + 66)
90  {
91  break;
92  }
93 
94  ++i;
95  }
96 
97  CPPUNIT_ASSERT(i != iMax);
98 }
99 
101 {
102  CCopasiDataModel* pDataModel = pCOPASIDATAMODEL;
103  CPPUNIT_ASSERT(pDataModel->importSBMLFromString(MODEL_STRING3));
104  CModel* pModel = pDataModel->getModel();
105  CPPUNIT_ASSERT(pModel->getCompartments().size() == 1);
106  CPPUNIT_ASSERT(pModel != NULL);
107  CPPUNIT_ASSERT(pModel->getAreaUnitEnum() == CModel::m2);
108  // make sure there is no warning about inconsistent units
109  unsigned int i = 0, iMax = CCopasiMessage::size();
110  unsigned int found24 = 0;
111  unsigned int found55 = 0;
112  unsigned int found79 = 0;
113  unsigned int found66 = 0;
114 
115  while (i < iMax)
116  {
118 
119  // check for messages about inconsistent units
120  if (message.getNumber() == MCSBML + 24)
121  {
122  ++found24;
123  }
124 
125  // check for import errors
126  if (message.getNumber() == MCSBML + 55)
127  {
128  ++found55;
129  }
130 
131  // check for import errors
132  if (message.getNumber() == MCSBML + 79)
133  {
134  ++found79;
135  }
136 
137  // check for import errors
138  if (message.getNumber() == MCSBML + 66)
139  {
140  ++found66;
141  }
142 
143  ++i;
144  }
145 
146  CPPUNIT_ASSERT(found55 == 0);
147  CPPUNIT_ASSERT(found24 == 0);
148  CPPUNIT_ASSERT(found79 == 0);
149  CPPUNIT_ASSERT(found66 == 1);
150 }
151 
153 {
154  CCopasiDataModel* pDataModel = pCOPASIDATAMODEL;
155  CPPUNIT_ASSERT(pDataModel->importSBMLFromString(MODEL_STRING4));
156  CModel* pModel = pDataModel->getModel();
157  CPPUNIT_ASSERT(pModel->getCompartments().size() == 1);
158  CPPUNIT_ASSERT(pModel != NULL);
159  CPPUNIT_ASSERT(pModel->getAreaUnitEnum() == CModel::mm2);
160  // make sure there is no warning about inconsistent units
161  unsigned int i = 0, iMax = CCopasiMessage::size();
162  unsigned int found24 = 0;
163  unsigned int found55 = 0;
164  unsigned int found79 = 0;
165  unsigned int found66 = 0;
166 
167  while (i < iMax)
168  {
170 
171  // check for messages about inconsistent units
172  if (message.getNumber() == MCSBML + 24)
173  {
174  ++found24;
175  }
176 
177  // check for import errors
178  if (message.getNumber() == MCSBML + 55)
179  {
180  ++found55;
181  }
182 
183  // check for import errors
184  if (message.getNumber() == MCSBML + 79)
185  {
186  ++found79;
187  }
188 
189  // check for import errors
190  if (message.getNumber() == MCSBML + 66)
191  {
192  ++found66;
193  }
194 
195  ++i;
196  }
197 
198  CPPUNIT_ASSERT(found55 == 0);
199  CPPUNIT_ASSERT(found24 == 0);
200  CPPUNIT_ASSERT(found79 == 0);
201  CPPUNIT_ASSERT(found66 == 0);
202 }
203 
205 {
206  CCopasiDataModel* pDataModel = pCOPASIDATAMODEL;
207  CPPUNIT_ASSERT(pDataModel->importSBMLFromString(MODEL_STRING5));
208  CModel* pModel = pDataModel->getModel();
209  CPPUNIT_ASSERT(pModel->getCompartments().size() == 1);
210  CPPUNIT_ASSERT(pModel != NULL);
211  CPPUNIT_ASSERT(pModel->getAreaUnitEnum() == CModel::nm2);
212  // make sure there is no warning about inconsistent units
213  unsigned int i = 0, iMax = CCopasiMessage::size();
214  unsigned int found24 = 0;
215  unsigned int found55 = 0;
216  unsigned int found79 = 0;
217  unsigned int found66 = 0;
218 
219  while (i < iMax)
220  {
222 
223  // check for messages about inconsistent units
224  if (message.getNumber() == MCSBML + 24)
225  {
226  ++found24;
227  }
228 
229  // check for import errors
230  if (message.getNumber() == MCSBML + 55)
231  {
232  ++found55;
233  }
234 
235  // check for import errors
236  if (message.getNumber() == MCSBML + 79)
237  {
238  ++found79;
239  }
240 
241  // check for import errors
242  if (message.getNumber() == MCSBML + 66)
243  {
244  ++found66;
245  }
246 
247  ++i;
248  }
249 
250  CPPUNIT_ASSERT(found55 == 0);
251  CPPUNIT_ASSERT(found24 == 0);
252  CPPUNIT_ASSERT(found79 == 1);
253  CPPUNIT_ASSERT(found66 == 0);
254 }
255 
257 {
258  CCopasiDataModel* pDataModel = pCOPASIDATAMODEL;
259  CPPUNIT_ASSERT(pDataModel->importSBMLFromString(MODEL_STRING6));
260  CModel* pModel = pDataModel->getModel();
261  CPPUNIT_ASSERT(pModel->getCompartments().size() == 1);
262  CPPUNIT_ASSERT(pModel != NULL);
263  CPPUNIT_ASSERT(pModel->getAreaUnitEnum() == CModel::nm2);
264  // make sure there is no warning about inconsistent units
265  unsigned int i = 0, iMax = CCopasiMessage::size();
266  unsigned int found24 = 0;
267  unsigned int found55 = 0;
268  unsigned int found79 = 0;
269  unsigned int found66 = 0;
270 
271  while (i < iMax)
272  {
274 
275  // check for messages about inconsistent units
276  if (message.getNumber() == MCSBML + 24)
277  {
278  ++found24;
279  }
280 
281  // check for import errors
282  if (message.getNumber() == MCSBML + 55)
283  {
284  ++found55;
285  }
286 
287  // check for import errors
288  if (message.getNumber() == MCSBML + 79)
289  {
290  ++found79;
291  }
292 
293  // check for import errors
294  if (message.getNumber() == MCSBML + 66)
295  {
296  ++found66;
297  }
298 
299  ++i;
300  }
301 
302  CPPUNIT_ASSERT(found55 == 0);
303  CPPUNIT_ASSERT(found24 == 0);
304  CPPUNIT_ASSERT(found79 == 0);
305  CPPUNIT_ASSERT(found66 == 1);
306 }
307 
309 {
310  CCopasiDataModel* pDataModel = pCOPASIDATAMODEL;
311  CPPUNIT_ASSERT(pDataModel->importSBMLFromString(MODEL_STRING7));
312  CModel* pModel = pDataModel->getModel();
313  CPPUNIT_ASSERT(pModel->getCompartments().size() == 1);
314  CPPUNIT_ASSERT(pModel != NULL);
315  CPPUNIT_ASSERT(pModel->getAreaUnitEnum() == CModel::nm2);
316  // make sure there is no warning about inconsistent units
317  unsigned int i = 0, iMax = CCopasiMessage::size();
318  unsigned int found24 = 0;
319  unsigned int found55 = 0;
320  unsigned int found66 = 0;
321  unsigned int found79 = 0;
322 
323  while (i < iMax)
324  {
326 
327  // check for messages about inconsistent units
328  if (message.getNumber() == MCSBML + 24)
329  {
330  ++found24;
331  }
332 
333  // check for import errors
334  if (message.getNumber() == MCSBML + 55)
335  {
336  ++found55;
337  }
338 
339  // check for import errors
340  if (message.getNumber() == MCSBML + 66)
341  {
342  ++found66;
343  }
344 
345  // check for import errors
346  if (message.getNumber() == MCSBML + 79)
347  {
348  ++found79;
349  }
350 
351  ++i;
352  }
353 
354  CPPUNIT_ASSERT(found55 == 0);
355  CPPUNIT_ASSERT(found24 == 0);
356  CPPUNIT_ASSERT(found79 == 0);
357  CPPUNIT_ASSERT(found66 == 0);
358 }
359 
361 {
362  CCopasiDataModel* pDataModel = pCOPASIDATAMODEL;
363  CPPUNIT_ASSERT(pDataModel->importSBMLFromString(MODEL_STRING8));
364  CModel* pModel = pDataModel->getModel();
365  CPPUNIT_ASSERT(pModel->getCompartments().size() == 1);
366  CPPUNIT_ASSERT(pModel != NULL);
367  CPPUNIT_ASSERT(pModel->getAreaUnitEnum() == CModel::m2);
368  // make sure there is no warning about inconsistent units
369  unsigned int i = 0, iMax = CCopasiMessage::size();
370  unsigned int found24 = 0;
371  unsigned int found55 = 0;
372  unsigned int found66 = 0;
373  unsigned int found79 = 0;
374 
375  while (i < iMax)
376  {
378 
379  // check for messages about inconsistent units
380  if (message.getNumber() == MCSBML + 24)
381  {
382  ++found24;
383  }
384 
385  // check for import errors
386  if (message.getNumber() == MCSBML + 55)
387  {
388  ++found55;
389  }
390 
391  // check for import errors
392  if (message.getNumber() == MCSBML + 66)
393  {
394  ++found66;
395  }
396 
397  // check for import errors
398  if (message.getNumber() == MCSBML + 79)
399  {
400  ++found79;
401  }
402 
403  ++i;
404  }
405 
406  CPPUNIT_ASSERT(found55 == 0);
407  CPPUNIT_ASSERT(found24 == 0);
408  CPPUNIT_ASSERT(found79 == 0);
409  CPPUNIT_ASSERT(found66 == 0);
410 }
411 
413 {
414  CCopasiDataModel* pDataModel = pCOPASIDATAMODEL;
415  CPPUNIT_ASSERT(pDataModel->importSBMLFromString(MODEL_STRING9));
416  CModel* pModel = pDataModel->getModel();
417  CPPUNIT_ASSERT(pModel->getCompartments().size() == 1);
418  CPPUNIT_ASSERT(pModel != NULL);
419  CPPUNIT_ASSERT(pModel->getAreaUnitEnum() == CModel::m2);
420  // make sure there is no warning about inconsistent units
421  unsigned int i = 0, iMax = CCopasiMessage::size();
422  unsigned int found24 = 0;
423  unsigned int found55 = 0;
424  unsigned int found79 = 0;
425  unsigned int found66 = 0;
426 
427  while (i < iMax)
428  {
430 
431  // check for messages about inconsistent units
432  if (message.getNumber() == MCSBML + 24)
433  {
434  ++found24;
435  }
436 
437  // check for import errors
438  if (message.getNumber() == MCSBML + 55)
439  {
440  ++found55;
441  }
442 
443  // check for import errors
444  if (message.getNumber() == MCSBML + 79)
445  {
446  ++found79;
447  }
448 
449  // check for import errors
450  if (message.getNumber() == MCSBML + 66)
451  {
452  ++found66;
453  }
454 
455  ++i;
456  }
457 
458  CPPUNIT_ASSERT(found55 == 0);
459  CPPUNIT_ASSERT(found24 == 0);
460  CPPUNIT_ASSERT(found79 == 1);
461  CPPUNIT_ASSERT(found66 == 0);
462 }
463 
465 {
466  CCopasiDataModel* pDataModel = pCOPASIDATAMODEL;
467  CPPUNIT_ASSERT(pDataModel->importSBMLFromString(MODEL_STRING10));
468  CModel* pModel = pDataModel->getModel();
469  CPPUNIT_ASSERT(pModel->getCompartments().size() == 1);
470  CPPUNIT_ASSERT(pModel != NULL);
471  CPPUNIT_ASSERT(pModel->getAreaUnitEnum() == CModel::m2);
472  // make sure there is no warning about inconsistent units
473  unsigned int i = 0, iMax = CCopasiMessage::size();
474  unsigned int found24 = 0;
475  unsigned int found55 = 0;
476  unsigned int found66 = 0;
477  unsigned int found79 = 0;
478 
479  while (i < iMax)
480  {
482 
483  // check for messages about inconsistent units
484  if (message.getNumber() == MCSBML + 24)
485  {
486  ++found24;
487  }
488 
489  // check for import errors
490  if (message.getNumber() == MCSBML + 55)
491  {
492  ++found55;
493  }
494 
495  // check for import errors
496  if (message.getNumber() == MCSBML + 66)
497  {
498  ++found66;
499  }
500 
501  // check for import errors
502  if (message.getNumber() == MCSBML + 79)
503  {
504  ++found79;
505  }
506 
507  ++i;
508  }
509 
510  CPPUNIT_ASSERT(found55 == 0);
511  CPPUNIT_ASSERT(found24 == 0);
512  CPPUNIT_ASSERT(found79 == 0);
513  CPPUNIT_ASSERT(found66 == 0);
514 }
515 
517 {
518  CCopasiDataModel* pDataModel = pCOPASIDATAMODEL;
519  CPPUNIT_ASSERT(pDataModel->importSBMLFromString(MODEL_STRING11));
520  CModel* pModel = pDataModel->getModel();
521  CPPUNIT_ASSERT(pModel->getCompartments().size() == 1);
522  CPPUNIT_ASSERT(pModel != NULL);
523  CPPUNIT_ASSERT(pModel->getAreaUnitEnum() == CModel::m2);
524  // make sure there is no warning about inconsistent units
525  unsigned int i = 0, iMax = CCopasiMessage::size();
526  unsigned int found24 = 0;
527  unsigned int found55 = 0;
528  unsigned int found79 = 0;
529  unsigned int found66 = 0;
530 
531  while (i < iMax)
532  {
534 
535  // check for messages about inconsistent units
536  if (message.getNumber() == MCSBML + 24)
537  {
538  ++found24;
539  }
540 
541  // check for import errors
542  if (message.getNumber() == MCSBML + 55)
543  {
544  ++found55;
545  }
546 
547  // check for import errors
548  if (message.getNumber() == MCSBML + 79)
549  {
550  ++found79;
551  }
552 
553  // check for import errors
554  if (message.getNumber() == MCSBML + 66)
555  {
556  ++found66;
557  }
558 
559  ++i;
560  }
561 
562  CPPUNIT_ASSERT(found55 == 0);
563  CPPUNIT_ASSERT(found24 == 0);
564  CPPUNIT_ASSERT(found79 == 1);
565  CPPUNIT_ASSERT(found66 == 0);
566 }
567 
569 {
570  CCopasiDataModel* pDataModel = pCOPASIDATAMODEL;
571  CPPUNIT_ASSERT(pDataModel->importSBMLFromString(MODEL_STRING12));
572  CModel* pModel = pDataModel->getModel();
573  CPPUNIT_ASSERT(pModel->getCompartments().size() == 1);
574  CPPUNIT_ASSERT(pModel != NULL);
575  CPPUNIT_ASSERT(pModel->getAreaUnitEnum() == CModel::m2);
576  // make sure there is no warning about inconsistent units
577  unsigned int i = 0, iMax = CCopasiMessage::size();
578  unsigned int found24 = 0;
579  unsigned int found55 = 0;
580  unsigned int found79 = 0;
581  unsigned int found66 = 0;
582 
583  while (i < iMax)
584  {
586 
587  // check for messages about inconsistent units
588  if (message.getNumber() == MCSBML + 24)
589  {
590  ++found24;
591  }
592 
593  // check for import errors
594  if (message.getNumber() == MCSBML + 55)
595  {
596  ++found55;
597  }
598 
599  // check for import errors
600  if (message.getNumber() == MCSBML + 79)
601  {
602  ++found79;
603  }
604 
605  // check for import errors
606  if (message.getNumber() == MCSBML + 66)
607  {
608  ++found66;
609  }
610 
611  ++i;
612  }
613 
614  CPPUNIT_ASSERT(found55 == 0);
615  CPPUNIT_ASSERT(found24 == 0);
616  CPPUNIT_ASSERT(found79 == 1);
617  CPPUNIT_ASSERT(found66 == 0);
618 }
619 
621 {
622  CCopasiDataModel* pDataModel = pCOPASIDATAMODEL;
623  CPPUNIT_ASSERT(pDataModel->importSBMLFromString(MODEL_STRING13));
624  CModel* pModel = pDataModel->getModel();
625  CPPUNIT_ASSERT(pModel->getCompartments().size() == 1);
626  CPPUNIT_ASSERT(pModel != NULL);
627  CPPUNIT_ASSERT(pModel->getAreaUnitEnum() == CModel::dimensionlessArea);
628  // make sure there is no warning about inconsistent units
629  unsigned int i = 0, iMax = CCopasiMessage::size();
630 
631  while (i < iMax)
632  {
634  // make sure there is no message about units not being consistent
635  CPPUNIT_ASSERT(message.getNumber() != MCSBML + 24);
636  // make sure all units were imported
637  CPPUNIT_ASSERT(message.getNumber() != MCSBML + 55);
638  CPPUNIT_ASSERT(message.getNumber() != MCSBML + 66);
639  CPPUNIT_ASSERT(message.getNumber() != MCSBML + 79);
640  ++i;
641  }
642 }
643 
645 {
646  CCopasiDataModel* pDataModel = pCOPASIDATAMODEL;
647  CPPUNIT_ASSERT(pDataModel->importSBMLFromString(MODEL_STRING14));
648  CModel* pModel = pDataModel->getModel();
649  CPPUNIT_ASSERT(pModel->getCompartments().size() == 1);
650  CPPUNIT_ASSERT(pModel != NULL);
651  CPPUNIT_ASSERT(pModel->getAreaUnitEnum() == CModel::m2);
652  // make sure there is no warning about inconsistent units
653  unsigned int i = 0, iMax = CCopasiMessage::size();
654  unsigned int found24 = 0;
655  unsigned int found55 = 0;
656  unsigned int found79 = 0;
657  unsigned int found66 = 0;
658 
659  while (i < iMax)
660  {
662 
663  // check for messages about inconsistent units
664  if (message.getNumber() == MCSBML + 24)
665  {
666  ++found24;
667  }
668 
669  // check for import errors
670  if (message.getNumber() == MCSBML + 55)
671  {
672  ++found55;
673  }
674 
675  // check for import errors
676  if (message.getNumber() == MCSBML + 79)
677  {
678  ++found79;
679  }
680 
681  // check for import errors
682  if (message.getNumber() == MCSBML + 66)
683  {
684  ++found66;
685  }
686 
687  ++i;
688  }
689 
690  CPPUNIT_ASSERT(found55 == 0);
691  CPPUNIT_ASSERT(found24 == 0);
692  CPPUNIT_ASSERT(found79 == 1);
693  CPPUNIT_ASSERT(found66 == 0);
694 }
695 
697 {
698  CCopasiDataModel* pDataModel = pCOPASIDATAMODEL;
699  CPPUNIT_ASSERT(pDataModel->importSBMLFromString(MODEL_STRING15));
700  CModel* pModel = pDataModel->getModel();
701  CPPUNIT_ASSERT(pModel->getCompartments().size() == 1);
702  CPPUNIT_ASSERT(pModel != NULL);
703  CPPUNIT_ASSERT(pModel->getAreaUnitEnum() == CModel::m2);
704  // make sure there is no warning about inconsistent units
705  unsigned int i = 0, iMax = CCopasiMessage::size();
706  unsigned int found24 = 0;
707  unsigned int found55 = 0;
708  unsigned int found79 = 0;
709  unsigned int found66 = 0;
710 
711  while (i < iMax)
712  {
714 
715  // check for messages about inconsistent units
716  if (message.getNumber() == MCSBML + 24)
717  {
718  ++found24;
719  }
720 
721  // check for import errors
722  if (message.getNumber() == MCSBML + 55)
723  {
724  ++found55;
725  }
726 
727  // check for import errors
728  if (message.getNumber() == MCSBML + 79)
729  {
730  ++found79;
731  }
732 
733  // check for import errors
734  if (message.getNumber() == MCSBML + 66)
735  {
736  ++found66;
737  }
738 
739  ++i;
740  }
741 
742  CPPUNIT_ASSERT(found55 == 0);
743  CPPUNIT_ASSERT(found24 == 0);
744  CPPUNIT_ASSERT(found79 == 1);
745  CPPUNIT_ASSERT(found66 == 0);
746 }
747 
749 {
750  CCopasiDataModel* pDataModel = pCOPASIDATAMODEL;
751  CPPUNIT_ASSERT(pDataModel->importSBMLFromString(MODEL_STRING16));
752  CModel* pModel = pDataModel->getModel();
753  CPPUNIT_ASSERT(pModel->getCompartments().size() == 1);
754  CPPUNIT_ASSERT(pModel != NULL);
755  CPPUNIT_ASSERT(pModel->getAreaUnitEnum() == CModel::m2);
756  // make sure there is no warning about inconsistent units
757  unsigned int i = 0, iMax = CCopasiMessage::size();
758  unsigned int found24 = 0;
759  unsigned int found55 = 0;
760  unsigned int found79 = 0;
761  unsigned int found66 = 0;
762 
763  while (i < iMax)
764  {
766 
767  // check for messages about inconsistent units
768  if (message.getNumber() == MCSBML + 24)
769  {
770  ++found24;
771  }
772 
773  // check for import errors
774  if (message.getNumber() == MCSBML + 55)
775  {
776  ++found55;
777  }
778 
779  // check for import errors
780  if (message.getNumber() == MCSBML + 79)
781  {
782  ++found79;
783  }
784 
785  // check for import errors
786  if (message.getNumber() == MCSBML + 66)
787  {
788  ++found66;
789  }
790 
791  ++i;
792  }
793 
794  CPPUNIT_ASSERT(found55 == 0);
795  CPPUNIT_ASSERT(found24 == 0);
796  CPPUNIT_ASSERT(found79 == 1);
797  CPPUNIT_ASSERT(found66 == 0);
798 }
799 
801 {
802  CCopasiDataModel* pDataModel = pCOPASIDATAMODEL;
803  CPPUNIT_ASSERT(pDataModel->importSBMLFromString(MODEL_STRING17));
804  CModel* pModel = pDataModel->getModel();
805  CPPUNIT_ASSERT(pModel->getCompartments().size() == 1);
806  CPPUNIT_ASSERT(pModel != NULL);
807  CPPUNIT_ASSERT(pModel->getAreaUnitEnum() == CModel::m2);
808  // make sure there is no warning about inconsistent units
809  unsigned int i = 0, iMax = CCopasiMessage::size();
810  unsigned int found24 = 0;
811  unsigned int found55 = 0;
812  unsigned int found79 = 0;
813  unsigned int found66 = 0;
814 
815  while (i < iMax)
816  {
818 
819  // check for messages about inconsistent units
820  if (message.getNumber() == MCSBML + 24)
821  {
822  ++found24;
823  }
824 
825  // check for import errors
826  if (message.getNumber() == MCSBML + 55)
827  {
828  ++found55;
829  }
830 
831  // check for import errors
832  if (message.getNumber() == MCSBML + 79)
833  {
834  ++found79;
835  }
836 
837  // check for import errors
838  if (message.getNumber() == MCSBML + 66)
839  {
840  ++found66;
841  }
842 
843  ++i;
844  }
845 
846  CPPUNIT_ASSERT(found55 == 0);
847  CPPUNIT_ASSERT(found24 == 0);
848  CPPUNIT_ASSERT(found79 == 1);
849  CPPUNIT_ASSERT(found66 == 0);
850 }
851 
853 {
854  CCopasiDataModel* pDataModel = pCOPASIDATAMODEL;
855  CPPUNIT_ASSERT(pDataModel->importSBMLFromString(MODEL_STRING18));
856  CModel* pModel = pDataModel->getModel();
857  CPPUNIT_ASSERT(pModel->getCompartments().size() == 2);
858  CPPUNIT_ASSERT(pModel != NULL);
859  CPPUNIT_ASSERT(pModel->getAreaUnitEnum() == CModel::m2);
860  // make sure there is no warning about inconsistent units
861  unsigned int i = 0, iMax = CCopasiMessage::size();
862  unsigned int found24 = 0;
863  unsigned int found55 = 0;
864  unsigned int found66 = 0;
865  unsigned int found79 = 0;
866 
867  while (i < iMax)
868  {
870 
871  // check for messages about inconsistent units
872  if (message.getNumber() == MCSBML + 24)
873  {
874  ++found24;
875  }
876 
877  // check for import errors
878  if (message.getNumber() == MCSBML + 55)
879  {
880  ++found55;
881  }
882 
883  // check for import errors
884  if (message.getNumber() == MCSBML + 66)
885  {
886  ++found66;
887  }
888 
889  // check for import errors
890  if (message.getNumber() == MCSBML + 79)
891  {
892  ++found79;
893  }
894 
895  ++i;
896  }
897 
898  CPPUNIT_ASSERT(found55 == 0);
899  CPPUNIT_ASSERT(found24 == 0);
900  CPPUNIT_ASSERT(found79 == 0);
901  CPPUNIT_ASSERT(found66 == 0);
902 }
903 
905 {
906  CCopasiDataModel* pDataModel = pCOPASIDATAMODEL;
907  CPPUNIT_ASSERT(pDataModel->importSBMLFromString(MODEL_STRING19));
908  CModel* pModel = pDataModel->getModel();
909  CPPUNIT_ASSERT(pModel->getCompartments().size() == 2);
910  CPPUNIT_ASSERT(pModel != NULL);
911  CPPUNIT_ASSERT(pModel->getAreaUnitEnum() == CModel::m2);
912  // make sure there is no warning about inconsistent units
913  unsigned int i = 0, iMax = CCopasiMessage::size();
914  unsigned int found24 = 0;
915  unsigned int found55 = 0;
916  unsigned int found66 = 0;
917  unsigned int found79 = 0;
918 
919  while (i < iMax)
920  {
922 
923  // check for messages about inconsistent units
924  if (message.getNumber() == MCSBML + 24)
925  {
926  ++found24;
927  }
928 
929  // check for import errors
930  if (message.getNumber() == MCSBML + 55)
931  {
932  ++found55;
933  }
934 
935  // check for import errors
936  if (message.getNumber() == MCSBML + 66)
937  {
938  ++found66;
939  }
940 
941  // check for import errors
942  if (message.getNumber() == MCSBML + 79)
943  {
944  ++found79;
945  }
946 
947  ++i;
948  }
949 
950  CPPUNIT_ASSERT(found55 == 0);
951  CPPUNIT_ASSERT(found24 == 0);
952  CPPUNIT_ASSERT(found79 == 0);
953  CPPUNIT_ASSERT(found66 == 0);
954 }
955 
957 {
958  CCopasiDataModel* pDataModel = pCOPASIDATAMODEL;
959  CPPUNIT_ASSERT(pDataModel->importSBMLFromString(MODEL_STRING20));
960  CModel* pModel = pDataModel->getModel();
961  CPPUNIT_ASSERT(pModel->getCompartments().size() == 2);
962  CPPUNIT_ASSERT(pModel != NULL);
963  CPPUNIT_ASSERT(pModel->getAreaUnitEnum() == CModel::m2);
964  // make sure there is no warning about inconsistent units
965  unsigned int i = 0, iMax = CCopasiMessage::size();
966  unsigned int found24 = 0;
967  unsigned int found55 = 0;
968  unsigned int found66 = 0;
969  unsigned int found79 = 0;
970 
971  while (i < iMax)
972  {
974 
975  // check for messages about inconsistent units
976  if (message.getNumber() == MCSBML + 24)
977  {
978  ++found24;
979  }
980 
981  // check for import errors
982  if (message.getNumber() == MCSBML + 55)
983  {
984  ++found55;
985  }
986 
987  // check for import errors
988  if (message.getNumber() == MCSBML + 66)
989  {
990  ++found66;
991  }
992 
993  // check for import errors
994  if (message.getNumber() == MCSBML + 79)
995  {
996  ++found79;
997  }
998 
999  ++i;
1000  }
1001 
1002  CPPUNIT_ASSERT(found55 == 0);
1003  CPPUNIT_ASSERT(found24 == 1);
1004  CPPUNIT_ASSERT(found79 == 0);
1005  CPPUNIT_ASSERT(found66 == 0);
1006 }
1007 
1009 {
1010  CCopasiDataModel* pDataModel = pCOPASIDATAMODEL;
1011  CPPUNIT_ASSERT(pDataModel->importSBMLFromString(MODEL_STRING21));
1012  CModel* pModel = pDataModel->getModel();
1013  CPPUNIT_ASSERT(pModel->getCompartments().size() == 2);
1014  CPPUNIT_ASSERT(pModel != NULL);
1015  CPPUNIT_ASSERT(pModel->getAreaUnitEnum() == CModel::m2);
1016  // make sure there is no warning about inconsistent units
1017  unsigned int i = 0, iMax = CCopasiMessage::size();
1018  unsigned int found24 = 0;
1019  unsigned int found55 = 0;
1020  unsigned int found66 = 0;
1021  unsigned int found79 = 0;
1022 
1023  while (i < iMax)
1024  {
1026 
1027  // check for messages about inconsistent units
1028  if (message.getNumber() == MCSBML + 24)
1029  {
1030  ++found24;
1031  }
1032 
1033  // check for import errors
1034  if (message.getNumber() == MCSBML + 55)
1035  {
1036  ++found55;
1037  }
1038 
1039  // check for import errors
1040  if (message.getNumber() == MCSBML + 66)
1041  {
1042  ++found66;
1043  }
1044 
1045  // check for import errors
1046  if (message.getNumber() == MCSBML + 79)
1047  {
1048  ++found79;
1049  }
1050 
1051  ++i;
1052  }
1053 
1054  CPPUNIT_ASSERT(found55 == 0);
1055  CPPUNIT_ASSERT(found24 == 1);
1056  CPPUNIT_ASSERT(found79 == 0);
1057  CPPUNIT_ASSERT(found66 == 0);
1058 }
1059 
1060 const char* test000084::MODEL_STRING1 =
1061  "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
1062  "<sbml xmlns=\"http://www.sbml.org/sbml/level2\" level=\"2\" version=\"1\">"
1063  " <model id=\"Model_1\" name=\"New Model\">"
1064  " <notes>"
1065  " <body xmlns=\"http://www.w3.org/1999/xhtml\">"
1066  " <p>L2V1 model with global area unit nm^2.</p>"
1067  " </body>"
1068  " </notes>"
1069  " <listOfUnitDefinitions>"
1070  " <unitDefinition id=\"area\">"
1071  " <listOfUnits>"
1072  " <unit kind=\"metre\" scale=\"-9\" exponent=\"2\" />"
1073  " </listOfUnits>"
1074  " </unitDefinition>"
1075  " </listOfUnitDefinitions>"
1076  " <listOfCompartments>"
1077  " <compartment id=\"compartment_1\" name=\"compartment\" size=\"1\" spatialDimensions=\"2\" />"
1078  " </listOfCompartments>"
1079  " </model>"
1080  "</sbml>"
1081  ;
1082 
1083 const char* test000084::MODEL_STRING2 =
1084  "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
1085  "<sbml xmlns=\"http://www.sbml.org/sbml/level2\" level=\"2\" version=\"1\">"
1086  " <model id=\"Model_1\" name=\"New Model\">"
1087  " <notes>"
1088  " <body xmlns=\"http://www.w3.org/1999/xhtml\">"
1089  " <p>L2V1 model with global area unit 10e-4* m^2 .</p>"
1090  " </body>"
1091  " </notes>"
1092  " <listOfUnitDefinitions>"
1093  " <unitDefinition id=\"area\">"
1094  " <listOfUnits>"
1095  " <unit kind=\"metre\" scale=\"-4\" exponent=\"2\"/>"
1096  " </listOfUnits>"
1097  " </unitDefinition>"
1098  " </listOfUnitDefinitions>"
1099  " <listOfCompartments>"
1100  " <compartment id=\"compartment_1\" name=\"compartment\" size=\"1\" spatialDimensions=\"2\" />"
1101  " </listOfCompartments>"
1102  " </model>"
1103  "</sbml>"
1104  ;
1105 
1106 const char* test000084::MODEL_STRING3 =
1107  "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
1108  "<sbml xmlns=\"http://www.sbml.org/sbml/level2\" level=\"2\" version=\"1\">"
1109  " <model id=\"Model_1\" name=\"New Model\">"
1110  " <notes>"
1111  " <body xmlns=\"http://www.w3.org/1999/xhtml\">"
1112  " <p>L2V1 model with global area unit mole.</p>"
1113  " </body>"
1114  " </notes>"
1115  " <listOfUnitDefinitions>"
1116  " <unitDefinition id=\"area\">"
1117  " <listOfUnits>"
1118  " <unit kind=\"mole\" scale=\"0\"/>"
1119  " </listOfUnits>"
1120  " </unitDefinition>"
1121  " </listOfUnitDefinitions>"
1122  " <listOfCompartments>"
1123  " <compartment id=\"compartment_1\" name=\"compartment\" size=\"1\" spatialDimensions=\"2\" />"
1124  " </listOfCompartments>"
1125  " </model>"
1126  "</sbml>"
1127  ;
1128 
1129 const char* test000084::MODEL_STRING4 =
1130  "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
1131  "<sbml xmlns=\"http://www.sbml.org/sbml/level2\" level=\"2\" version=\"1\">"
1132  " <model id=\"Model_1\" name=\"New Model\">"
1133  " <notes>"
1134  " <body xmlns=\"http://www.w3.org/1999/xhtml\">"
1135  " <p>L2V1 model with global area unit nm^2</p>"
1136  " <p> and a compartment with mm^2 units</p>"
1137  " </body>"
1138  " </notes>"
1139  " <listOfUnitDefinitions>"
1140  " <unitDefinition id=\"area\">"
1141  " <listOfUnits>"
1142  " <unit kind=\"metre\" scale=\"-9\" exponent=\"2\"/>"
1143  " </listOfUnits>"
1144  " </unitDefinition>"
1145  " <unitDefinition id=\"my_area\">"
1146  " <listOfUnits>"
1147  " <unit kind=\"metre\" scale=\"-3\" exponent=\"2\"/>"
1148  " </listOfUnits>"
1149  " </unitDefinition>"
1150  " </listOfUnitDefinitions>"
1151  " <listOfCompartments>"
1152  " <compartment id=\"compartment_1\" name=\"compartment\" size=\"1\" spatialDimensions=\"2\" units=\"my_area\"/>"
1153  " </listOfCompartments>"
1154  " </model>"
1155  "</sbml>"
1156  ;
1157 
1158 const char* test000084::MODEL_STRING5 =
1159  "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
1160  "<sbml xmlns=\"http://www.sbml.org/sbml/level2\" level=\"2\" version=\"1\">"
1161  " <model id=\"Model_1\" name=\"New Model\">"
1162  " <notes>"
1163  " <body xmlns=\"http://www.w3.org/1999/xhtml\">"
1164  " <p>L2V1 model with global area unit nm^2</p>"
1165  " <p>and a compartment with mole units.</p>"
1166  " </body>"
1167  " </notes>"
1168  " <listOfUnitDefinitions>"
1169  " <unitDefinition id=\"area\">"
1170  " <listOfUnits>"
1171  " <unit kind=\"metre\" scale=\"-9\" exponent=\"2\"/>"
1172  " </listOfUnits>"
1173  " </unitDefinition>"
1174  " <unitDefinition id=\"my_area\">"
1175  " <listOfUnits>"
1176  " <unit kind=\"mole\" scale=\"0\"/>"
1177  " </listOfUnits>"
1178  " </unitDefinition>"
1179  " </listOfUnitDefinitions>"
1180  " <listOfCompartments>"
1181  " <compartment id=\"compartment_1\" name=\"compartment\" size=\"1\" spatialDimensions=\"2\" units=\"my_area\"/>"
1182  " </listOfCompartments>"
1183  " </model>"
1184  "</sbml>"
1185  ;
1186 
1187 const char* test000084::MODEL_STRING6 =
1188  "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
1189  "<sbml xmlns=\"http://www.sbml.org/sbml/level2\" level=\"2\" version=\"1\">"
1190  " <model id=\"Model_1\" name=\"New Model\">"
1191  " <notes>"
1192  " <body xmlns=\"http://www.w3.org/1999/xhtml\">"
1193  " <p>L2V1 model with global area unit mole</p>"
1194  " <p>and a compartment with nm^2 units.</p>"
1195  " </body>"
1196  " </notes>"
1197  " <listOfUnitDefinitions>"
1198  " <unitDefinition id=\"my_area\">"
1199  " <listOfUnits>"
1200  " <unit kind=\"metre\" scale=\"-9\" exponent=\"2\"/>"
1201  " </listOfUnits>"
1202  " </unitDefinition>"
1203  " <unitDefinition id=\"area\">"
1204  " <listOfUnits>"
1205  " <unit kind=\"mole\" scale=\"0\"/>"
1206  " </listOfUnits>"
1207  " </unitDefinition>"
1208  " </listOfUnitDefinitions>"
1209  " <listOfCompartments>"
1210  " <compartment id=\"compartment_1\" name=\"compartment\" size=\"1\" spatialDimensions=\"2\" units=\"my_area\"/>"
1211  " </listOfCompartments>"
1212  " </model>"
1213  "</sbml>"
1214  ;
1215 
1216 const char* test000084::MODEL_STRING7 =
1217  "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
1218  "<sbml xmlns=\"http://www.sbml.org/sbml/level2\" level=\"2\" version=\"1\">"
1219  " <model id=\"Model_1\" name=\"New Model\">"
1220  " <notes>"
1221  " <body xmlns=\"http://www.w3.org/1999/xhtml\">"
1222  " <p>L2V1 model with no global area unit</p>"
1223  " <p>and a compartment with nm^2 units.</p>"
1224  " </body>"
1225  " </notes>"
1226  " <listOfUnitDefinitions>"
1227  " <unitDefinition id=\"my_area\">"
1228  " <listOfUnits>"
1229  " <unit kind=\"metre\" scale=\"-9\" exponent=\"2\"/>"
1230  " </listOfUnits>"
1231  " </unitDefinition>"
1232  " </listOfUnitDefinitions>"
1233  " <listOfCompartments>"
1234  " <compartment id=\"compartment_1\" name=\"compartment\" size=\"1\" spatialDimensions=\"2\" units=\"my_area\"/>"
1235  " </listOfCompartments>"
1236  " </model>"
1237  "</sbml>"
1238  ;
1239 
1240 const char* test000084::MODEL_STRING8 =
1241  "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
1242  "<sbml xmlns=\"http://www.sbml.org/sbml/level2\" level=\"2\" version=\"1\">"
1243  " <model id=\"Model_1\" name=\"New Model\">"
1244  " <notes>"
1245  " <body xmlns=\"http://www.w3.org/1999/xhtml\">"
1246  " <p>L2V1 model with no global area unit</p>"
1247  " <p>and a compartment with area units.</p>"
1248  " </body>"
1249  " </notes>"
1250  " <listOfCompartments>"
1251  " <compartment id=\"compartment_1\" name=\"compartment\" size=\"1\" spatialDimensions=\"2\" units=\"area\"/>"
1252  " </listOfCompartments>"
1253  " </model>"
1254  "</sbml>"
1255  ;
1256 
1257 const char* test000084::MODEL_STRING9 =
1258  "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
1259  "<sbml xmlns=\"http://www.sbml.org/sbml/level2\" level=\"2\" version=\"1\">"
1260  " <model id=\"Model_1\" name=\"New Model\">"
1261  " <notes>"
1262  " <body xmlns=\"http://www.w3.org/1999/xhtml\">"
1263  " <p>L2V1 model with no global area unit</p>"
1264  " <p>and a compartment with metre units.</p>"
1265  " </body>"
1266  " </notes>"
1267  " <listOfCompartments>"
1268  " <compartment id=\"compartment_1\" name=\"compartment\" size=\"1\" spatialDimensions=\"2\" units=\"metre\"/>"
1269  " </listOfCompartments>"
1270  " </model>"
1271  "</sbml>"
1272  ;
1273 
1274 const char* test000084::MODEL_STRING10 =
1275  "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
1276  "<sbml xmlns=\"http://www.sbml.org/sbml/level2\" level=\"2\" version=\"1\">"
1277  " <model id=\"Model_1\" name=\"New Model\">"
1278  " <notes>"
1279  " <body xmlns=\"http://www.w3.org/1999/xhtml\">"
1280  " <p>L2V1 model with no global area unit</p>"
1281  " <p>and a compartment with no units.</p>"
1282  " </body>"
1283  " </notes>"
1284  " <listOfCompartments>"
1285  " <compartment id=\"compartment_1\" name=\"compartment\" size=\"1\" spatialDimensions=\"2\" />"
1286  " </listOfCompartments>"
1287  " </model>"
1288  "</sbml>"
1289  ;
1290 
1291 const char* test000084::MODEL_STRING11 =
1292  "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
1293  "<sbml xmlns=\"http://www.sbml.org/sbml/level2\" level=\"2\" version=\"1\">"
1294  " <model id=\"Model_1\" name=\"New Model\">"
1295  " <notes>"
1296  " <body xmlns=\"http://www.w3.org/1999/xhtml\">"
1297  " <p>L2V1 model with no global area unit</p>"
1298  " <p>and a 2D compartment with volume units.</p>"
1299  " </body>"
1300  " </notes>"
1301  " <listOfCompartments>"
1302  " <compartment id=\"compartment_1\" name=\"compartment\" size=\"1\" spatialDimensions=\"2\" units=\"volume\"/>"
1303  " </listOfCompartments>"
1304  " </model>"
1305  "</sbml>"
1306  ;
1307 
1308 const char* test000084::MODEL_STRING12 =
1309  "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
1310  "<sbml xmlns=\"http://www.sbml.org/sbml/level2\" level=\"2\" version=\"1\">"
1311  " <model id=\"Model_1\" name=\"New Model\">"
1312  " <notes>"
1313  " <body xmlns=\"http://www.w3.org/1999/xhtml\">"
1314  " <p>L2V1 model with no global area unit</p>"
1315  " <p>and a 2D compartment with length units.</p>"
1316  " </body>"
1317  " </notes>"
1318  " <listOfCompartments>"
1319  " <compartment id=\"compartment_1\" name=\"compartment\" size=\"1\" spatialDimensions=\"2\" units=\"length\"/>"
1320  " </listOfCompartments>"
1321  " </model>"
1322  "</sbml>"
1323  ;
1324 
1325 const char* test000084::MODEL_STRING13 =
1326  "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
1327  "<sbml xmlns=\"http://www.sbml.org/sbml/level2\" level=\"2\" version=\"1\">"
1328  " <model id=\"Model_1\" name=\"New Model\">"
1329  " <notes>"
1330  " <body xmlns=\"http://www.w3.org/1999/xhtml\">"
1331  " <p>L2V1 model with no global area unit</p>"
1332  " <p>and a 2D compartment with dimensionmess units.</p>"
1333  " </body>"
1334  " </notes>"
1335  " <listOfCompartments>"
1336  " <compartment id=\"compartment_1\" name=\"compartment\" size=\"1\" spatialDimensions=\"2\" units=\"dimensionless\"/>"
1337  " </listOfCompartments>"
1338  " </model>"
1339  "</sbml>"
1340  ;
1341 
1342 const char* test000084::MODEL_STRING14 =
1343  "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
1344  "<sbml xmlns=\"http://www.sbml.org/sbml/level2\" level=\"2\" version=\"1\">"
1345  " <model id=\"Model_1\" name=\"New Model\">"
1346  " <notes>"
1347  " <body xmlns=\"http://www.w3.org/1999/xhtml\">"
1348  " <p>L2V1 model with no global area unit</p>"
1349  " <p>and a 2D compartment with m^3 units.</p>"
1350  " </body>"
1351  " </notes>"
1352  " <listOfUnitDefinitions>"
1353  " <unitDefinition id=\"my_area\">"
1354  " <listOfUnits>"
1355  " <unit kind=\"metre\" scale=\"0\" exponent=\"3\" />"
1356  " </listOfUnits>"
1357  " </unitDefinition>"
1358  " </listOfUnitDefinitions>"
1359  " <listOfCompartments>"
1360  " <compartment id=\"compartment_1\" name=\"compartment\" size=\"1\" spatialDimensions=\"2\" units=\"my_area\"/>"
1361  " </listOfCompartments>"
1362  " </model>"
1363  "</sbml>"
1364  ;
1365 
1366 const char* test000084::MODEL_STRING15 =
1367  "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
1368  "<sbml xmlns=\"http://www.sbml.org/sbml/level2\" level=\"2\" version=\"1\">"
1369  " <model id=\"Model_1\" name=\"New Model\">"
1370  " <notes>"
1371  " <body xmlns=\"http://www.w3.org/1999/xhtml\">"
1372  " <p>L2V1 model with no global area unit</p>"
1373  " <p>and a 2D compartment with m units.</p>"
1374  " </body>"
1375  " </notes>"
1376  " <listOfUnitDefinitions>"
1377  " <unitDefinition id=\"my_area\">"
1378  " <listOfUnits>"
1379  " <unit kind=\"metre\" scale=\"0\" />"
1380  " </listOfUnits>"
1381  " </unitDefinition>"
1382  " </listOfUnitDefinitions>"
1383  " <listOfCompartments>"
1384  " <compartment id=\"compartment_1\" name=\"compartment\" size=\"1\" spatialDimensions=\"2\" units=\"my_area\"/>"
1385  " </listOfCompartments>"
1386  " </model>"
1387  "</sbml>"
1388  ;
1389 
1390 const char* test000084::MODEL_STRING16 =
1391  "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
1392  "<sbml xmlns=\"http://www.sbml.org/sbml/level2\" level=\"2\" version=\"1\">"
1393  " <model id=\"Model_1\" name=\"New Model\">"
1394  " <notes>"
1395  " <body xmlns=\"http://www.w3.org/1999/xhtml\">"
1396  " <p>L2V1 model with no global area unit</p>"
1397  " <p>and a 2D compartment with mole units.</p>"
1398  " </body>"
1399  " </notes>"
1400  " <listOfUnitDefinitions>"
1401  " <unitDefinition id=\"my_area\">"
1402  " <listOfUnits>"
1403  " <unit kind=\"mole\" scale=\"0\" />"
1404  " </listOfUnits>"
1405  " </unitDefinition>"
1406  " </listOfUnitDefinitions>"
1407  " <listOfCompartments>"
1408  " <compartment id=\"compartment_1\" name=\"compartment\" size=\"1\" spatialDimensions=\"2\" units=\"my_area\"/>"
1409  " </listOfCompartments>"
1410  " </model>"
1411  "</sbml>"
1412  ;
1413 
1414 const char* test000084::MODEL_STRING17 =
1415  "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
1416  "<sbml xmlns=\"http://www.sbml.org/sbml/level2\" level=\"2\" version=\"1\">"
1417  " <model id=\"Model_1\" name=\"New Model\">"
1418  " <notes>"
1419  " <body xmlns=\"http://www.w3.org/1999/xhtml\">"
1420  " <p>L2V1 model with no global area unit</p>"
1421  " <p>and a 2D compartment with substance units.</p>"
1422  " </body>"
1423  " </notes>"
1424  " <listOfCompartments>"
1425  " <compartment id=\"compartment_1\" name=\"compartment\" size=\"1\" spatialDimensions=\"2\" units=\"substance\"/>"
1426  " </listOfCompartments>"
1427  " </model>"
1428  "</sbml>"
1429  ;
1430 
1431 const char* test000084::MODEL_STRING18 =
1432  "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
1433  "<sbml xmlns=\"http://www.sbml.org/sbml/level2\" level=\"2\" version=\"1\">"
1434  " <model id=\"Model_1\" name=\"New Model\">"
1435  " <notes>"
1436  " <body xmlns=\"http://www.w3.org/1999/xhtml\">"
1437  " <p>L2V1 model with no global area unit</p>"
1438  " <p>and two compartments. One has no unit, the other uses area as the unit.</p>"
1439  " </body>"
1440  " </notes>"
1441  " <listOfCompartments>"
1442  " <compartment id=\"compartment_1\" name=\"compartment\" size=\"1\" spatialDimensions=\"2\" />"
1443  " <compartment id=\"compartment_2\" name=\"compartment_2\" size=\"1\" spatialDimensions=\"2\" units=\"area\"/>"
1444  " </listOfCompartments>"
1445  " </model>"
1446  "</sbml>"
1447  ;
1448 
1449 const char* test000084::MODEL_STRING19 =
1450  "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
1451  "<sbml xmlns=\"http://www.sbml.org/sbml/level2\" level=\"2\" version=\"1\">"
1452  " <model id=\"Model_1\" name=\"New Model\">"
1453  " <notes>"
1454  " <body xmlns=\"http://www.w3.org/1999/xhtml\">"
1455  " <p>L2V1 model with no global area unit</p>"
1456  " <p>and two compartments. One has no unit, the other uses metre^2 as the unit.</p>"
1457  " </body>"
1458  " </notes>"
1459  " <listOfCompartments>"
1460  " <compartment id=\"compartment_1\" name=\"compartment\" size=\"1\" spatialDimensions=\"2\" />"
1461  " <compartment id=\"compartment_2\" name=\"compartment_2\" size=\"1\" spatialDimensions=\"2\" units=\"area\"/>"
1462  " </listOfCompartments>"
1463  " </model>"
1464  "</sbml>"
1465  ;
1466 
1467 const char* test000084::MODEL_STRING20 =
1468  "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
1469  "<sbml xmlns=\"http://www.sbml.org/sbml/level2\" level=\"2\" version=\"1\">"
1470  " <model id=\"Model_1\" name=\"New Model\">"
1471  " <notes>"
1472  " <body xmlns=\"http://www.w3.org/1999/xhtml\">"
1473  " <p>L2V1 model with no global area unit</p>"
1474  " <p>and two compartments. One has no unit, the other uses nm^2 as the unit.</p>"
1475  " </body>"
1476  " </notes>"
1477  " <listOfUnitDefinitions>"
1478  " <unitDefinition id=\"my_area\">"
1479  " <listOfUnits>"
1480  " <unit kind=\"metre\" scale=\"-9\" exponent=\"2\" />"
1481  " </listOfUnits>"
1482  " </unitDefinition>"
1483  " </listOfUnitDefinitions>"
1484  " <listOfCompartments>"
1485  " <compartment id=\"compartment_1\" name=\"compartment\" size=\"1\" spatialDimensions=\"2\" />"
1486  " <compartment id=\"compartment_2\" name=\"compartment_2\" size=\"1\" spatialDimensions=\"2\" units=\"my_area\"/>"
1487  " </listOfCompartments>"
1488  " </model>"
1489  "</sbml>"
1490  ;
1491 
1492 const char* test000084::MODEL_STRING21 =
1493  "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
1494  "<sbml xmlns=\"http://www.sbml.org/sbml/level2\" level=\"2\" version=\"1\">"
1495  " <model id=\"Model_1\" name=\"New Model\">"
1496  " <notes>"
1497  " <body xmlns=\"http://www.w3.org/1999/xhtml\">"
1498  " <p>L2V1 model with no global area unit</p>"
1499  " <p>and two compartments. One has nm^2 as the unit, the other one has no unit.</p>"
1500  " </body>"
1501  " </notes>"
1502  " <listOfUnitDefinitions>"
1503  " <unitDefinition id=\"my_area\">"
1504  " <listOfUnits>"
1505  " <unit kind=\"metre\" scale=\"-9\" exponent=\"2\" />"
1506  " </listOfUnits>"
1507  " </unitDefinition>"
1508  " </listOfUnitDefinitions>"
1509  " <listOfCompartments>"
1510  " <compartment id=\"compartment_1\" name=\"compartment\" size=\"1\" spatialDimensions=\"2\" units=\"my_area\"/>"
1511  " <compartment id=\"compartment_2\" name=\"compartment_2\" size=\"1\" spatialDimensions=\"2\" />"
1512  " </listOfCompartments>"
1513  " </model>"
1514  "</sbml>"
1515  ;
static const char * MODEL_STRING1
Definition: test000084.h:58
void test_import_compartment_units_15()
Definition: test000084.cpp:696
static const char * MODEL_STRING19
Definition: test000084.h:110
static const char * MODEL_STRING9
Definition: test000084.h:80
static const char * MODEL_STRING18
Definition: test000084.h:107
void test_import_compartment_units_16()
Definition: test000084.cpp:748
void test_import_compartment_units_21()
static const char * MODEL_STRING6
Definition: test000084.h:71
void test_import_compartment_units_13()
Definition: test000084.cpp:620
static const char * MODEL_STRING8
Definition: test000084.h:77
void test_import_compartment_units_2()
Definition: test000084.cpp:73
void test_import_compartment_units_17()
Definition: test000084.cpp:800
const size_t & getNumber() const
static const char * MODEL_STRING21
Definition: test000084.h:116
static const char * MODEL_STRING13
Definition: test000084.h:92
static const char * MODEL_STRING11
Definition: test000084.h:86
static const char * MODEL_STRING2
Definition: test000084.h:60
void test_import_compartment_units_5()
Definition: test000084.cpp:204
void test_import_compartment_units_14()
Definition: test000084.cpp:644
static CCopasiDataModel * pCOPASIDATAMODEL
Definition: test000084.h:118
void test_import_compartment_units_20()
Definition: test000084.cpp:956
#define MCSBML
void test_import_compartment_units_12()
Definition: test000084.cpp:568
void test_import_compartment_units_11()
Definition: test000084.cpp:516
static size_t size()
void tearDown()
Definition: test000084.cpp:44
void test_import_compartment_units_8()
Definition: test000084.cpp:360
static const char * MODEL_STRING5
Definition: test000084.h:68
void test_import_compartment_units_7()
Definition: test000084.cpp:308
void test_import_compartment_units_9()
Definition: test000084.cpp:412
static const char * MODEL_STRING20
Definition: test000084.h:113
void test_import_compartment_units_10()
Definition: test000084.cpp:464
static CCopasiDataModel * addDatamodel()
void test_import_compartment_units_6()
Definition: test000084.cpp:256
static const char * MODEL_STRING12
Definition: test000084.h:89
void test_import_compartment_units_19()
Definition: test000084.cpp:904
static const char * MODEL_STRING17
Definition: test000084.h:104
void test_import_compartment_units_3()
Definition: test000084.cpp:100
static CCopasiMessage getLastMessage()
static const char * MODEL_STRING3
Definition: test000084.h:62
bool importSBMLFromString(const std::string &sbmlDocumentText, CProcessReport *pImportHandler=NULL, const bool &deleteOldData=true)
void setUp()
Definition: test000084.cpp:36
static const char * MODEL_STRING15
Definition: test000084.h:98
static void init(int argc, char *argv[], const bool &withGui=false)
Definition: CModel.h:50
static const char * MODEL_STRING10
Definition: test000084.h:83
static const char * MODEL_STRING14
Definition: test000084.h:95
void test_import_compartment_units_4()
Definition: test000084.cpp:152
static const char * MODEL_STRING4
Definition: test000084.h:65
static const char * MODEL_STRING16
Definition: test000084.h:101
void test_import_compartment_units_1()
Definition: test000084.cpp:49
static const char * MODEL_STRING7
Definition: test000084.h:74
void test_import_compartment_units_18()
Definition: test000084.cpp:852