Skip to content

Commit c391b08

Browse files
committed
test: refine to trigger a crash in case of double destruction
1 parent 5731e94 commit c391b08

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎test/entt/entity/storage.cpp‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ struct StorageBase: testing::Test {
2525
struct update_from_destructor {
2626
update_from_destructor(entt::basic_storage<update_from_destructor, my_entity> &ref, my_entity other)
2727
: storage{&ref},
28-
target{other} {}
28+
target{other} {
29+
}
2930

3031
update_from_destructor(const update_from_destructor &) = delete;
3132
update_from_destructor &operator=(const update_from_destructor &) = delete;
@@ -49,6 +50,10 @@ struct StorageBase: testing::Test {
4950
private:
5051
entt::basic_storage<update_from_destructor, my_entity> *storage{};
5152
my_entity target{entt::null};
53+
54+
private:
55+
// used to trigger an assertion failure in case of double destruction
56+
std::unordered_set<char> set{};
5257
};
5358

5459
struct create_from_constructor {

0 commit comments

Comments
 (0)