Revert "enhance tests (mostly codegen)" temporarily

This reverts commit 95f9bcbacb.
This commit is contained in:
Stepan Koltsov
2012-05-01 21:21:46 +04:00
parent 035fd686e0
commit d71723131d
43 changed files with 44 additions and 379 deletions
@@ -16,8 +16,6 @@
package org.jetbrains.jet.codegen;
import org.jetbrains.jet.lang.resolve.java.CompilerSpecialMode;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
@@ -33,7 +31,6 @@ public class PropertyGenTest extends CodegenTestCase {
}
public void testPrivateVal() throws Exception {
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
loadFile();
final Class aClass = loadImplementationClass(generateClassesInFile(), "PrivateVal");
final Field[] fields = aClass.getDeclaredFields();
@@ -43,7 +40,6 @@ public class PropertyGenTest extends CodegenTestCase {
}
public void testPrivateVar() throws Exception {
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
loadFile();
final Class aClass = loadImplementationClass(generateClassesInFile(), "PrivateVar");
final Object instance = aClass.newInstance();
@@ -54,7 +50,6 @@ public class PropertyGenTest extends CodegenTestCase {
}
public void testPublicVar() throws Exception {
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
loadText("class PublicVar() { public var foo : Int = 0; }");
final Class aClass = loadImplementationClass(generateClassesInFile(), "PublicVar");
final Object instance = aClass.newInstance();
@@ -65,7 +60,6 @@ public class PropertyGenTest extends CodegenTestCase {
}
public void testAccessorsInInterface() {
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
loadText("class AccessorsInInterface() { public var foo : Int = 0; }");
final Class aClass = loadClass("AccessorsInInterface", generateClassesInFile());
assertNotNull(findMethodByName(aClass, "getFoo"));
@@ -73,7 +67,6 @@ public class PropertyGenTest extends CodegenTestCase {
}
public void testPrivatePropertyInNamespace() throws Exception {
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
loadText("private val x = 239");
final Class nsClass = generateNamespaceClass();
final Field[] fields = nsClass.getDeclaredFields();
@@ -86,7 +79,6 @@ public class PropertyGenTest extends CodegenTestCase {
}
public void testFieldPropertyAccess() throws Exception {
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
loadFile("properties/fieldPropertyAccess.jet");
// System.out.println(generateToText());
final Method method = generateFunction();
@@ -95,14 +87,12 @@ public class PropertyGenTest extends CodegenTestCase {
}
public void testFieldGetter() throws Exception {
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
loadText("val now: Long get() = System.currentTimeMillis(); fun foo() = now");
final Method method = generateFunction("foo");
assertIsCurrentTime((Long) method.invoke(null));
}
public void testFieldSetter() throws Exception {
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
loadFile();
final Method method = generateFunction("append");
method.invoke(null, "IntelliJ ");
@@ -114,7 +104,6 @@ public class PropertyGenTest extends CodegenTestCase {
}
public void testFieldSetterPlusEq() throws Exception {
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
loadFile();
final Method method = generateFunction("append");
method.invoke(null, "IntelliJ ");
@@ -123,7 +112,6 @@ public class PropertyGenTest extends CodegenTestCase {
}
public void testAccessorsWithoutBody() throws Exception {
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
loadText("class AccessorsWithoutBody() { protected var foo: Int = 349\n get\n private set\n fun setter() { foo = 610; } } ");
// System.out.println(generateToText());
final Class aClass = loadImplementationClass(generateClassesInFile(), "AccessorsWithoutBody");
@@ -141,7 +129,6 @@ public class PropertyGenTest extends CodegenTestCase {
}
public void testInitializersForNamespaceProperties() throws Exception {
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
loadText("val x = System.currentTimeMillis()");
final Method method = generateFunction("getX");
method.setAccessible(true);
@@ -149,7 +136,6 @@ public class PropertyGenTest extends CodegenTestCase {
}
public void testPropertyReceiverOnStack() throws Exception {
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
loadFile();
final Class aClass = loadImplementationClass(generateClassesInFile(), "Evaluator");
final Constructor constructor = aClass.getConstructor(StringBuilder.class);
@@ -161,7 +147,6 @@ public class PropertyGenTest extends CodegenTestCase {
}
public void testAbstractVal() throws Exception {
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
loadText("abstract class Foo { public abstract val x: String }");
final ClassFileFactory codegens = generateClassesInFile();
final Class aClass = loadClass("Foo", codegens);
@@ -169,7 +154,6 @@ public class PropertyGenTest extends CodegenTestCase {
}
public void testVolatileProperty() throws Exception {
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
loadText("abstract class Foo { public volatile var x: String = \"\"; }");
// System.out.println(generateToText());
final ClassFileFactory codegens = generateClassesInFile();
@@ -179,18 +163,15 @@ public class PropertyGenTest extends CodegenTestCase {
}
public void testKt257 () throws Exception {
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
blackBoxFile("regressions/kt257.jet");
// System.out.println(generateToText());
}
public void testKt613 () throws Exception {
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
blackBoxFile("regressions/kt613.jet");
}
public void testKt160() throws Exception {
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
loadText("internal val s = java.lang.Double.toString(1.0)");
final Method method = generateFunction("getS");
method.setAccessible(true);
@@ -198,12 +179,10 @@ public class PropertyGenTest extends CodegenTestCase {
}
public void testKt1165() throws Exception {
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
blackBoxFile("regressions/kt1165.kt");
}
public void testKt1168() throws Exception {
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
blackBoxFile("regressions/kt1168.kt");
}
@@ -213,17 +192,14 @@ public class PropertyGenTest extends CodegenTestCase {
}
public void testKt1159() throws Exception {
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
blackBoxFile("regressions/kt1159.kt");
}
public void testKt1417() throws Exception {
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
blackBoxFile("regressions/kt1417.kt");
}
public void testKt1398() throws Exception {
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
blackBoxFile("regressions/kt1398.kt");
}