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

#include <test000062.h>

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

Public Member Functions

void setUp ()
 
void tearDown ()
 
void test_kineticlaw_without_math ()
 

Static Protected Attributes

static const char * MODEL_STRING1
 
static CCopasiDataModelpCOPASIDATAMODEL = NULL
 

Private Member Functions

 CPPUNIT_TEST (test_kineticlaw_without_math)
 
 CPPUNIT_TEST_SUITE (test000062)
 
 CPPUNIT_TEST_SUITE_END ()
 

Detailed Description

This test check if a kinetic law without math element is imported with the correct warning.

Definition at line 30 of file test000062.h.

Member Function Documentation

test000062::CPPUNIT_TEST ( test_kineticlaw_without_math  )
private
test000062::CPPUNIT_TEST_SUITE ( test000062  )
private
test000062::CPPUNIT_TEST_SUITE_END ( )
private
void test000062::setUp ( )

Definition at line 39 of file test000062.cpp.

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

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

Definition at line 47 of file test000062.cpp.

References CCopasiRootContainer::destroy().

void test000062::test_kineticlaw_without_math ( )

Definition at line 52 of file test000062.cpp.

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

53 {
54  CCopasiDataModel* pDataModel = pCOPASIDATAMODEL;
55  CPPUNIT_ASSERT(pDataModel->importSBMLFromString(test000062::MODEL_STRING1));
56  CModel* pModel = pDataModel->getModel();
57  CPPUNIT_ASSERT(pModel != NULL);
58  CPPUNIT_ASSERT(pModel->getCompartments().size() == 1);
59  CPPUNIT_ASSERT(pModel->getMetabolites().size() == 2);
60  CPPUNIT_ASSERT(pModel->getReactions().size() == 1);
61  CPPUNIT_ASSERT(pModel->getModelValues().size() == 0);
62  // check if the reactions function is set correctly
63  CReaction* pReaction = pModel->getReactions()[0];
64  CPPUNIT_ASSERT(pReaction->getFunction() == CCopasiRootContainer::getUndefinedFunction());
65  // check if the correct error message has been created
66 #if LIBSBML_VERSION >= 40200
67  // recent libsbml versions will complain about missing math element!
68  CPPUNIT_ASSERT(CCopasiMessage::size() == 2);
69 #else
70  CPPUNIT_ASSERT(CCopasiMessage::size() == 1);
71 #endif
73  CPPUNIT_ASSERT(message.getType() == CCopasiMessage::WARNING);
74  CPPUNIT_ASSERT(message.getNumber() == MCSBML + 56);
75 }
static CFunction * getUndefinedFunction()
const size_t & getNumber() const
#define MCSBML
const CCopasiMessage::Type & getType() const
static const char * MODEL_STRING1
Definition: test000062.h:37
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 CCopasiDataModel * pCOPASIDATAMODEL
Definition: test000062.h:38

Member Data Documentation

const char * test000062::MODEL_STRING1
staticprotected

The units given for the two parameters in the kinetic law are wrong and they are only there to stop libsbml from issuing warnings about best modeling practice.

Definition at line 37 of file test000062.h.

Referenced by test_kineticlaw_without_math().

CCopasiDataModel * test000062::pCOPASIDATAMODEL = NULL
staticprotected

Definition at line 38 of file test000062.h.

Referenced by setUp(), and test_kineticlaw_without_math().


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