From de0e439313d28e931f38ae167fb22566e9bd86de Mon Sep 17 00:00:00 2001 From: Silas Della Contrada Date: Sat, 10 Aug 2024 22:22:23 +0200 Subject: [PATCH] fix(test): check refcount > 0 in Base64Buffer --- src/test/kotlin/dev/silenium/libs/flows/test/Base64Buffer.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/test/kotlin/dev/silenium/libs/flows/test/Base64Buffer.kt b/src/test/kotlin/dev/silenium/libs/flows/test/Base64Buffer.kt index 4bbd21c..88faf63 100644 --- a/src/test/kotlin/dev/silenium/libs/flows/test/Base64Buffer.kt +++ b/src/test/kotlin/dev/silenium/libs/flows/test/Base64Buffer.kt @@ -35,6 +35,7 @@ class Base64Buffer : Reference { override fun close() { println("Decrementing buffer ref count") + check(refCount_.get() > 0L) { "Ref count is already 0" } if (refCount_.decrementAndGet() == 0L) { println("Closing buffer") buffer.clear()