Fixed memory leak in test cases
continuous-integration/drone/push Build was killed
Details
continuous-integration/drone/push Build was killed
Details
This commit is contained in:
parent
d21cfeaac8
commit
8bdc1ccfc7
|
@ -10,6 +10,7 @@ TEST_CASE( "Bad Statement To String", "[BoundTreeString]" ) {
|
||||||
auto s = new BoundBadStatement();
|
auto s = new BoundBadStatement();
|
||||||
s->GetTreeString(stream, 1);
|
s->GetTreeString(stream, 1);
|
||||||
REQUIRE(stream.str() == "\tBadStatement");
|
REQUIRE(stream.str() == "\tBadStatement");
|
||||||
|
delete s;
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE( "Break Statement To String", "[BoundTreeString]" ) {
|
TEST_CASE( "Break Statement To String", "[BoundTreeString]" ) {
|
||||||
|
@ -17,6 +18,7 @@ TEST_CASE( "Break Statement To String", "[BoundTreeString]" ) {
|
||||||
auto s = new BoundBreakStatement();
|
auto s = new BoundBreakStatement();
|
||||||
s->GetTreeString(stream, 1);
|
s->GetTreeString(stream, 1);
|
||||||
REQUIRE(stream.str() == "\tBreakStatement");
|
REQUIRE(stream.str() == "\tBreakStatement");
|
||||||
|
delete s;
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE( "Block Statement To String", "[BoundTreeString]" ) {
|
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()});
|
auto s = new BoundBlockStatement({new BoundBreakStatement(), new BoundBreakStatement()});
|
||||||
s->GetTreeString(stream, 1);
|
s->GetTreeString(stream, 1);
|
||||||
REQUIRE(stream.str() == "\tBlockStatement\n\t\tBreakStatement\n\t\tBreakStatement");
|
REQUIRE(stream.str() == "\tBlockStatement\n\t\tBreakStatement\n\t\tBreakStatement");
|
||||||
|
delete s;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
Loading…
Reference in New Issue