Reverted all changes related to renaming jdkHeaders to altHeaders.

This commit is contained in:
Evgeny Gerashchenko
2012-05-23 17:05:09 +04:00
parent 393a8a6742
commit ea36cf9fb0
38 changed files with 194 additions and 244 deletions
@@ -33,7 +33,7 @@ public class ControlStructuresTest extends CodegenTestCase {
}
public void testIf() throws Exception {
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
loadFile();
// System.out.println(generateToText());
@@ -43,7 +43,7 @@ public class ControlStructuresTest extends CodegenTestCase {
}
public void testSingleBranchIf() throws Exception {
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
loadFile();
// System.out.println(generateToText());
@@ -65,7 +65,7 @@ public class ControlStructuresTest extends CodegenTestCase {
}
private void factorialTest(final String name) throws IllegalAccessException, InvocationTargetException {
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
loadFile(name);
// System.out.println(generateToText());
@@ -75,7 +75,7 @@ public class ControlStructuresTest extends CodegenTestCase {
}
public void testContinue() throws Exception {
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
loadFile();
// System.out.println(generateToText());
final Method main = generateFunction();
@@ -84,7 +84,7 @@ public class ControlStructuresTest extends CodegenTestCase {
}
public void testIfNoElse() throws Exception {
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
loadFile();
// System.out.println(generateToText());
final Method main = generateFunction();
@@ -93,7 +93,7 @@ public class ControlStructuresTest extends CodegenTestCase {
}
public void testCondJumpOnStack() throws Exception {
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
loadText("import java.lang.Boolean as jlBoolean; fun foo(a: String): Int = if (jlBoolean.parseBoolean(a)) 5 else 10");
final Method main = generateFunction();
assertEquals(5, main.invoke(null, "true"));
@@ -101,7 +101,7 @@ public class ControlStructuresTest extends CodegenTestCase {
}
public void testFor() throws Exception {
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
loadFile();
// System.out.println(generateToText());
final Method main = generateFunction();
@@ -110,7 +110,7 @@ public class ControlStructuresTest extends CodegenTestCase {
}
public void testIfBlock() throws Exception {
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
loadFile();
// System.out.println(generateToText());
final Method main = generateFunction();
@@ -121,7 +121,7 @@ public class ControlStructuresTest extends CodegenTestCase {
}
public void testForInArray() throws Exception {
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
loadFile();
// System.out.println(generateToText());
final Method main = generateFunction();
@@ -130,7 +130,7 @@ public class ControlStructuresTest extends CodegenTestCase {
}
public void testForInRange() throws Exception {
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
loadText("fun foo(sb: StringBuilder) { for(x in 1..4) sb.append(x) }");
final Method main = generateFunction();
StringBuilder stringBuilder = new StringBuilder();
@@ -139,7 +139,7 @@ public class ControlStructuresTest extends CodegenTestCase {
}
public void testThrowCheckedException() throws Exception {
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
loadText("fun foo() { throw Exception(); }");
final Method main = generateFunction();
boolean caught = false;
@@ -154,7 +154,7 @@ public class ControlStructuresTest extends CodegenTestCase {
}
public void testTryCatch() throws Exception {
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
loadFile();
// System.out.println(generateToText());
final Method main = generateFunction();
@@ -163,7 +163,7 @@ public class ControlStructuresTest extends CodegenTestCase {
}
public void testTryFinally() throws Exception {
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
loadFile();
// System.out.println(generateToText());
final Method main = generateFunction();
@@ -183,37 +183,37 @@ public class ControlStructuresTest extends CodegenTestCase {
}
public void testForUserType() throws Exception {
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
blackBoxFile("controlStructures/forUserType.jet");
}
public void testForIntArray() throws Exception {
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
blackBoxFile("controlStructures/forIntArray.jet");
}
public void testForPrimitiveIntArray() throws Exception {
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
blackBoxFile("controlStructures/forPrimitiveIntArray.jet");
}
public void testForNullableIntArray() throws Exception {
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
blackBoxFile("controlStructures/forNullableIntArray.jet");
}
public void testForIntRange() {
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
blackBoxFile("controlStructures/forIntRange.jet");
}
public void testKt237() throws Exception {
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
blackBoxFile("regressions/kt237.jet");
}
public void testCompareToNull() throws Exception {
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
loadText("fun foo(a: String?, b: String?): Boolean = a == null && b !== null && null == a && null !== b");
String text = generateToText();
assertTrue(!text.contains("java/lang/Object.equals"));
@@ -224,7 +224,7 @@ public class ControlStructuresTest extends CodegenTestCase {
}
public void testCompareToNonnullableEq() throws Exception {
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
loadText("fun foo(a: String?, b: String): Boolean = a == b || b == a");
// System.out.println(generateToText());
final Method main = generateFunction();
@@ -233,7 +233,7 @@ public class ControlStructuresTest extends CodegenTestCase {
}
public void testCompareToNonnullableNotEq() throws Exception {
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
loadText("fun foo(a: String?, b: String): Boolean = a != b");
String text = generateToText();
// System.out.println(text);
@@ -244,18 +244,18 @@ public class ControlStructuresTest extends CodegenTestCase {
}
public void testKt299() throws Exception {
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
blackBoxFile("regressions/kt299.jet");
}
public void testKt416() throws Exception {
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
blackBoxFile("regressions/kt416.jet");
// System.out.println(generateToText());
}
public void testKt513() throws Exception {
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
blackBoxFile("regressions/kt513.jet");
}
@@ -265,37 +265,37 @@ public class ControlStructuresTest extends CodegenTestCase {
}
public void testKt769() throws Exception {
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
blackBoxFile("regressions/kt769.jet");
// System.out.println(generateToText());
}
public void testKt773() throws Exception {
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
blackBoxFile("regressions/kt773.jet");
// System.out.println(generateToText());
}
public void testKt772() throws Exception {
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
blackBoxFile("regressions/kt772.jet");
// System.out.println(generateToText());
}
public void testKt870() throws Exception {
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
blackBoxFile("regressions/kt870.jet");
// System.out.println(generateToText());
}
public void testKt958() throws Exception {
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
blackBoxFile("regressions/kt958.jet");
// System.out.println(generateToText());
}
public void testQuicksort() throws Exception {
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
blackBoxFile("controlStructures/quicksort.jet");
// System.out.println(generateToText());
}
@@ -313,22 +313,22 @@ public class ControlStructuresTest extends CodegenTestCase {
}
public void testKt1076() throws Exception {
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
blackBoxFile("regressions/kt1076.kt");
}
public void testKt998() throws Exception {
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
blackBoxFile("regressions/kt998.kt");
}
public void testKt628() throws Exception {
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
blackBoxFile("regressions/kt628.kt");
}
public void testKt1441() throws Exception {
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
blackBoxFile("regressions/kt1441.kt");
}
}