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

#include <test000061.h>

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

Public Member Functions

void setUp ()
 
void tearDown ()
 
void test_bug_1044 ()
 

Static Protected Attributes

static const char * MODEL_STRING1
 
static CCopasiDataModelpCOPASIDATAMODEL = NULL
 

Private Member Functions

 CPPUNIT_TEST (test_bug_1044)
 
 CPPUNIT_TEST_SUITE (test000061)
 
 CPPUNIT_TEST_SUITE_END ()
 

Detailed Description

This test checks if the constant and boundaryCondition flags are set correctly when a FIXED metabolite is changed back to status REACTIONS.

Definition at line 31 of file test000061.h.

Member Function Documentation

test000061::CPPUNIT_TEST ( test_bug_1044  )
private
test000061::CPPUNIT_TEST_SUITE ( test000061  )
private
test000061::CPPUNIT_TEST_SUITE_END ( )
private
void test000061::setUp ( )

Definition at line 37 of file test000061.cpp.

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

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

Definition at line 45 of file test000061.cpp.

References CCopasiRootContainer::destroy().

void test000061::test_bug_1044 ( )

Definition at line 50 of file test000061.cpp.

References CModelEntity::ASSIGNMENT, CCopasiMessage::EXCEPTION, CCopasiDataModel::exportSBMLToString(), CCopasiDataModel::getCurrentSBMLDocument(), CCopasiMessage::getLastMessage(), CCopasiDataModel::getModel(), CModel::getModelValues(), CEvaluationNode::INVALID, load_cps_model_from_stream(), MCSBML, MODEL_STRING1, pCOPASIDATAMODEL, CCopasiMessage::size(), CCopasiVector< T >::size(), and CEvaluationNode::type().

51 {
52  CCopasiDataModel* pDataModel = pCOPASIDATAMODEL;
53  std::istringstream iss(test000061::MODEL_STRING1);
54  CPPUNIT_ASSERT(load_cps_model_from_stream(iss, *pDataModel) == true);
55  CModel* pModel = pDataModel->getModel();
56  CPPUNIT_ASSERT(pModel != NULL);
57  // check if the model has been loaded correctly
58  CPPUNIT_ASSERT(pModel->getModelValues().size() == 1);
59  const CModelValue* pModelValue = pModel->getModelValues()[0];
60  CPPUNIT_ASSERT(pModelValue != NULL);
61  CPPUNIT_ASSERT(pModelValue->getObjectName() == "A");
62  CPPUNIT_ASSERT(pModelValue->getStatus() == CModelEntity::ASSIGNMENT);
63  CPPUNIT_ASSERT(pModelValue->getExpressionPtr() != NULL);
64  const CEvaluationNode* pRoot = pModelValue->getExpressionPtr()->getRoot();
65  CPPUNIT_ASSERT(pRoot != NULL);
66  CPPUNIT_ASSERT(CEvaluationNode::type(pRoot->getType()) == CEvaluationNode::INVALID);
67  const SBMLDocument* pDocument = pDataModel->getCurrentSBMLDocument();
68  CPPUNIT_ASSERT(pDocument == NULL);
69  // export the model to SBML
70  bool exception = false;
71 
72  try
73  {
74  CPPUNIT_ASSERT(pDataModel->exportSBMLToString(NULL, 2, 1).empty() == true);
75  }
76  catch (...)
77  {
78  exception = true;
79  }
80 
81  CPPUNIT_ASSERT(exception == true);
82  CPPUNIT_ASSERT(pDataModel->getCurrentSBMLDocument() == NULL);
83  // check if the correct error message has been created.
85  CPPUNIT_ASSERT(message.getNumber() == MCSBML + 70);
86  CPPUNIT_ASSERT(message.getType() == CCopasiMessage::EXCEPTION);
87  CPPUNIT_ASSERT(CCopasiMessage::size() == 0);
88 }
SBMLDocument * getCurrentSBMLDocument()
static const char * MODEL_STRING1
Definition: test000061.h:38
const CCopasiVectorN< CModelValue > & getModelValues() const
Definition: CModel.cpp:1060
std::string exportSBMLToString(CProcessReport *pExportHandler, int sbmlLevel, int sbmlVersion)
virtual size_t size() const
bool load_cps_model_from_stream(std::istream &is, CCopasiDataModel &dataModel)
Definition: utilities.cpp:21
static Type type(const Type &type)
#define MCSBML
static size_t size()
static CCopasiMessage getLastMessage()
Definition: CModel.h:50
static CCopasiDataModel * pCOPASIDATAMODEL
Definition: test000061.h:39

Member Data Documentation

const char * test000061::MODEL_STRING1
staticprotected
Initial value:
=
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
"<!-- generated with COPASI 4.4.26 (Debug) (http://www.copasi.org) at 2008-06-09 07:46:05 UTC -->"
"<COPASI xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://www.copasi.org/static/schema.xsd\" versionMajor=\"1\" versionMinor=\"0\" versionDevel=\"26\">"
" <Model key=\"Model_0\" name=\"Bug 1044\" timeUnit=\"s\" volumeUnit=\"ml\" quantityUnit=\"mmol\" type=\"deterministic\">"
" <Comment>"
" <body xmlns=\"http://www.w3.org/1999/xhtml\">"
" "
" </body>"
" </Comment>"
" <ListOfModelValues>"
" <ModelValue key=\"ModelValue_0\" name=\"A\" simulationType=\"assignment\">"
" </ModelValue>"
" </ListOfModelValues>"
" <StateTemplate>"
" <StateTemplateVariable objectReference=\"Model_0\"/>"
" <StateTemplateVariable objectReference=\"ModelValue_0\"/>"
" </StateTemplate>"
" <InitialState type=\"initialState\">"
" 0 0"
" </InitialState>"
" </Model>"
"</COPASI>"

Definition at line 38 of file test000061.h.

Referenced by test_bug_1044().

CCopasiDataModel * test000061::pCOPASIDATAMODEL = NULL
staticprotected

Definition at line 39 of file test000061.h.

Referenced by setUp(), and test_bug_1044().


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