diff options
| author | Stefan Boberg <[email protected]> | 2021-09-29 13:30:36 +0200 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2021-09-29 13:30:36 +0200 |
| commit | 6bbea2f29d349b64b840a8345d9c189ec08c76f8 (patch) | |
| tree | 9d56d62eab9d2543a8c81c252fa842fc3e0c03af /zencore/refcount.cpp | |
| parent | string: Fixed some clang warnings (diff) | |
| parent | Removing deprecated RefPtr+stack based objects tests (diff) | |
| download | zen-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.cpp | 36 |
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 |