Mercurial > hg > truffle
comparison truffle/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/CachedTest.java @ 22272:5309cc9668e3
Cleanup DSL tests from instrumentation dependencies.
author | Christian Humer <christian.humer@oracle.com> |
---|---|
date | Thu, 01 Oct 2015 14:00:17 +0200 |
parents | 14e6dfb1ef05 |
children | dbbcd8eb5dae |
comparison
equal
deleted
inserted
replaced
22271:a13fef77ebd5 | 22272:5309cc9668e3 |
---|---|
25 import static com.oracle.truffle.api.dsl.test.TestHelper.assertionsEnabled; | 25 import static com.oracle.truffle.api.dsl.test.TestHelper.assertionsEnabled; |
26 import static com.oracle.truffle.api.dsl.test.TestHelper.createCallTarget; | 26 import static com.oracle.truffle.api.dsl.test.TestHelper.createCallTarget; |
27 import static org.junit.Assert.assertEquals; | 27 import static org.junit.Assert.assertEquals; |
28 import static org.junit.Assert.fail; | 28 import static org.junit.Assert.fail; |
29 | 29 |
30 import org.junit.After; | |
31 import org.junit.Before; | |
32 import org.junit.Test; | 30 import org.junit.Test; |
33 | 31 |
34 import com.oracle.truffle.api.CallTarget; | 32 import com.oracle.truffle.api.CallTarget; |
35 import com.oracle.truffle.api.dsl.Cached; | 33 import com.oracle.truffle.api.dsl.Cached; |
36 import com.oracle.truffle.api.dsl.NodeChild; | 34 import com.oracle.truffle.api.dsl.NodeChild; |
47 import com.oracle.truffle.api.dsl.test.CachedTestFactory.TestGuardWithCachedAndDynamicParameterFactory; | 45 import com.oracle.truffle.api.dsl.test.CachedTestFactory.TestGuardWithCachedAndDynamicParameterFactory; |
48 import com.oracle.truffle.api.dsl.test.CachedTestFactory.TestGuardWithJustCachedParameterFactory; | 46 import com.oracle.truffle.api.dsl.test.CachedTestFactory.TestGuardWithJustCachedParameterFactory; |
49 import com.oracle.truffle.api.dsl.test.CachedTestFactory.TestMultipleCachesFactory; | 47 import com.oracle.truffle.api.dsl.test.CachedTestFactory.TestMultipleCachesFactory; |
50 import com.oracle.truffle.api.dsl.test.CachedTestFactory.UnboundCacheFactory; | 48 import com.oracle.truffle.api.dsl.test.CachedTestFactory.UnboundCacheFactory; |
51 import com.oracle.truffle.api.dsl.test.TypeSystemTest.ValueNode; | 49 import com.oracle.truffle.api.dsl.test.TypeSystemTest.ValueNode; |
52 import com.oracle.truffle.api.dsl.test.utilities.InstrumentationTestMode; | |
53 | 50 |
54 @SuppressWarnings("unused") | 51 @SuppressWarnings("unused") |
55 public class CachedTest { | 52 public class CachedTest { |
56 | |
57 @Before | |
58 public void before() throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException { | |
59 InstrumentationTestMode.set(true); | |
60 } | |
61 | |
62 @After | |
63 public void after() throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException { | |
64 InstrumentationTestMode.set(false); | |
65 } | |
66 | 53 |
67 @Test | 54 @Test |
68 public void testUnboundCache() { | 55 public void testUnboundCache() { |
69 CallTarget root = createCallTarget(UnboundCacheFactory.getInstance()); | 56 CallTarget root = createCallTarget(UnboundCacheFactory.getInstance()); |
70 assertEquals(42, root.call(42)); | 57 assertEquals(42, root.call(42)); |