Skip to content

Commit

Permalink
Cleanup after datablock tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaspj committed Sep 16, 2023
1 parent 595e683 commit ff03c43
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Engine/source/testing/datablockTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ TEST(DatablockTest, Datablocks_Can_Be_Overridden)
ASSERT_TRUE(result.valid);
// Successfully overrode the datablock
EXPECT_STREQ(result.value, "3");

// Cleanup
result = Con::evaluatef(R"(
testDb.delete();
return "done";
)", false, "datablockTest.cpp");
// Cleanup succesful
ASSERT_TRUE(result.valid);
}

TEST(DatablockTest, Datablocks_Must_Not_Change_Type)
Expand All @@ -37,6 +45,14 @@ TEST(DatablockTest, Datablocks_Must_Not_Change_Type)
ASSERT_TRUE(result.valid);
// Did not override the datablock
EXPECT_STREQ(result.value, "2");

// Cleanup
result = Con::evaluatef(R"(
testDb.delete();
return "done";
)", false, "datablockTest.cpp");
// Cleanup succesful
ASSERT_TRUE(result.valid);
}

TEST(DatablockTest, Datablock_Can_Substitute_String)
Expand Down Expand Up @@ -64,4 +80,8 @@ TEST(DatablockTest, Datablock_Can_Substitute_String)
testDb->performSubstitutions(testDb, testObj);

EXPECT_EQ(testDb->lifetimeMS, 1234);

// Cleanup
testDb->deleteObject();
testObj->deleteObject();
}

0 comments on commit ff03c43

Please sign in to comment.