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

Method evaluate

src/module/assertmodule.cpp:28–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26}
27
28Node* AssertModule::evaluate(const Context& ctx) const
29{
30 Value* expectedVal=getParameterArgument(ctx,0);
31 Value* messageVal=getParameterArgument(ctx,1);
32
33 QString message;
34 if(messageVal)
35 message=messageVal->getValueString();
36 else
37 message=tr("Assertion failed");
38
39 if(expectedVal&&expectedVal->isFalse())
40 throw AssertException(message);
41
42 return nullptr;
43}

Callers

nothing calls this directly

Calls 3

AssertExceptionClass · 0.85
isFalseMethod · 0.80
getValueStringMethod · 0.45

Tested by

no test coverage detected