47 CPPUNIT_ASSERT(pTree != NULL);
50 CPPUNIT_ASSERT(pFunction != NULL);
52 CPPUNIT_ASSERT(pCallNode != NULL);
54 unsigned int i = 0, iMax = pFunctionParameters->
size();
59 CPPUNIT_ASSERT(pParameter != NULL);
67 CPPUNIT_ASSERT(pExpanded != NULL);
71 CPPUNIT_ASSERT(pChild != NULL);
75 CPPUNIT_ASSERT(pChild != NULL);
77 CPPUNIT_ASSERT(pChild->
getData() == std::string(
"y"));
79 CPPUNIT_ASSERT(pChild != NULL);
81 CPPUNIT_ASSERT(pChild->getData() == std::string(
"x"));
82 CPPUNIT_ASSERT(pChild->getSibling() == NULL);
84 CPPUNIT_ASSERT(pChild != NULL);
87 CPPUNIT_ASSERT((fabs(pChild->getValue() - 2.0) / 2.0) < 1e-6);
88 CPPUNIT_ASSERT(pChild->getSibling() == NULL);
93 CPPUNIT_ASSERT(pTree != NULL);
95 pFunction =
dynamic_cast<CFunction*
>(pTree);
96 CPPUNIT_ASSERT(pFunction != NULL);
98 CPPUNIT_ASSERT(pCallNode != NULL);
100 i = 0, iMax = pFunctionParameters->
size();
105 CPPUNIT_ASSERT(pParameter != NULL);
113 CPPUNIT_ASSERT(pExpanded != NULL);
117 CPPUNIT_ASSERT(pChild != NULL);
121 CPPUNIT_ASSERT(pChild != NULL);
123 CPPUNIT_ASSERT(pChild->getData() == std::string(
"a"));
125 CPPUNIT_ASSERT(pChild != NULL);
128 CPPUNIT_ASSERT(pChild->getSibling() == NULL);
130 CPPUNIT_ASSERT(pChild != NULL);
132 CPPUNIT_ASSERT(pChild->getData() == std::string(
"c"));
134 CPPUNIT_ASSERT(pChild != NULL);
137 CPPUNIT_ASSERT((fabs(pChild->getValue() - 1.3) / 1.3) < 1e-6);
138 CPPUNIT_ASSERT(pChild->getSibling() == NULL);
141 pChild =
dynamic_cast<CEvaluationNode*
>(pExpanded->getChild()->getSibling());
142 CPPUNIT_ASSERT(pChild != NULL);
147 CPPUNIT_ASSERT(pChild != NULL);
151 CPPUNIT_ASSERT(pChild != NULL);
154 CPPUNIT_ASSERT((fabs(pChild->getValue() - 3.0) / 3.0) < 1e-6);
157 CPPUNIT_ASSERT(pChild->getData() == std::string(
"b"));
158 CPPUNIT_ASSERT(pChild->getSibling() == NULL);
160 pChild =
dynamic_cast<CEvaluationNode*
>(pExpanded->getChild()->getSibling()->getChild()->getSibling());
161 CPPUNIT_ASSERT(pChild != NULL);
164 CPPUNIT_ASSERT((fabs(pChild->getValue() - 5.23) / 5.23) < 1e-6);
165 CPPUNIT_ASSERT(pChild->getSibling() == NULL);
171 CPPUNIT_ASSERT(pTree != NULL);
173 pFunction =
dynamic_cast<CFunction*
>(pTree);
174 CPPUNIT_ASSERT(pFunction != NULL);
176 CPPUNIT_ASSERT(pCallNode != NULL);
178 i = 0, iMax = pFunctionParameters->
size();
183 CPPUNIT_ASSERT(pParameter != NULL);
191 CPPUNIT_ASSERT(pExpanded != NULL);
196 CPPUNIT_ASSERT(pChild != NULL);
200 CPPUNIT_ASSERT(pChild != NULL);
202 CPPUNIT_ASSERT(pChild->getData() == std::string(
"k1"));
204 CPPUNIT_ASSERT(pChild != NULL);
207 CPPUNIT_ASSERT(pChild->getSibling() == NULL);
209 CPPUNIT_ASSERT(pChild != NULL);
211 CPPUNIT_ASSERT(pChild->getData() == std::string(
"k3"));
213 CPPUNIT_ASSERT(pChild != NULL);
216 CPPUNIT_ASSERT((fabs(pChild->getValue() - 1.3) / 1.3) < 1e-6);
217 CPPUNIT_ASSERT(pChild->getSibling() == NULL);
220 pChild =
dynamic_cast<CEvaluationNode*
>(pExpanded->getChild()->getSibling());
221 CPPUNIT_ASSERT(pChild != NULL);
226 CPPUNIT_ASSERT(pChild != NULL);
230 CPPUNIT_ASSERT(pChild != NULL);
233 CPPUNIT_ASSERT((fabs(pChild->getValue() - 3.0) / 3.0) < 1e-6);
236 CPPUNIT_ASSERT(pChild->getData() == std::string(
"k2"));
237 CPPUNIT_ASSERT(pChild->getSibling() == NULL);
239 pChild =
dynamic_cast<CEvaluationNode*
>(pExpanded->getChild()->getSibling()->getChild()->getSibling());
240 CPPUNIT_ASSERT(pChild != NULL);
243 CPPUNIT_ASSERT((fabs(pChild->getValue() - 5.23) / 5.23) < 1e-6);
244 CPPUNIT_ASSERT(pChild->getSibling() == NULL);
virtual bool addChild(CCopasiNode< Data > *pChild, CCopasiNode< Data > *pAfter=NULL)
const std::string & getObjectName() const
const Type & getType() const
bool load_cps_model_from_stream(std::istream &is, CCopasiDataModel &dataModel)
static Type type(const Type &type)
static CCopasiDataModel * pCOPASIDATAMODEL
static const char * MODEL_STRING1
static CFunctionDB * getFunctionList()
static Type subType(const Type &type)
The class for handling a chemical kinetic function.
virtual const Data & getData() const
ASTNode * expand_function_calls(const ASTNode *pNode, const ListOfFunctionDefinitions *pFunctions)
CCopasiNode< Data > * getChild()
CFunction * findFunction(const std::string &functionName)
CFunctionParameters & getVariables()