public static void testDriver(int length) {
    BankAccount b = new BankAccount(0);
    for (int i = 0; i < length; i++) {
      Verify.beginAtomic();

      // switch (Verify.random(1)){
      switch (flag(true)) {
        case 0:
          b.deposit(10);
          break;
        case 1:
          b.withdraw(1);
          break;
      }
      Verify.endAtomic();
    }
  }
Ejemplo n.º 2
0
 public static void testDriver(int length) {
   Stack s = new Stack();
   System.out.println("before loop");
   for (int i = 0; i < length; i++) {
     Verify.beginAtomic();
     switch (Verify.random(1)) {
       case 0:
         System.out.println(i + "0");
         s.push(0);
         break;
       case 1:
         System.out.println(i + "1");
         s.pop(0);
         break;
     }
     Verify.endAtomic();
     // Verify.ignoreIf(Debug.matchAbstractState(s));
   }
 }
Ejemplo n.º 3
0
  public static void testDriver(int length) {
    BST t = new BST();

    for (int i = 0; i < length; i++) {
      Verify.beginAtomic();
      switch (Verify.random(1)) {
        case 0:
          System.out.println("adding...");
          t.add(0);
          break;
        case 1:
          System.out.println("removing...");
          t.remove(0);
          break;
        case 2:
          System.out.println("finding...");
          t.find(0);
          break;
      }
      Verify.endAtomic();

      Verify.ignoreIf(Subsumption.storeAndCheckSubsumption());
    }
  }