Add missing test for SR-10177/SR-10217 workaround (#3092)

This commit is contained in:
SvyatoslavScherbina
2019-06-24 11:44:26 +03:00
committed by GitHub
parent 1c3afb4a54
commit 37745e4251
3 changed files with 17 additions and 0 deletions
@@ -566,6 +566,11 @@ __attribute__((swift_name("ForwardC1")))
- (ValuesForwardC2 *)getForwardC2 __attribute__((swift_name("getForwardC2()")));
@end;
__attribute__((swift_name("TestSR10177Workaround")))
@protocol ValuesTestSR10177Workaround
@required
@end;
@interface ValuesEnumeration (ValuesKt)
- (ValuesEnumeration *)getAnswer __attribute__((swift_name("getAnswer()")));
@end;
@@ -449,3 +449,5 @@ abstract class ForwardC2 : ForwardC1()
abstract class ForwardC1 {
abstract fun getForwardC2(): ForwardC2
}
interface TestSR10177Workaround
@@ -604,6 +604,15 @@ func testKClass() throws {
try assertTrue(test.getKotlinClass(protocol: NSObjectProtocol.self) == nil)
}
open class TestSR10177WorkaroundBase<T> {}
class TestSR10177WorkaroundDerived : TestSR10177WorkaroundBase<TestSR10177Workaround> {}
// See https://bugs.swift.org/browse/SR-10177 and https://bugs.swift.org/browse/SR-10217
func testSR10177Workaround() throws {
let test = TestSR10177WorkaroundDerived()
try assertTrue(String(describing: test).contains("TestSR10177WorkaroundDerived"))
}
// See https://github.com/JetBrains/kotlin-native/issues/2931
func testGH2931() throws {
for i in 0..<50000 {
@@ -668,6 +677,7 @@ class ValuesTests : TestProvider {
TestCase(name: "TestGH2830", method: withAutorelease(testGH2830)),
TestCase(name: "TestGH2959", method: withAutorelease(testGH2959)),
TestCase(name: "TestKClass", method: withAutorelease(testKClass)),
TestCase(name: "TestSR10177Workaround", method: withAutorelease(testSR10177Workaround)),
TestCase(name: "TestGH2931", method: withAutorelease(testGH2931)),
]
}