aboutsummaryrefslogtreecommitdiff
path: root/zencore/refcount.cpp
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2021-09-29 13:30:36 +0200
committerStefan Boberg <[email protected]>2021-09-29 13:30:36 +0200
commit6bbea2f29d349b64b840a8345d9c189ec08c76f8 (patch)
tree9d56d62eab9d2543a8c81c252fa842fc3e0c03af /zencore/refcount.cpp
parentstring: Fixed some clang warnings (diff)
parentRemoving deprecated RefPtr+stack based objects tests (diff)
downloadzen-6bbea2f29d349b64b840a8345d9c189ec08c76f8.tar.xz
zen-6bbea2f29d349b64b840a8345d9c189ec08c76f8.zip
Merge branch 'main' of https://github.com/EpicGames/zen
Diffstat (limited to 'zencore/refcount.cpp')
-rw-r--r--zencore/refcount.cpp36
1 files changed, 0 insertions, 36 deletions
diff --git a/zencore/refcount.cpp b/zencore/refcount.cpp
index 33b530b90..c6c47b04d 100644
--- a/zencore/refcount.cpp
+++ b/zencore/refcount.cpp
@@ -60,42 +60,6 @@ TEST_CASE("RefPtr")
CHECK(IsDestroyed == true);
}
-TEST_CASE("RefPtr on Stack allocated object")
-{
- bool IsDestroyed = false;
-
- {
- TestRefClass StackRefClass;
-
- StackRefClass.OnDestroy = [&] { IsDestroyed = true; };
-
- CHECK(StackRefClass.RefCount() == 1); // Stack allocated objects should have +1 ref
-
- RefPtr<TestRefClass> Ref{&StackRefClass};
-
- CHECK(IsDestroyed == false);
- CHECK(StackRefClass.RefCount() == 2);
-
- RefPtr<TestRefClass> Ref2;
- Ref2 = Ref;
-
- CHECK(IsDestroyed == false);
- CHECK(StackRefClass.RefCount() == 3);
-
- RefPtr<TestRefClass> Ref3;
- Ref2 = Ref3;
-
- CHECK(IsDestroyed == false);
- CHECK(StackRefClass.RefCount() == 2);
-
- Ref = Ref3;
- CHECK(IsDestroyed == false);
- CHECK(StackRefClass.RefCount() == 1);
- }
-
- CHECK(IsDestroyed == true);
-}
-
#endif
} // namespace zen