Greatly simplify handling numerical eval values, using std::variant
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2019-09-07 10:57:09 +02:00
parent 7b5d03ed74
commit 5d700aa0e9
12 changed files with 183 additions and 393 deletions

View File

@@ -51,10 +51,10 @@ TEST_CASE( "Define script function and call from extern", "[integration]" ) {
script->Evaluate();
REQUIRE(script->HasFunction(u"add"));
auto toAddVal = new IntegerEvalValue(5);
auto toAddVal = new NumericEvalValue(5);
script->CallFunction(u"add", {toAddVal});
delete toAddVal;
toAddVal = new IntegerEvalValue(6);
toAddVal = new NumericEvalValue(6);
script->CallFunction(u"add", {toAddVal});
delete toAddVal;
@@ -76,8 +76,8 @@ TEST_CASE( "Define script function and return", "[integration]" ) {
script->Evaluate();
REQUIRE(script->HasFunction(u"add"));
auto toAddVal = new IntegerEvalValue(5);
auto toAddVal2 = new IntegerEvalValue(6);
auto toAddVal = new NumericEvalValue(5);
auto toAddVal2 = new NumericEvalValue(6);
auto result = script->CallFunction(u"add", {toAddVal, toAddVal2});
delete toAddVal;
delete toAddVal2;