Mercurial > hg > graal-jvmci-8
comparison graal/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/ExecuteEvaluatedTest.java @ 18761:a665483c3881
Truffle-DSL: new node layout implementation.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Mon, 29 Dec 2014 23:38:54 +0100 |
parents | 64dcb92ee75a |
children | c0fb70634640 |
comparison
equal
deleted
inserted
replaced
18760:6fa3999631d8 | 18761:a665483c3881 |
---|---|
159 public void test1VarArgs1() { | 159 public void test1VarArgs1() { |
160 TestRootNode<TestEvaluatedVarArgs1> root = TestHelper.createRoot(TestEvaluatedVarArgs1Factory.getInstance()); | 160 TestRootNode<TestEvaluatedVarArgs1> root = TestHelper.createRoot(TestEvaluatedVarArgs1Factory.getInstance()); |
161 Assert.assertEquals(42, root.getNode().execute1(null, 42)); | 161 Assert.assertEquals(42, root.getNode().execute1(null, 42)); |
162 } | 162 } |
163 | 163 |
164 @Test(expected = AssertionError.class) | 164 @Test(expected = Throwable.class) |
165 public void test1VarArgs2() { | 165 public void test1VarArgs2() { |
166 TestRootNode<TestEvaluatedVarArgs2> root = TestHelper.createRoot(TestEvaluatedVarArgs2Factory.getInstance()); | 166 TestRootNode<TestEvaluatedVarArgs2> root = TestHelper.createRoot(TestEvaluatedVarArgs2Factory.getInstance()); |
167 Assert.assertEquals(-1, root.getNode().execute1(null)); | 167 root.getNode().execute1(null); |
168 } | 168 } |
169 | 169 |
170 abstract static class TestEvaluatedVarArgs1 extends ChildrenNode { | 170 abstract static class TestEvaluatedVarArgs1 extends ChildrenNode { |
171 | 171 |
172 public abstract Object execute1(VirtualFrame frame, Object... value); | 172 public abstract Object execute1(VirtualFrame frame, Object... value); |
181 public void test2VarArgs1() { | 181 public void test2VarArgs1() { |
182 TestRootNode<TestEvaluatedVarArgs2> root = TestHelper.createRoot(TestEvaluatedVarArgs2Factory.getInstance()); | 182 TestRootNode<TestEvaluatedVarArgs2> root = TestHelper.createRoot(TestEvaluatedVarArgs2Factory.getInstance()); |
183 Assert.assertEquals(42, root.getNode().execute1(null, 21, 21)); | 183 Assert.assertEquals(42, root.getNode().execute1(null, 21, 21)); |
184 } | 184 } |
185 | 185 |
186 @Test(expected = AssertionError.class) | 186 @Test(expected = Throwable.class) |
187 public void test2VarArgs2() { | 187 public void test2VarArgs2() { |
188 TestRootNode<TestEvaluatedVarArgs2> root = TestHelper.createRoot(TestEvaluatedVarArgs2Factory.getInstance()); | 188 TestRootNode<TestEvaluatedVarArgs2> root = TestHelper.createRoot(TestEvaluatedVarArgs2Factory.getInstance()); |
189 Assert.assertEquals(-1, root.getNode().execute1(null, 42)); | 189 root.getNode().execute1(null, 42); |
190 } | 190 } |
191 | 191 |
192 @Test(expected = AssertionError.class) | 192 @Test(expected = Throwable.class) |
193 public void test2VarArgs3() { | 193 public void test2VarArgs3() { |
194 TestRootNode<TestEvaluatedVarArgs2> root = TestHelper.createRoot(TestEvaluatedVarArgs2Factory.getInstance()); | 194 TestRootNode<TestEvaluatedVarArgs2> root = TestHelper.createRoot(TestEvaluatedVarArgs2Factory.getInstance()); |
195 Assert.assertEquals(-1, root.getNode().execute1(null)); | 195 root.getNode().execute1(null); |
196 } | 196 } |
197 | 197 |
198 abstract static class TestEvaluatedVarArgs2 extends ChildrenNode { | 198 abstract static class TestEvaluatedVarArgs2 extends ChildrenNode { |
199 | 199 |
200 public abstract Object execute1(VirtualFrame frame, Object... value); | 200 public abstract Object execute1(VirtualFrame frame, Object... value); |