Fix codegen & bytecode tests after unifying exceptions in JVM backend

See KT-22275 for details
This commit is contained in:
Mikhail Zarechenskiy
2020-01-20 13:51:11 +03:00
parent 1ed7e33f42
commit 5c5635ce20
34 changed files with 55 additions and 55 deletions
@@ -30,7 +30,7 @@ fun box(): String {
try {
if (jClass.minus0().compareTo(jClass.null0()) != -2) return "fail 3"
return "fail: exception expected";
} catch (e: IllegalStateException) {
} catch (e: NullPointerException) {
}
+1 -1
View File
@@ -31,7 +31,7 @@ fun box(): String {
}
})
}.run()
} catch (e: IllegalArgumentException) {
} catch (e: NullPointerException) {
return "OK"
}
@@ -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")
}
}
@@ -15,7 +15,7 @@ fun box(): String {
DelegateFrom().foo()
return "Fail: should have been an exception"
}
catch(e: IllegalStateException) {
catch(e: NullPointerException) {
return "OK"
}
}
@@ -11,10 +11,10 @@ public abstract class C<Type> {
public static void runTest(C a) {
try {
a.doTest(null);
} catch (IllegalArgumentException e) {
} catch (NullPointerException e) {
return;
}
throw new AssertionError("Fail: IllegalArgumentException expected");
throw new AssertionError("Fail: NullPointerException expected");
}
}
@@ -19,13 +19,13 @@ fun box(): String {
foo(baz() ?: RightElvisOperand.foo())
return "Fail: should have been an exception in `foo(baz() ?: RightElvisOperand.foo())`"
}
catch(e: IllegalStateException) {}
catch(e: NullPointerException) {}
try {
bar()
return "Fail: should have been an exception in `bar()`"
}
catch(e: IllegalStateException) {
catch(e: NullPointerException) {
return "OK"
}
}
@@ -19,7 +19,7 @@ fun box(): String {
try {
test(JavaClass().test())
}
catch (e: IllegalStateException) {
catch (e: NullPointerException) {
return "OK"
}
return "fail"