mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 00:21:26 +00:00
This patch mutes the following test categories:
* Tests with java dependencies (System class,
java stdlib, jvm-oriented annotations etc).
* Coroutines tests.
* Reflection tests.
* Tests with an inheritance from the standard
collections.
35 lines
1.1 KiB
Kotlin
Vendored
35 lines
1.1 KiB
Kotlin
Vendored
// TODO: muted automatically, investigate should it be ran for JS or not
|
|
// IGNORE_BACKEND: JS, NATIVE
|
|
|
|
// WITH_RUNTIME
|
|
// FULL_JDK
|
|
|
|
import java.lang.reflect.Modifier
|
|
import kotlin.reflect.KProperty
|
|
|
|
class CustomDelegate {
|
|
operator fun getValue(thisRef: Any?, prop: KProperty<*>): String = prop.name
|
|
}
|
|
|
|
class C {
|
|
@Volatile var vol = 1
|
|
@Transient val tra = 1
|
|
@delegate:Transient val del: String by CustomDelegate()
|
|
|
|
@Strictfp fun str() {}
|
|
@Synchronized fun sync() {}
|
|
}
|
|
|
|
fun box(): String {
|
|
val c = C::class.java
|
|
|
|
if (c.getDeclaredField("vol").getModifiers() and Modifier.VOLATILE == 0) return "Fail: volatile"
|
|
if (c.getDeclaredField("tra").getModifiers() and Modifier.TRANSIENT == 0) return "Fail: transient"
|
|
if (c.getDeclaredField("del\$delegate").getModifiers() and Modifier.TRANSIENT == 0) return "Fail: delegate transient"
|
|
|
|
if (c.getDeclaredMethod("str").getModifiers() and Modifier.STRICT == 0) return "Fail: strict"
|
|
if (c.getDeclaredMethod("sync").getModifiers() and Modifier.SYNCHRONIZED == 0) return "Fail: synchronized"
|
|
|
|
return "OK"
|
|
}
|