diff options
| author | Stefan Boberg <[email protected]> | 2021-09-29 00:51:43 +0200 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2021-09-29 00:51:43 +0200 |
| commit | d2be1587a76990add69f6ad6bd7a8339138a1e26 (patch) | |
| tree | 343f00ef7ea5854be0dd0551c82a8f9ce2fb5407 /zencore/refcount.cpp | |
| parent | Switch back to the right HTTP back-end (diff) | |
| download | zen-d2be1587a76990add69f6ad6bd7a8339138a1e26.tar.xz zen-d2be1587a76990add69f6ad6bd7a8339138a1e26.zip | |
Removing deprecated RefPtr+stack based objects tests
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 |