22 #include "utilities.hpp"
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"
54 CPPUNIT_ASSERT(pModel->getCompartments().size() == 1);
55 CPPUNIT_ASSERT(pModel != NULL);
58 unsigned int found24 = 0;
59 unsigned int found55 = 0;
60 unsigned int found66 = 0;
61 unsigned int found79 = 0;
94 CPPUNIT_ASSERT(found55 == 0);
95 CPPUNIT_ASSERT(found24 == 0);
96 CPPUNIT_ASSERT(found66 == 0);
97 CPPUNIT_ASSERT(found79 == 1);
105 CPPUNIT_ASSERT(pModel->getCompartments().size() == 1);
106 CPPUNIT_ASSERT(pModel != NULL);
109 unsigned int found24 = 0;
110 unsigned int found55 = 0;
111 unsigned int found66 = 0;
112 unsigned int found79 = 0;
145 CPPUNIT_ASSERT(found55 == 0);
146 CPPUNIT_ASSERT(found24 == 0);
147 CPPUNIT_ASSERT(found66 == 0);
148 CPPUNIT_ASSERT(found79 == 1);
156 CPPUNIT_ASSERT(pModel->getCompartments().size() == 1);
157 CPPUNIT_ASSERT(pModel != NULL);
160 unsigned int found24 = 0;
161 unsigned int found55 = 0;
162 unsigned int found66 = 0;
163 unsigned int found79 = 0;
196 CPPUNIT_ASSERT(found55 == 0);
197 CPPUNIT_ASSERT(found24 == 0);
198 CPPUNIT_ASSERT(found66 == 0);
199 CPPUNIT_ASSERT(found79 == 0);
207 CPPUNIT_ASSERT(pModel->getCompartments().size() == 1);
208 CPPUNIT_ASSERT(pModel != NULL);
211 unsigned int found24 = 0;
212 unsigned int found55 = 0;
213 unsigned int found66 = 0;
214 unsigned int found79 = 0;
247 CPPUNIT_ASSERT(found55 == 0);
248 CPPUNIT_ASSERT(found24 == 0);
249 CPPUNIT_ASSERT(found66 == 0);
250 CPPUNIT_ASSERT(found79 == 1);
258 CPPUNIT_ASSERT(pModel->getCompartments().size() == 1);
259 CPPUNIT_ASSERT(pModel != NULL);
262 unsigned int found24 = 0;
263 unsigned int found55 = 0;
264 unsigned int found66 = 0;
265 unsigned int found79 = 0;
298 CPPUNIT_ASSERT(found55 == 0);
299 CPPUNIT_ASSERT(found24 == 0);
300 CPPUNIT_ASSERT(found66 == 0);
301 CPPUNIT_ASSERT(found79 == 1);
309 CPPUNIT_ASSERT(pModel->getCompartments().size() == 1);
310 CPPUNIT_ASSERT(pModel != NULL);
332 CPPUNIT_ASSERT(pModel->getCompartments().size() == 1);
333 CPPUNIT_ASSERT(pModel != NULL);
336 unsigned int found24 = 0;
337 unsigned int found55 = 0;
338 unsigned int found66 = 0;
339 unsigned int found79 = 0;
372 CPPUNIT_ASSERT(found55 == 0);
373 CPPUNIT_ASSERT(found24 == 0);
374 CPPUNIT_ASSERT(found66 == 0);
375 CPPUNIT_ASSERT(found79 == 1);
383 CPPUNIT_ASSERT(pModel->getCompartments().size() == 1);
384 CPPUNIT_ASSERT(pModel != NULL);
387 unsigned int found24 = 0;
388 unsigned int found55 = 0;
389 unsigned int found66 = 0;
390 unsigned int found79 = 0;
423 CPPUNIT_ASSERT(found55 == 0);
424 CPPUNIT_ASSERT(found24 == 0);
425 CPPUNIT_ASSERT(found66 == 0);
426 CPPUNIT_ASSERT(found79 == 0);
434 CPPUNIT_ASSERT(pModel->getCompartments().size() == 1);
435 CPPUNIT_ASSERT(pModel != NULL);
438 unsigned int found24 = 0;
439 unsigned int found55 = 0;
440 unsigned int found66 = 0;
441 unsigned int found79 = 0;
474 CPPUNIT_ASSERT(found55 == 0);
475 CPPUNIT_ASSERT(found24 == 0);
476 CPPUNIT_ASSERT(found66 == 0);
477 CPPUNIT_ASSERT(found79 == 1);
485 CPPUNIT_ASSERT(pModel->getCompartments().size() == 1);
486 CPPUNIT_ASSERT(pModel != NULL);
489 unsigned int found24 = 0;
490 unsigned int found55 = 0;
491 unsigned int found66 = 0;
492 unsigned int found79 = 0;
525 CPPUNIT_ASSERT(found55 == 0);
526 CPPUNIT_ASSERT(found24 == 0);
527 CPPUNIT_ASSERT(found66 == 0);
528 CPPUNIT_ASSERT(found79 == 1);
536 CPPUNIT_ASSERT(pModel->getCompartments().size() == 2);
537 CPPUNIT_ASSERT(pModel != NULL);
540 unsigned int found24 = 0;
541 unsigned int found55 = 0;
542 unsigned int found66 = 0;
543 unsigned int found79 = 0;
576 CPPUNIT_ASSERT(found55 == 0);
577 CPPUNIT_ASSERT(found24 == 0);
578 CPPUNIT_ASSERT(found66 == 0);
579 CPPUNIT_ASSERT(found79 == 0);
583 "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
584 "<sbml xmlns=\"http://www.sbml.org/sbml/level2\" level=\"2\" version=\"1\">"
585 " <model id=\"Model_1\" name=\"New Model\">"
587 " <body xmlns=\"http://www.w3.org/1999/xhtml\">"
588 " <p>L2V1 model with a compartment with length units.</p>"
591 " <listOfCompartments>"
592 " <compartment id=\"compartment_1\" name=\"compartment\" size=\"1\" spatialDimensions=\"0\" units=\"length\"/>"
593 " </listOfCompartments>"
599 "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
600 "<sbml xmlns=\"http://www.sbml.org/sbml/level2\" level=\"2\" version=\"1\">"
601 " <model id=\"Model_1\" name=\"New Model\">"
603 " <body xmlns=\"http://www.w3.org/1999/xhtml\">"
604 " <p>L2V1 model with a compartment with metre units.</p>"
607 " <listOfCompartments>"
608 " <compartment id=\"compartment_1\" name=\"compartment\" size=\"1\" spatialDimensions=\"0\" units=\"metre\"/>"
609 " </listOfCompartments>"
615 "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
616 "<sbml xmlns=\"http://www.sbml.org/sbml/level2\" level=\"2\" version=\"1\">"
617 " <model id=\"Model_1\" name=\"New Model\">"
619 " <body xmlns=\"http://www.w3.org/1999/xhtml\">"
620 " <p>L2V1 model with a compartment with no units.</p>"
623 " <listOfCompartments>"
624 " <compartment id=\"compartment_1\" name=\"compartment\" size=\"1\" spatialDimensions=\"0\" />"
625 " </listOfCompartments>"
631 "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
632 "<sbml xmlns=\"http://www.sbml.org/sbml/level2\" level=\"2\" version=\"1\">"
633 " <model id=\"Model_1\" name=\"New Model\">"
635 " <body xmlns=\"http://www.w3.org/1999/xhtml\">"
636 " <p>L2V1 model with a 0D compartment with volume units.</p>"
639 " <listOfCompartments>"
640 " <compartment id=\"compartment_1\" name=\"compartment\" size=\"1\" spatialDimensions=\"0\" units=\"volume\"/>"
641 " </listOfCompartments>"
647 "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
648 "<sbml xmlns=\"http://www.sbml.org/sbml/level2\" level=\"2\" version=\"1\">"
649 " <model id=\"Model_1\" name=\"New Model\">"
651 " <body xmlns=\"http://www.w3.org/1999/xhtml\">"
652 " <p>L2V1 model with a 0D compartment with area units.</p>"
655 " <listOfCompartments>"
656 " <compartment id=\"compartment_1\" name=\"compartment\" size=\"1\" spatialDimensions=\"0\" units=\"area\"/>"
657 " </listOfCompartments>"
663 "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
664 "<sbml xmlns=\"http://www.sbml.org/sbml/level2\" level=\"2\" version=\"1\">"
665 " <model id=\"Model_1\" name=\"New Model\">"
667 " <body xmlns=\"http://www.w3.org/1999/xhtml\">"
668 " <p>L2V1 model with a 0D compartment with dimensionless units.</p>"
671 " <listOfCompartments>"
672 " <compartment id=\"compartment_1\" name=\"compartment\" size=\"1\" spatialDimensions=\"0\" units=\"dimensionless\"/>"
673 " </listOfCompartments>"
679 "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
680 "<sbml xmlns=\"http://www.sbml.org/sbml/level2\" level=\"2\" version=\"1\">"
681 " <model id=\"Model_1\" name=\"New Model\">"
683 " <body xmlns=\"http://www.w3.org/1999/xhtml\">"
684 " <p>L2V1 model with a 0D compartment with m^2 units.</p>"
687 " <listOfUnitDefinitions>"
688 " <unitDefinition id=\"my_dimensionless\">"
690 " <unit kind=\"metre\" scale=\"0\" exponent=\"2\" />"
693 " </listOfUnitDefinitions>"
694 " <listOfCompartments>"
695 " <compartment id=\"compartment_1\" name=\"compartment\" size=\"1\" spatialDimensions=\"0\" units=\"my_dimensionless\"/>"
696 " </listOfCompartments>"
702 "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
703 "<sbml xmlns=\"http://www.sbml.org/sbml/level2\" level=\"2\" version=\"1\">"
704 " <model id=\"Model_1\" name=\"New Model\">"
706 " <body xmlns=\"http://www.w3.org/1999/xhtml\">"
707 " <p>L2V1 model with a 0D compartment with dimensionless units.</p>"
710 " <listOfUnitDefinitions>"
711 " <unitDefinition id=\"my_dimensionless\">"
713 " <unit kind=\"dimensionless\" scale=\"0\" />"
716 " </listOfUnitDefinitions>"
717 " <listOfCompartments>"
718 " <compartment id=\"compartment_1\" name=\"compartment\" size=\"1\" spatialDimensions=\"0\" units=\"my_dimensionless\"/>"
719 " </listOfCompartments>"
725 "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
726 "<sbml xmlns=\"http://www.sbml.org/sbml/level2\" level=\"2\" version=\"1\">"
727 " <model id=\"Model_1\" name=\"New Model\">"
729 " <body xmlns=\"http://www.w3.org/1999/xhtml\">"
730 " <p>L2V1 model with a 0D compartment with mole units.</p>"
733 " <listOfUnitDefinitions>"
734 " <unitDefinition id=\"my_dimensionless\">"
736 " <unit kind=\"mole\" scale=\"0\" />"
739 " </listOfUnitDefinitions>"
740 " <listOfCompartments>"
741 " <compartment id=\"compartment_1\" name=\"compartment\" size=\"1\" spatialDimensions=\"0\" units=\"my_dimensionless\"/>"
742 " </listOfCompartments>"
748 "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
749 "<sbml xmlns=\"http://www.sbml.org/sbml/level2\" level=\"2\" version=\"1\">"
750 " <model id=\"Model_1\" name=\"New Model\">"
752 " <body xmlns=\"http://www.w3.org/1999/xhtml\">"
753 " <p>L2V1 model with a 0D compartment with substance units.</p>"
756 " <listOfCompartments>"
757 " <compartment id=\"compartment_1\" name=\"compartment\" size=\"1\" spatialDimensions=\"0\" units=\"substance\"/>"
758 " </listOfCompartments>"
764 "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
765 "<sbml xmlns=\"http://www.sbml.org/sbml/level2\" level=\"2\" version=\"1\">"
766 " <model id=\"Model_1\" name=\"New Model\">"
768 " <body xmlns=\"http://www.w3.org/1999/xhtml\">"
769 " <p>L2V1 model with two compartments. One has no unit, the other uses dimensionless as the unit.</p>"
772 " <listOfCompartments>"
773 " <compartment id=\"compartment_1\" name=\"compartment\" size=\"1\" spatialDimensions=\"0\" />"
774 " <compartment id=\"compartment_2\" name=\"compartment_2\" size=\"1\" spatialDimensions=\"0\" units=\"dimensionless\"/>"
775 " </listOfCompartments>"
void test_import_compartment_units_5()
void test_import_compartment_units_10()
void test_import_compartment_units_8()
static CCopasiDataModel * pCOPASIDATAMODEL
static const char * MODEL_STRING1
void test_import_compartment_units_3()
static const char * MODEL_STRING3
static const char * MODEL_STRING11
const size_t & getNumber() const
static const char * MODEL_STRING9
void test_import_compartment_units_1()
void test_import_compartment_units_7()
static const char * MODEL_STRING8
void test_import_compartment_units_4()
static const char * MODEL_STRING4
static const char * MODEL_STRING2
void test_import_compartment_units_6()
static const char * MODEL_STRING6
static CCopasiDataModel * addDatamodel()
static const char * MODEL_STRING5
static CCopasiMessage getLastMessage()
bool importSBMLFromString(const std::string &sbmlDocumentText, CProcessReport *pImportHandler=NULL, const bool &deleteOldData=true)
void test_import_compartment_units_2()
static void init(int argc, char *argv[], const bool &withGui=false)
void test_import_compartment_units_11()
void test_import_compartment_units_9()
static const char * MODEL_STRING10
static const char * MODEL_STRING7