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

#include <test000079.h>

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

Public Member Functions

void setUp ()
 
void tearDown ()
 
void test_import_fast ()
 

Static Protected Attributes

static const char * MODEL_STRING1
 
static CCopasiDataModelpCOPASIDATAMODEL = NULL
 

Private Member Functions

 CPPUNIT_TEST (test_import_fast)
 
 CPPUNIT_TEST_SUITE (test000079)
 
 CPPUNIT_TEST_SUITE_END ()
 

Detailed Description

Definition at line 24 of file test000079.h.

Member Function Documentation

test000079::CPPUNIT_TEST ( test_import_fast  )
private
test000079::CPPUNIT_TEST_SUITE ( test000079  )
private
test000079::CPPUNIT_TEST_SUITE_END ( )
private
void test000079::setUp ( )

Definition at line 28 of file test000079.cpp.

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

29 {
30  // Create the root container.
31  CCopasiRootContainer::init(0, NULL, false);
32  // Create the global data model.
34 }
static CCopasiDataModel * pCOPASIDATAMODEL
Definition: test000079.h:33
static CCopasiDataModel * addDatamodel()
static void init(int argc, char *argv[], const bool &withGui=false)
void test000079::tearDown ( )

Definition at line 36 of file test000079.cpp.

References CCopasiRootContainer::destroy().

void test000079::test_import_fast ( )

Definition at line 41 of file test000079.cpp.

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

42 {
43  CCopasiDataModel* pDataModel = pCOPASIDATAMODEL;
44 
45  try
46  {
47  CPPUNIT_ASSERT(pDataModel->importSBMLFromString(test000079::MODEL_STRING1));
48  }
49  catch (...)
50  {
51  // there should not be an exception
52  CPPUNIT_ASSERT(false);
53  }
54 
55  CPPUNIT_ASSERT(pDataModel->getModel() != NULL);
56  // there should only be one error message that the fast flag on "reaction3"
57  // was ignored.
58  CPPUNIT_ASSERT(CCopasiMessage::size() > 0);
59  CCopasiMessage message;
60  unsigned int i, iMax = CCopasiMessage::size();
61 
62  for (i = 0; i < iMax; ++i)
63  {
65 
66  if (message.getNumber() == MCSBML + 29)
67  {
68  break;
69  }
70  }
71 
72  // check if the message was found
73  CPPUNIT_ASSERT(i != iMax);
74  // check that only reaction 3 is listed in the message
75  std::string text = message.getText();
76  CPPUNIT_ASSERT(text.find("reaction1") == std::string::npos);
77  CPPUNIT_ASSERT(text.find("reaction2") == std::string::npos);
78  CPPUNIT_ASSERT(text.find("reaction3") != std::string::npos);
79 }
static CCopasiDataModel * pCOPASIDATAMODEL
Definition: test000079.h:33
const std::string & getText() const
const size_t & getNumber() const
#define MCSBML
static size_t size()
static const char * MODEL_STRING1
Definition: test000079.h:34
static CCopasiMessage getLastMessage()
bool importSBMLFromString(const std::string &sbmlDocumentText, CProcessReport *pImportHandler=NULL, const bool &deleteOldData=true)

Member Data Documentation

const char * test000079::MODEL_STRING1
staticprotected

Definition at line 34 of file test000079.h.

Referenced by test_import_fast().

CCopasiDataModel * test000079::pCOPASIDATAMODEL = NULL
staticprotected

Definition at line 33 of file test000079.h.

Referenced by setUp(), and test_import_fast().


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