diff options
Diffstat (limited to 'tests/scene/test_graph_node.h')
-rw-r--r-- | tests/scene/test_graph_node.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/scene/test_graph_node.h b/tests/scene/test_graph_node.h index 72b8b682c9..7973ac1444 100644 --- a/tests/scene/test_graph_node.h +++ b/tests/scene/test_graph_node.h @@ -42,14 +42,16 @@ TEST_CASE("[GraphNode][SceneTree]") { SUBCASE("[GraphNode] Graph Node only child on delete should not cause error.") { // Setup. GraphNode *test_node = memnew(GraphNode); - test_child->set_name("Graph Node"); + test_node->set_name("Graph Node"); Control *test_child = memnew(Control); test_child->set_name("child"); test_node->add_child(test_child); // Test. - CHECK_NOTHROW_MESSAGE(test_node->remove_child(test_child)); + test_node->remove_child(test_child); + CHECK(test_node->get_child_count(false) == 0); + memdelete(test_child); memdelete(test_node); } } |