1 package gov.nasa.jpf.mc; 20 21 import gov.nasa.jpf.jvm.TestJPF; 22 import gov.nasa.jpf.jvm.Verify; 23 24 import junit.framework.TestSuite; 25 26 import junit.textui.TestRunner; 27 28 29 33 public class TestRandomJPF extends TestJPF { 34 static String testClass = "gov.nasa.jpf.mc.TestRandom"; 35 36 public TestRandomJPF (String name) { 37 super(name); 38 } 39 40 public static void main (String [] args) { 41 TestRunner.run(suite()); 42 } 43 44 public static TestSuite suite () { 45 return new TestSuite(TestRandomJPF.class); 46 } 47 48 49 public void testRandom () { 50 String [] args = { testClass, "testRandom", "3" }; 51 52 Verify.resetCounter(0); 53 54 runJPFnoException(args); 55 56 if (Verify.getCounter(0) != 4) { 57 fail("wrong number of backtracks"); 58 } 59 } 60 61 public void testRandomBFS () { 62 String [] args = { "+search.class=gov.nasa.jpf.search.heuristic.HeuristicSearch", 63 "+search.heuristic.class=gov.nasa.jpf.search.heuristic.BFSHeuristic", testClass }; 64 65 Verify.resetCounter(0); 66 67 runJPFnoException(args); 68 69 if (Verify.getCounter(0) != 4) { 70 System.out.println("#### " + Verify.getCounter(0)); 71 fail("wrong number of backtracks"); 72 } 73 } 74 } 75 | Popular Tags |