Tests: minor, add box test for KT-31367/KT-61805

For some reason, codegen box test was not added in 082c337faa. The main
point of it now is to check that everything works correctly in the
IrFakeOverrideBuilder mode.
This commit is contained in:
Alexander Udalov
2024-01-16 18:09:27 +01:00
committed by Space Team
parent 15094eb03a
commit 35caae355d
11 changed files with 91 additions and 0 deletions
@@ -31054,6 +31054,12 @@ public class LLFirBlackBoxCodegenBasedTestGenerated extends AbstractLLFirBlackBo
runTest("compiler/testData/codegen/box/javaInterop/inheritanceWithWildcard.kt");
}
@Test
@TestMetadata("javaForKotlinOverrideProperty.kt")
public void testJavaForKotlinOverrideProperty() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/javaForKotlinOverrideProperty.kt");
}
@Test
@TestMetadata("javaInterfaceFieldDirectAccess.kt")
public void testJavaInterfaceFieldDirectAccess() throws Exception {
@@ -31054,6 +31054,12 @@ public class LLFirReversedBlackBoxCodegenBasedTestGenerated extends AbstractLLFi
runTest("compiler/testData/codegen/box/javaInterop/inheritanceWithWildcard.kt");
}
@Test
@TestMetadata("javaForKotlinOverrideProperty.kt")
public void testJavaForKotlinOverrideProperty() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/javaForKotlinOverrideProperty.kt");
}
@Test
@TestMetadata("javaInterfaceFieldDirectAccess.kt")
public void testJavaInterfaceFieldDirectAccess() throws Exception {
@@ -30703,6 +30703,12 @@ public class FirLightTreeBlackBoxCodegenTestGenerated extends AbstractFirLightTr
runTest("compiler/testData/codegen/box/javaInterop/inheritanceWithWildcard.kt");
}
@Test
@TestMetadata("javaForKotlinOverrideProperty.kt")
public void testJavaForKotlinOverrideProperty() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/javaForKotlinOverrideProperty.kt");
}
@Test
@TestMetadata("javaInterfaceFieldDirectAccess.kt")
public void testJavaInterfaceFieldDirectAccess() throws Exception {
@@ -30703,6 +30703,12 @@ public class FirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTestGenerated
runTest("compiler/testData/codegen/box/javaInterop/inheritanceWithWildcard.kt");
}
@Test
@TestMetadata("javaForKotlinOverrideProperty.kt")
public void testJavaForKotlinOverrideProperty() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/javaForKotlinOverrideProperty.kt");
}
@Test
@TestMetadata("javaInterfaceFieldDirectAccess.kt")
public void testJavaInterfaceFieldDirectAccess() throws Exception {
@@ -30703,6 +30703,12 @@ public class FirPsiBlackBoxCodegenTestGenerated extends AbstractFirPsiBlackBoxCo
runTest("compiler/testData/codegen/box/javaInterop/inheritanceWithWildcard.kt");
}
@Test
@TestMetadata("javaForKotlinOverrideProperty.kt")
public void testJavaForKotlinOverrideProperty() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/javaForKotlinOverrideProperty.kt");
}
@Test
@TestMetadata("javaInterfaceFieldDirectAccess.kt")
public void testJavaInterfaceFieldDirectAccess() throws Exception {
@@ -0,0 +1,32 @@
// TARGET_BACKEND: JVM
// FILE: A.java
public abstract class A {
public String getValue() {
return "A";
}
}
// FILE: I.kt
interface I {
val value: String?
}
// FILE: B.java
public class B extends A implements I {}
// FILE: C.kt
class C : B(), I
fun box(): String {
val c = C()
if (c.value != "A") return "Fail C"
if ((c as B).value != "A") return "Fail B"
if ((c as I).value != "A") return "Fail I"
if ((c as A).value != "A") return "Fail A value"
if ((c as A).getValue() != "A") return "Fail A getValue"
return "OK"
}
@@ -30703,6 +30703,12 @@ public class JvmAbiConsistencyTestBoxGenerated extends AbstractJvmAbiConsistency
runTest("compiler/testData/codegen/box/javaInterop/inheritanceWithWildcard.kt");
}
@Test
@TestMetadata("javaForKotlinOverrideProperty.kt")
public void testJavaForKotlinOverrideProperty() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/javaForKotlinOverrideProperty.kt");
}
@Test
@TestMetadata("javaInterfaceFieldDirectAccess.kt")
public void testJavaInterfaceFieldDirectAccess() throws Exception {
@@ -28993,6 +28993,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
runTest("compiler/testData/codegen/box/javaInterop/inheritanceWithWildcard.kt");
}
@Test
@TestMetadata("javaForKotlinOverrideProperty.kt")
public void testJavaForKotlinOverrideProperty() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/javaForKotlinOverrideProperty.kt");
}
@Test
@TestMetadata("javaOuterClassDependsOnInner.kt")
public void testJavaOuterClassDependsOnInner() throws Exception {
@@ -30703,6 +30703,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
runTest("compiler/testData/codegen/box/javaInterop/inheritanceWithWildcard.kt");
}
@Test
@TestMetadata("javaForKotlinOverrideProperty.kt")
public void testJavaForKotlinOverrideProperty() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/javaForKotlinOverrideProperty.kt");
}
@Test
@TestMetadata("javaInterfaceFieldDirectAccess.kt")
public void testJavaInterfaceFieldDirectAccess() throws Exception {
@@ -30703,6 +30703,12 @@ public class IrBlackBoxCodegenWithIrInlinerTestGenerated extends AbstractIrBlack
runTest("compiler/testData/codegen/box/javaInterop/inheritanceWithWildcard.kt");
}
@Test
@TestMetadata("javaForKotlinOverrideProperty.kt")
public void testJavaForKotlinOverrideProperty() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/javaForKotlinOverrideProperty.kt");
}
@Test
@TestMetadata("javaInterfaceFieldDirectAccess.kt")
public void testJavaInterfaceFieldDirectAccess() throws Exception {
@@ -26003,6 +26003,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
runTest("compiler/testData/codegen/box/javaInterop/inheritanceWithWildcard.kt");
}
@TestMetadata("javaForKotlinOverrideProperty.kt")
public void testJavaForKotlinOverrideProperty() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/javaForKotlinOverrideProperty.kt");
}
@TestMetadata("javaInterfaceFieldDirectAccess.kt")
public void testJavaInterfaceFieldDirectAccess() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/javaInterfaceFieldDirectAccess.kt");