aboutsummaryrefslogtreecommitdiff
path: root/src/zencore/refcount.cpp
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2026-04-23 18:16:57 +0200
committerStefan Boberg <[email protected]>2026-04-23 18:16:57 +0200
commit0232b991cd7d8e3a2114ea30e4591dd3e7b65c36 (patch)
tree94730e7594fd09ae1fa820391ce311f6daf13905 /src/zencore/refcount.cpp
parentFix forward declaration order for s_GotSigWinch and SigWinchHandler (diff)
parenttrace: declare Region event name fields as AnsiString (#1012) (diff)
downloadarchived-zen-sb/zen-help.tar.xz
archived-zen-sb/zen-help.zip
Merge branch 'main' into sb/zen-helpsb/zen-help
- Combine HelpCommand (this branch) with HistoryCommand (main) in zen CLI dispatcher - Keep filter-aware TuiPickOne rewrite; adopt main's ASCII arrow glyphs in doc comment
Diffstat (limited to 'src/zencore/refcount.cpp')
-rw-r--r--src/zencore/refcount.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/zencore/refcount.cpp b/src/zencore/refcount.cpp
index f19afe715..674b154e0 100644
--- a/src/zencore/refcount.cpp
+++ b/src/zencore/refcount.cpp
@@ -35,29 +35,29 @@ refcount_forcelink()
TEST_SUITE_BEGIN("core.refcount");
-TEST_CASE("RefPtr")
+TEST_CASE("Ref")
{
- RefPtr<TestRefClass> Ref;
- Ref = new TestRefClass;
+ Ref<TestRefClass> RefA;
+ RefA = new TestRefClass;
bool IsDestroyed = false;
- Ref->OnDestroy = [&] { IsDestroyed = true; };
+ RefA->OnDestroy = [&] { IsDestroyed = true; };
CHECK(IsDestroyed == false);
- CHECK(Ref->RefCount() == 1);
+ CHECK(RefA->RefCount() == 1);
- RefPtr<TestRefClass> Ref2;
- Ref2 = Ref;
+ Ref<TestRefClass> RefB;
+ RefB = RefA;
CHECK(IsDestroyed == false);
- CHECK(Ref->RefCount() == 2);
+ CHECK(RefA->RefCount() == 2);
- RefPtr<TestRefClass> Ref3;
- Ref2 = Ref3;
+ Ref<TestRefClass> RefC;
+ RefB = RefC;
CHECK(IsDestroyed == false);
- CHECK(Ref->RefCount() == 1);
- Ref = Ref3;
+ CHECK(RefA->RefCount() == 1);
+ RefA = RefC;
CHECK(IsDestroyed == true);
}