Rewrite codegen tests which check time in deterministic way
Delete one useless test #KT-7621 Fixed
This commit is contained in:
@@ -23,7 +23,8 @@ import org.jetbrains.org.objectweb.asm.Opcodes;
|
||||
|
||||
import java.lang.reflect.*;
|
||||
|
||||
import static org.jetbrains.kotlin.codegen.CodegenTestUtil.*;
|
||||
import static org.jetbrains.kotlin.codegen.CodegenTestUtil.findDeclaredMethodByName;
|
||||
import static org.jetbrains.kotlin.codegen.CodegenTestUtil.findDeclaredMethodByNameOrNull;
|
||||
|
||||
public class PropertyGenTest extends CodegenTestCase {
|
||||
@Override
|
||||
@@ -90,9 +91,9 @@ public class PropertyGenTest extends CodegenTestCase {
|
||||
}
|
||||
|
||||
public void testFieldGetter() throws Exception {
|
||||
loadText("val now: Long get() = System.currentTimeMillis(); fun foo() = now");
|
||||
loadText("val now: Long get() = 42L; fun foo() = now");
|
||||
Method method = generateFunction("foo");
|
||||
assertIsCurrentTime((Long) method.invoke(null));
|
||||
assertEquals(Long.valueOf(42), method.invoke(null));
|
||||
}
|
||||
|
||||
public void testFieldSetter() throws Exception {
|
||||
@@ -131,13 +132,6 @@ public class PropertyGenTest extends CodegenTestCase {
|
||||
assertEquals(610, getFoo.invoke(instance));
|
||||
}
|
||||
|
||||
public void testInitializersForTopLevelProperties() throws Exception {
|
||||
loadText("val x = System.currentTimeMillis()");
|
||||
Method method = generateFunction("getX");
|
||||
method.setAccessible(true);
|
||||
assertIsCurrentTime((Long) method.invoke(null));
|
||||
}
|
||||
|
||||
public void testPropertyReceiverOnStack() throws Exception {
|
||||
loadFile();
|
||||
Class<?> aClass = generateClass("Evaluator");
|
||||
|
||||
Reference in New Issue
Block a user