Minor. Use more granular assertion levels in assertion tests

This commit is contained in:
Ilmir Usmanov
2018-08-06 17:11:32 +03:00
parent 1a1bb53381
commit b4189d9e85
18 changed files with 74 additions and 46 deletions
@@ -4,6 +4,8 @@
// KOTLIN_CONFIGURATION_FLAGS: ASSERTIONS_MODE=jvm
// WITH_RUNTIME
package superClassInitializer
interface Checker {
fun checkTrue(): Boolean
fun checkFalse(): Boolean
@@ -91,8 +93,8 @@ class ShouldBeEnabled : Checker {
fun setDesiredAssertionStatus(v: Boolean): Checker {
val loader = Checker::class.java.classLoader
loader.setDefaultAssertionStatus(v)
val c = loader.loadClass(if (v) "ShouldBeEnabled" else "ShouldBeDisabled")
loader.setPackageAssertionStatus("superClassInitializer", v)
val c = loader.loadClass(if (v) "superClassInitializer.ShouldBeEnabled" else "superClassInitializer.ShouldBeDisabled")
return c.newInstance() as Checker
}