MCPcopy Create free account
hub / github.com/GilesBathgate/RapCAD / testFunction

Method testFunction

src/tester.cpp:400–419  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

398#endif
399
400void Tester::testFunction(Script& s)
401{
402 TreeEvaluator te(*nullreport);
403 //If a test function exists check it returns true
404 QList<Argument*> args;
405 Callback* c = addCallback("test",s,args);
406 s.accept(te);
407 auto* v = dynamic_cast<BooleanValue*>(c->getResult());
408 if(v && v->isTrue()) {
409 writePass();
410 passcount++;
411 } else {
412 writeFail();
413 failcount++;
414 }
415 delete v;
416
417 Node* n=te.getRootNode();
418 delete n;
419}
420
421void Tester::testModule(Script& s,const QFileInfo& file)
422{

Callers

nothing calls this directly

Calls 4

getRootNodeMethod · 0.80
acceptMethod · 0.45
getResultMethod · 0.45
isTrueMethod · 0.45

Tested by

no test coverage detected