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()