Fixed memory leak in test cases
continuous-integration/drone/push Build was killed Details

This commit is contained in:
Deukhoofd 2019-09-02 20:49:45 +02:00
parent d21cfeaac8
commit 8bdc1ccfc7
Signed by: Deukhoofd
GPG Key ID: ADF2E9256009EDCE
1 changed files with 3 additions and 0 deletions

View File

@ -10,6 +10,7 @@ TEST_CASE( "Bad Statement To String", "[BoundTreeString]" ) {
auto s = new BoundBadStatement();
s->GetTreeString(stream, 1);
REQUIRE(stream.str() == "\tBadStatement");
delete s;
}
TEST_CASE( "Break Statement To String", "[BoundTreeString]" ) {
@ -17,6 +18,7 @@ TEST_CASE( "Break Statement To String", "[BoundTreeString]" ) {
auto s = new BoundBreakStatement();
s->GetTreeString(stream, 1);
REQUIRE(stream.str() == "\tBreakStatement");
delete s;
}
TEST_CASE( "Block Statement To String", "[BoundTreeString]" ) {
@ -24,6 +26,7 @@ TEST_CASE( "Block Statement To String", "[BoundTreeString]" ) {
auto s = new BoundBlockStatement({new BoundBreakStatement(), new BoundBreakStatement()});
s->GetTreeString(stream, 1);
REQUIRE(stream.str() == "\tBlockStatement\n\t\tBreakStatement\n\t\tBreakStatement");
delete s;
}
#endif