aboutsummaryrefslogtreecommitdiff
path: root/zencore/refcount.cpp
diff options
context:
space:
mode:
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