check the token fifo for emptiness before sendToken() test
authorAdam Megacz <adam.megacz@sun.com>
Mon, 23 Mar 2009 00:49:44 +0000 (00:49 +0000)
committerAdam Megacz <adam.megacz@sun.com>
Mon, 23 Mar 2009 00:49:44 +0000 (00:49 +0000)
testCode/com/sun/vlsi/chips/marina/test/MarinaTest.java

index b669813..871d891 100644 (file)
@@ -479,10 +479,13 @@ public class MarinaTest {
         
         //getCtrsFlags(marina);
         
+        int nbToks = marina.getNumTokens();
+        fatal(nbToks!=0, "Expected no tokens on initialization but got: "+nbToks+" tokens");
+
         prln("send token");
         marina.instrIn.fill(
                             new Instruction.Move(DOCK,
-                                                 Predicate.IgnoreFlagD,   /* predicate   */
+                                                 Predicate.IgnoreFlagD, /* predicate   */
                                                  false,                 /* torpedoable */
                                                  null,                  /* path        */
                                                  false,                 /* tokenIn     */
@@ -495,7 +498,7 @@ public class MarinaTest {
         
         //getCtrsFlags(marina);
         
-        int nbToks = marina.getNumTokens();
+        nbToks = marina.getNumTokens();
         fatal(nbToks!=1, "Expected one token to emerge but got: "+nbToks+" tokens");
         
         adjustIndent(-2);
@@ -1270,7 +1273,7 @@ public class MarinaTest {
 
         marina.instrIn.fill(new Instruction.Set(DOCK,Predicate.IgnoreFlagD, CLEAR_FLAG, CLEAR_FLAG));
         marina.instrIn.fill(new Instruction.Move(DOCK,
-                                                 Predicate.IgnoreFlagD,   /* predicate   */
+                                                 Predicate.IgnoreFlagD, /* predicate   */
                                                  true,                  /* torpedoable */
                                                  null,                  /* path        */
                                                  false,                 /* tokenIn     */