From c6bc1f94741ca986e2ec1a538df8475825cb16ee Mon Sep 17 00:00:00 2001 From: Evgeniy Moiseenko Date: Wed, 8 May 2024 12:45:08 +0200 Subject: [PATCH] Ensure LincheckAssertionError is thrown under Lincheck java-agent Signed-off-by: Evgeniy Moiseenko --- src/jvm/main/org/jetbrains/kotlinx/lincheck/LinChecker.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/jvm/main/org/jetbrains/kotlinx/lincheck/LinChecker.kt b/src/jvm/main/org/jetbrains/kotlinx/lincheck/LinChecker.kt index e3911e4eb2..7b78954163 100644 --- a/src/jvm/main/org/jetbrains/kotlinx/lincheck/LinChecker.kt +++ b/src/jvm/main/org/jetbrains/kotlinx/lincheck/LinChecker.kt @@ -42,8 +42,9 @@ class LinChecker (private val testClass: Class<*>, options: Options<*, *>?) { * @throws LincheckAssertionError if the testing data structure is incorrect. */ fun check() { - val failure = checkImpl() ?: return - throw LincheckAssertionError(failure) + checkImpl { failure -> + if (failure != null) throw LincheckAssertionError(failure) + } } /**