Rewrite codegen tests which check time in deterministic way

Delete one useless test

 #KT-7621 Fixed
This commit is contained in:
Alexander Udalov
2015-04-29 15:27:21 +03:00
parent 90cdb19324
commit c860f54461
4 changed files with 15 additions and 30 deletions
@@ -17,9 +17,7 @@
package org.jetbrains.kotlin.codegen;
import com.google.common.base.Function;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
import com.intellij.openapi.util.SystemInfo;
import kotlin.KotlinPackage;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -111,14 +109,6 @@ public class CodegenTestUtil {
return null;
}
public static void assertIsCurrentTime(long returnValue) {
long currentTime = System.currentTimeMillis();
long diff = Math.abs(returnValue - currentTime);
long toleratedDifference = SystemInfo.isWindows ? 15 : 1;
assertTrue("Difference with current time: " + diff + " (this test is a bad one: it may fail even if the generated code is correct)",
diff <= toleratedDifference);
}
@NotNull
public static File compileJava(@NotNull String filename, @NotNull String... additionalClasspath) {
return compileJava(Collections.singletonList(filename), additionalClasspath);