Minor test memory cleanup

This commit is contained in:
Deukhoofd 2019-06-05 19:18:11 +02:00
parent d49692a17e
commit 7f79c4d8bb
No known key found for this signature in database
GPG Key ID: B4C087AC81641654
1 changed files with 6 additions and 2 deletions

View File

@ -44,8 +44,12 @@ TEST_CASE( "Define script function and call from extern", "[integration]" ) {
script->Evaluate();
REQUIRE(script->HasFunction("add"));
script->CallFunction("add", {new IntegerEvalValue(5)});
script->CallFunction("add", {new IntegerEvalValue(6)});
auto toAddVal = new IntegerEvalValue(5);
script->CallFunction("add", {toAddVal});
delete toAddVal;
toAddVal = new IntegerEvalValue(6);
script->CallFunction("add", {toAddVal});
delete toAddVal;
auto result = script->GetVariable("result");
REQUIRE(result->GetType()->GetClass() == TypeClass::Number);