Exemple #1
0
 @Override
 public void run() {
   // while(true){
   int time = 0;
   while (currentPosition != goal) {
     if (emergencySpeed) {
       if (goal > currentPosition) {
         currentPosition = currentPosition + 10; // (goal-currentPosition)*1/2;
       } else {
         currentPosition = currentPosition - 10;
       }
     } else {
       if (goal > currentPosition) {
         currentPosition = currentPosition + 1; // (goal-currentPosition)*1/2;
       } else {
         currentPosition = currentPosition - 1;
       }
     }
     time++;
     if (time > 1) {
       Debug.printPC("\n Path Condition: ");
       assert false;
     }
   }
   currentPosition = 1 * currentPosition;
   // }
 }
Exemple #2
0
  public static void main(String[] args) {
    String a = "aaa";
    String b = "bbb";
    test(a, b);
    Debug.printPC("This is the PC at the end:");
    // a=a.concat(b);

  }
Exemple #3
0
  // The method whose parameters are marked as symbolic.
  private static void imposePreconditions(int x, int y) {
    MyClass1 mc = new MyClass1();

    // The preconditions
    if (-100 <= x && x <= 100 && 1 <= y && y <= 3) {
      mc.myMethod(x, y);
      Debug.printPC("\nMyClass1.myMethod Path Condition: ");
    }
  }
 public static void main(String[] args) {
   testDriver(3);
   Debug.printPC("Path Condition: ");
   System.out.println();
 }