From 1991fdbc29ffc6fe506569b34913306e650593a4 Mon Sep 17 00:00:00 2001 From: Jaremy Creechley Date: Wed, 13 Sep 2023 12:02:25 -0700 Subject: [PATCH] verify that multiple decr's afterwords work --- tests/datastore/testsharedptr.nim | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/datastore/testsharedptr.nim b/tests/datastore/testsharedptr.nim index c98cac3..c1be195 100644 --- a/tests/datastore/testsharedptr.nim +++ b/tests/datastore/testsharedptr.nim @@ -48,6 +48,10 @@ proc runDestroyOnReleaseTest() = finally: a.release() check intref[] == 0 + ## important a should be nil now! + ## to prevent future decr's from occuring + check a.isNil == true + a.decr() suite "Share buffer test": @@ -86,6 +90,11 @@ suite "Share buffer test": a.release() check intref[] == 0 + ## important a should be nil now! + ## to prevent future decr's from occuring + check a.isNil == true + a.decr() + test "test destroy release generic no proc": echo "\nintref setup:\n" let intref: ref int = new(ref int) @@ -96,4 +105,4 @@ suite "Share buffer test": check b[].val[] == 30 finally: b.release() - check intref[] == 0 \ No newline at end of file + check intref[] == 0