aboutsummaryrefslogtreecommitdiff
path: root/zencore/refcount.cpp
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2023-05-02 10:01:47 +0200
committerGitHub <[email protected]>2023-05-02 10:01:47 +0200
commit075d17f8ada47e990fe94606c3d21df409223465 (patch)
treee50549b766a2f3c354798a54ff73404217b4c9af /zencore/refcount.cpp
parentfix: bundle shouldn't append content zip to zen (diff)
downloadzen-075d17f8ada47e990fe94606c3d21df409223465.tar.xz
zen-075d17f8ada47e990fe94606c3d21df409223465.zip
moved source directories into `/src` (#264)
* moved source directories into `/src` * updated bundle.lua for new `src` path * moved some docs, icon * removed old test trees
Diffstat (limited to 'zencore/refcount.cpp')
-rw-r--r--zencore/refcount.cpp65
1 files changed, 0 insertions, 65 deletions
diff --git a/zencore/refcount.cpp b/zencore/refcount.cpp
deleted file mode 100644
index c6c47b04d..000000000
--- a/zencore/refcount.cpp
+++ /dev/null
@@ -1,65 +0,0 @@
-// Copyright Epic Games, Inc. All Rights Reserved.
-
-#include <zencore/refcount.h>
-
-#include <zencore/testing.h>
-
-#include <functional>
-
-namespace zen {
-
-//////////////////////////////////////////////////////////////////////////
-//
-// Testing related code follows...
-//
-
-#if ZEN_WITH_TESTS
-
-struct TestRefClass : public RefCounted
-{
- ~TestRefClass()
- {
- if (OnDestroy)
- OnDestroy();
- }
-
- using RefCounted::RefCount;
-
- std::function<void()> OnDestroy;
-};
-
-void
-refcount_forcelink()
-{
-}
-
-TEST_CASE("RefPtr")
-{
- RefPtr<TestRefClass> Ref;
- Ref = new TestRefClass;
-
- bool IsDestroyed = false;
- Ref->OnDestroy = [&] { IsDestroyed = true; };
-
- CHECK(IsDestroyed == false);
- CHECK(Ref->RefCount() == 1);
-
- RefPtr<TestRefClass> Ref2;
- Ref2 = Ref;
-
- CHECK(IsDestroyed == false);
- CHECK(Ref->RefCount() == 2);
-
- RefPtr<TestRefClass> Ref3;
- Ref2 = Ref3;
-
- CHECK(IsDestroyed == false);
- CHECK(Ref->RefCount() == 1);
- Ref = Ref3;
-
- CHECK(IsDestroyed == true);
-}
-
-#endif
-
-} // namespace zen