Fixed external tests

Marked all mutable objects with konan.ThreadLocal annotation
This commit is contained in:
Igor Chevdar
2018-07-04 16:35:32 +03:00
parent cb916d017b
commit f4fef09447
22 changed files with 23 additions and 0 deletions
@@ -10,6 +10,7 @@ var A.w: Int
v = c + 10 v = c + 10
} }
@konan.ThreadLocal
object F { object F {
var u = 0 var u = 0
} }
@@ -2,6 +2,7 @@ import kotlin.reflect.KProperty
var result: String by Delegate var result: String by Delegate
@konan.ThreadLocal
object Delegate { object Delegate {
var value = "lol" var value = "lol"
@@ -6,6 +6,7 @@ class Outer {
} }
} }
@konan.ThreadLocal
companion object { companion object {
public var s = "fail" public var s = "fail"
private set private set
@@ -7,6 +7,7 @@ class Delegate<T>(var inner: T) {
class Foo (val f: Int) { class Foo (val f: Int) {
@konan.ThreadLocal
companion object { companion object {
val A: Foo by Delegate(Foo(11)) val A: Foo by Delegate(Foo(11))
var B: Foo by Delegate(Foo(11)) var B: Foo by Delegate(Foo(11))
@@ -14,6 +15,7 @@ class Foo (val f: Int) {
} }
interface FooTrait { interface FooTrait {
@konan.ThreadLocal
companion object { companion object {
val A: Foo by Delegate(Foo(11)) val A: Foo by Delegate(Foo(11))
var B: Foo by Delegate(Foo(11)) var B: Foo by Delegate(Foo(11))
@@ -1,3 +1,4 @@
@konan.ThreadLocal
object Test { object Test {
var z = "0" var z = "0"
var l = 0L var l = 0L
@@ -2,6 +2,7 @@
import kotlin.test.* import kotlin.test.*
@konan.ThreadLocal
object O { object O {
var equalsCalled: Boolean = false var equalsCalled: Boolean = false
get(): Boolean { get(): Boolean {
@@ -1,3 +1,4 @@
@konan.ThreadLocal
object A { object A {
var x = 0 var x = 0
@@ -18,6 +18,7 @@ open class BaseClass {
get() = this get() = this
} }
@konan.ThreadLocal
object C: BaseClass(), I<String> { object C: BaseClass(), I<String> {
fun f(s: Int) = 1 fun f(s: Int) = 1
fun f(s: String) = 2 fun f(s: String) = 2
@@ -19,6 +19,7 @@ open class BaseClass {
} }
class Class { class Class {
@konan.ThreadLocal
companion object C: BaseClass(), I<String> { companion object C: BaseClass(), I<String> {
fun f(s: Int) = 1 fun f(s: Int) = 1
fun f(s: String) = 2 fun f(s: String) = 2
@@ -1,5 +1,6 @@
// See KT-14999 // See KT-14999
@konan.ThreadLocal
object Obj { object Obj {
var key = "" var key = ""
var value = "" var value = ""
@@ -1,5 +1,6 @@
class Test { class Test {
@konan.ThreadLocal
companion object { companion object {
public val prop1 : Int = 10 public val prop1 : Int = 10
@@ -1,5 +1,6 @@
class TestObject() class TestObject()
{ {
@konan.ThreadLocal
companion object { companion object {
var prop: Int = 1 var prop: Int = 1
get() = field++ get() = field++
@@ -2,6 +2,7 @@ class CallbackBlock {}
public class Foo public class Foo
{ {
@konan.ThreadLocal
companion object { companion object {
private var bar = 0 private var bar = 0
} }
@@ -1,4 +1,5 @@
class Foo() { class Foo() {
@konan.ThreadLocal
companion object { companion object {
val bar = "OK"; val bar = "OK";
var boo = "FAIL"; var boo = "FAIL";
@@ -4,6 +4,7 @@ class D {
operator fun getValue(a: Any, p: KProperty<*>) { } operator fun getValue(a: Any, p: KProperty<*>) { }
} }
@konan.ThreadLocal
object P { object P {
val u = Unit val u = Unit
val v by D() val v by D()
@@ -2,6 +2,7 @@ class App {
fun init() { fun init() {
s = "OK" s = "OK"
} }
@konan.ThreadLocal
companion object { companion object {
var s: String = "Fail" var s: String = "Fail"
private set private set
@@ -8,6 +8,7 @@ public class A {
return str return str
} }
@konan.ThreadLocal
private companion object { private companion object {
private lateinit var str: String private lateinit var str: String
} }
@@ -14,6 +14,7 @@ class Foo {
} }
} }
@konan.ThreadLocal
object Bar { object Bar {
lateinit var p: String lateinit var p: String
@@ -4,6 +4,7 @@
import kotlin.reflect.KProperty import kotlin.reflect.KProperty
import kotlin.test.assertEquals import kotlin.test.assertEquals
@konan.ThreadLocal
object Delegate { object Delegate {
lateinit var prop: KProperty<*> lateinit var prop: KProperty<*>
@@ -1,4 +1,5 @@
class A { class A {
@konan.ThreadLocal
companion object { companion object {
private var r: Int = 1; private var r: Int = 1;
@@ -1,3 +1,4 @@
@konan.ThreadLocal
object A { object A {
private var r: Int = 1; private var r: Int = 1;
@@ -1,4 +1,5 @@
class C { class C {
@konan.ThreadLocal
companion object { companion object {
private val s: String private val s: String
private var s2: String private var s2: String