1 package gov.nasa.jpf.search.heuristic; 20 21 import gov.nasa.jpf.Config; 22 import gov.nasa.jpf.util.CoverageManager; 23 24 25 28 public class PersistPathBranchCoverage implements Heuristic { 29 private int old = 1; 30 HeuristicSearch search; 31 32 public PersistPathBranchCoverage (Config config, HeuristicSearch search) { 33 search.setPathCoverage(true); 34 search.setCalcBranchCoverage(true); 35 36 this.search = search; 37 } 38 39 public int heuristicValue () { 40 int li = CoverageManager.getLastIncremented(); 41 42 if (li >= 0) { 43 return li; 44 } else { 45 return old; 46 } 47 } 48 49 public void processParent () { 50 old = search.getOld().getPriority(); 51 } 52 } | Popular Tags |