Fix codegen & bytecode tests after unifying exceptions in JVM backend
See KT-22275 for details
This commit is contained in:
+4
-4
@@ -1,15 +1,15 @@
|
||||
// KOTLIN_CONFIGURATION_FLAGS: +JVM.DISABLE_PARAM_ASSERTIONS
|
||||
// FILE: callAssertions.kt
|
||||
|
||||
class AssertionChecker(val illegalStateExpected: Boolean) {
|
||||
class AssertionChecker(val nullPointerExceptionExpected: Boolean) {
|
||||
operator fun invoke(name: String, f: () -> Any) {
|
||||
try {
|
||||
f()
|
||||
} catch (e: IllegalStateException) {
|
||||
if (!illegalStateExpected) throw AssertionError("Unexpected IllegalStateException on calling $name")
|
||||
} catch (e: NullPointerException) {
|
||||
if (!nullPointerExceptionExpected) throw AssertionError("Unexpected NullPointerException on calling $name")
|
||||
return
|
||||
}
|
||||
if (illegalStateExpected) throw AssertionError("IllegalStateException expected on calling $name")
|
||||
if (nullPointerExceptionExpected) throw AssertionError("NullPointerException expected on calling $name")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user