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

#include <test000104.h>

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

Public Member Functions

void setUp ()
 
void tearDown ()
 
void test_bug1744 ()
 

Protected Attributes

CCopasiDataModelpDataModel
 

Static Protected Attributes

static const char * SBML_STRING
 

Private Member Functions

 CPPUNIT_TEST (test_bug1744)
 
 CPPUNIT_TEST_SUITE (test000104)
 
 CPPUNIT_TEST_SUITE_END ()
 

Detailed Description

Definition at line 30 of file test000104.h.

Member Function Documentation

test000104::CPPUNIT_TEST ( test_bug1744  )
private
test000104::CPPUNIT_TEST_SUITE ( test000104  )
private
test000104::CPPUNIT_TEST_SUITE_END ( )
private
void test000104::setUp ( )

Definition at line 31 of file test000104.cpp.

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

32 {
33  // Create the root container.
34  CCopasiRootContainer::init(0, NULL, false);
36 }
CCopasiDataModel * pDataModel
Definition: test000104.h:40
static CCopasiDataModel * addDatamodel()
static void init(int argc, char *argv[], const bool &withGui=false)
void test000104::tearDown ( )

Definition at line 38 of file test000104.cpp.

References CCopasiRootContainer::destroy().

void test000104::test_bug1744 ( )

Definition at line 45 of file test000104.cpp.

References CCopasiMessage::checkForMessage(), CCopasiDataModel::importSBMLFromString(), MCSBML, pDataModel, SBML_STRING, and CCopasiMessage::size().

46 {
47  try
48  {
50  CPPUNIT_ASSERT(result == true);
51  }
52  catch (...)
53  {
54  CPPUNIT_ASSERT_MESSAGE("Importing the model string failed with an exception.", false);
55  }
56 
57  // the actual test was if the import leads to a crash, the rest is just sugar coating
58 
59  // check the error messages
60  // since there are 6 unit ids used on the model, but none of these is defined as
61  // a unit definiton, we should have at least 6 warnings and one should be MCSBML + 66
62  unsigned int i, iMax = CCopasiMessage::size();
63  CPPUNIT_ASSERT(iMax >= 6);
64  CPPUNIT_ASSERT(CCopasiMessage::checkForMessage(MCSBML + 66) == true);
65 }
static const char * SBML_STRING
Definition: test000104.h:38
#define MCSBML
static size_t size()
CCopasiDataModel * pDataModel
Definition: test000104.h:40
static bool checkForMessage(const size_t &number)
bool importSBMLFromString(const std::string &sbmlDocumentText, CProcessReport *pImportHandler=NULL, const bool &deleteOldData=true)

Member Data Documentation

CCopasiDataModel* test000104::pDataModel
protected

Definition at line 40 of file test000104.h.

Referenced by setUp(), and test_bug1744().

const char * test000104::SBML_STRING
staticprotected
Initial value:
= "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
"<sbml xmlns=\"http://www.sbml.org/sbml/level3/version1/core\" xmlns:comp=\"http://www.sbml.org/sbml/level3/version1/comp/version1\" level=\"3\" version=\"1\" xmlns:html=\"http://www.w3.org/1999/xhtml\" xmlns:jigcell=\"http://www.sbml.org/2001/ns/jigcell\" xmlns:math=\"http://www.w3.org/1998/Math/MathML\">\n"
"<comp:listOfModelDefinitions>\n"
"</comp:listOfModelDefinitions>\n"
"<model areaUnits=\"area\" extentUnits=\"substance\" id=\"Model_1\" lengthUnits=\"length\" metaid=\"COPASI1\" name=\"RootModel\" substanceUnits=\"substance\" timeUnits=\"time\" volumeUnits=\"volume\">\n"
" </model>\n"
"</sbml>"

Definition at line 38 of file test000104.h.

Referenced by test_bug1744().


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