Skip to content

Commit

Permalink
Fix leaks in C++ tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SanderMertens committed Jul 27, 2023
1 parent 5a4f041 commit a1c4ebf
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/cpp_api/src/RuleBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,8 @@ void RuleBuilder_named_rule() {
flecs::entity qe = q.entity();
test_assert(qe != 0);
test_str(qe.name(), "my_query");

q.destruct();
}

void RuleBuilder_named_scoped_rule() {
Expand All @@ -696,6 +698,8 @@ void RuleBuilder_named_scoped_rule() {
test_assert(qe != 0);
test_str(qe.name(), "query");
test_str(qe.path(), "::my::query");

q.destruct();
}

void RuleBuilder_is_valid() {
Expand All @@ -707,6 +711,8 @@ void RuleBuilder_is_valid() {
flecs::log::set_level(-4);
auto q_2 = ecs.rule_builder().expr("foo").build();
test_assert(!q_2.is_valid());

q_1.destruct();
}

void RuleBuilder_unresolved_by_name() {
Expand All @@ -724,6 +730,8 @@ void RuleBuilder_unresolved_by_name() {
ecs.entity("Foo");

test_true(q.iter().is_true());

q.destruct();
}

void RuleBuilder_scope() {
Expand Down Expand Up @@ -764,4 +772,6 @@ void RuleBuilder_scope() {
});

test_int(count, 3);

r.destruct();
}

0 comments on commit a1c4ebf

Please sign in to comment.