prln("End countOlc");
}
private void testFlagAB(IsolatedInDock inDock) {
-
+ prln("Begin testFlagAB");
+ adjustIndent(2);
+
+ Instruction.Set.FlagFunction zero = Instruction.Set.FlagFunction.ZERO;
+ Instruction.Set.FlagFunction one = zero;
+
+ // we should be able to use any pair of FlagX+NotFlagX,
+ // but we toss them all in to maximize the chances of the
+ // test passing (later we will try the individual
+ // combinations to maximize the chances of failure).
+ one = one.add(Predicate.FlagA);
+ one = one.add(Predicate.NotFlagA);
+ one = one.add(Predicate.FlagB);
+ one = one.add(Predicate.NotFlagB);
+ one = one.add(Predicate.FlagC);
+ one = one.add(Predicate.NotFlagC);
+
+ // clear the flags to a known state, then check both 0->1 and 1->0 transitions
+ for(boolean b : new boolean[] { false, true, false }) {
+ prln((b?"Setting":"Clearing")+" flags");
+
+ inDock.instrIn.fill(new
+ Instruction.Set(DOCK,false,Predicate.IgnoreOLC,
+ b ? one : zero,
+ b ? one : zero
+ ));
+ fatal(inDock.getFlagA(), "after "+(b?"setting":"clearing")+" FlagA, it was still "+(b?"clear":"set"));
+ fatal(inDock.getFlagB(), "after "+(b?"setting":"clearing")+" FlagB, it was still "+(b?"clear":"set"));
+ }
+
+ adjustIndent(-2);
+ prln("End testFlagAB");
}
private void doOneTest(int testNum) {
prln("MarinaTest: performing test: "+testNum);
// Bill's tests begin with 2000
case 2000: break;
-
+
+ // Adam's tests begin with 3000
+ case 3000: sendToken((IsolatedInDock)design); break;
+ case 3001: testFlagAB((IsolatedInDock)design); break;
+
default:
fatal(true, "Test number: "+testNum+" doesn't exist.");
break;