Skip to content

Commit

Permalink
Move before up to the top to improve readability.
Browse files Browse the repository at this point in the history
  • Loading branch information
chumer committed Oct 28, 2019
1 parent 3a00009 commit 33cb544
Showing 1 changed file with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,17 @@

public class CompilerInitializationTest {

@Before
public void resetCompiler() {
Assume.assumeFalse("This test does not apply to SVM runtime where the compiler is initialized eagerly.", TruffleOptions.AOT);
try {
Field f = compilerField();
f.set(Truffle.getRuntime(), null);
} catch (Exception e) {
throw new AssertionError(e);
}
}

@Test
public void testDefault() throws Exception {
assertTruffleCompilerInitialized(false);
Expand Down Expand Up @@ -84,17 +95,6 @@ public static void assertTruffleCompilerInitialized(boolean expected) throws Exc
}
}

@Before
public void resetCompiler() {
Assume.assumeFalse("This test does not apply to SVM runtime where the compiler is initialized eagerly.", TruffleOptions.AOT);
try {
Field f = compilerField();
f.set(Truffle.getRuntime(), null);
} catch (Exception e) {
throw new AssertionError(e);
}
}

private static Field compilerField() throws NoSuchFieldException {
Field f = GraalTruffleRuntime.class.getDeclaredField("truffleCompiler");
ReflectionUtils.setAccessible(f, true);
Expand Down

0 comments on commit 33cb544

Please sign in to comment.