From d2be1587a76990add69f6ad6bd7a8339138a1e26 Mon Sep 17 00:00:00 2001 From: Stefan Boberg Date: Wed, 29 Sep 2021 00:51:43 +0200 Subject: Removing deprecated RefPtr+stack based objects tests --- zencore/refcount.cpp | 36 ------------------------------------ 1 file changed, 36 deletions(-) (limited to 'zencore/refcount.cpp') 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 Ref{&StackRefClass}; - - CHECK(IsDestroyed == false); - CHECK(StackRefClass.RefCount() == 2); - - RefPtr Ref2; - Ref2 = Ref; - - CHECK(IsDestroyed == false); - CHECK(StackRefClass.RefCount() == 3); - - RefPtr 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 -- cgit v1.2.3