diff graal/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/ChildrenNodesTest.java @ 14628:a08b8694f556

Truffle: Node API changes deprecate adoptChild, no longer needed in constructor add Node#insert for inserting new nodes into the tree (previously adoptChild) add Node#adoptChildren() helper method that adopts all (direct and indirect) children of a node, automatically called in TruffleRuntime#createCallTarget
author Andreas Woess <andreas.woess@jku.at>
date Wed, 19 Mar 2014 23:11:46 +0100
parents df1d665ca846
children 64dcb92ee75a
line wrap: on
line diff
--- a/graal/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/ChildrenNodesTest.java	Thu Mar 20 00:16:39 2014 +0100
+++ b/graal/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/ChildrenNodesTest.java	Wed Mar 19 23:11:46 2014 +0100
@@ -55,13 +55,13 @@
         TestChildNode firstChild = new TestChildNode();
         TestChildNode secondChild = new TestChildNode();
         TestRootNode rootNode = new TestRootNode(new TestChildNode[]{firstChild, secondChild});
+        CallTarget target = runtime.createCallTarget(rootNode);
         Assert.assertEquals(rootNode, firstChild.getParent());
         Assert.assertEquals(rootNode, secondChild.getParent());
         Iterator<Node> iterator = rootNode.getChildren().iterator();
         Assert.assertEquals(firstChild, iterator.next());
         Assert.assertEquals(secondChild, iterator.next());
         Assert.assertFalse(iterator.hasNext());
-        CallTarget target = runtime.createCallTarget(rootNode);
         Object result = target.call();
         Assert.assertEquals(42, result);
     }
@@ -72,7 +72,7 @@
 
         public TestRootNode(TestChildNode[] children) {
             super(null);
-            this.children = adoptChildren(children);
+            this.children = children;
         }
 
         @Override