Package edu.berkeley.cs.jqf.fuzz.util
Class FastNonCollidingCoverage
- java.lang.Object
-
- janala.instrument.FastCoverageListener.Default
-
- edu.berkeley.cs.jqf.fuzz.util.FastNonCollidingCoverage
-
- All Implemented Interfaces:
ICoverage<FastNonCollidingCounter>,FastCoverageListener
public class FastNonCollidingCoverage extends FastCoverageListener.Default implements ICoverage<FastNonCollidingCounter>
Utility class to collect branch and function coverage- Author:
- Jonathan Bell
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface janala.instrument.FastCoverageListener
FastCoverageListener.Default
-
-
Constructor Summary
Constructors Constructor Description FastNonCollidingCoverage()Creates a new coverage map.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Clears the coverage map.org.eclipse.collections.api.list.primitive.IntListcomputeNewCoverage(ICoverage baseline)Returns a set of edges in this coverage that don't exist in baselineFastNonCollidingCoveragecopy()Creates a copy of an existing coverage map.CountergetCounter()org.eclipse.collections.api.list.primitive.IntListgetCovered()Returns a collection of branches that are covered.intgetNonZeroCount()Returns the number of edges covered.inthashCode()Returns a hash code of the edge counts in the coverage map.voidlogJump(int iid, int branch)voidlogLookUpSwitch(int value, int iid, int dflt, int[] cases)voidlogMethodBegin(int iid)voidlogTableSwitch(int value, int iid, int min, int max, int dflt)intnonZeroHashCode()Returns a hash code of the list of edges that have been covered at least once.intsize()Returns the size of the coverage map.StringtoString()booleanupdateBits(ICoverage that)Updates this coverage with bits from the parameter.-
Methods inherited from class janala.instrument.FastCoverageListener.Default
logMethodEnd
-
-
-
-
Method Detail
-
copy
public FastNonCollidingCoverage copy()
Creates a copy of an existing coverage map.- Specified by:
copyin interfaceICoverage<FastNonCollidingCounter>
-
size
public int size()
Returns the size of the coverage map.- Specified by:
sizein interfaceICoverage<FastNonCollidingCounter>- Returns:
- the size of the coverage map
-
getNonZeroCount
public int getNonZeroCount()
Returns the number of edges covered.- Specified by:
getNonZeroCountin interfaceICoverage<FastNonCollidingCounter>- Returns:
- the number of edges with non-zero counts
-
getCovered
public org.eclipse.collections.api.list.primitive.IntList getCovered()
Returns a collection of branches that are covered.- Specified by:
getCoveredin interfaceICoverage<FastNonCollidingCounter>- Returns:
- a collection of keys that are covered
-
computeNewCoverage
public org.eclipse.collections.api.list.primitive.IntList computeNewCoverage(ICoverage baseline)
Returns a set of edges in this coverage that don't exist in baseline- Specified by:
computeNewCoveragein interfaceICoverage<FastNonCollidingCounter>- Parameters:
baseline- the baseline coverage- Returns:
- the set of edges that do not exist in
baseline
-
clear
public void clear()
Clears the coverage map.- Specified by:
clearin interfaceICoverage<FastNonCollidingCounter>
-
updateBits
public boolean updateBits(ICoverage that)
Updates this coverage with bits from the parameter.- Specified by:
updateBitsin interfaceICoverage<FastNonCollidingCounter>- Parameters:
that- the run coverage whose bits to OR- Returns:
trueiffthatis not a subset ofthis, causingthisto change.
-
hashCode
public int hashCode()
Returns a hash code of the edge counts in the coverage map.
-
nonZeroHashCode
public int nonZeroHashCode()
Returns a hash code of the list of edges that have been covered at least once.- Specified by:
nonZeroHashCodein interfaceICoverage<FastNonCollidingCounter>- Returns:
- a hash of non-zero entries
-
getCounter
public Counter getCounter()
- Specified by:
getCounterin interfaceICoverage<FastNonCollidingCounter>
-
toString
public String toString()
-
logMethodBegin
public void logMethodBegin(int iid)
- Specified by:
logMethodBeginin interfaceFastCoverageListener- Overrides:
logMethodBeginin classFastCoverageListener.Default
-
logJump
public void logJump(int iid, int branch)- Specified by:
logJumpin interfaceFastCoverageListener- Overrides:
logJumpin classFastCoverageListener.Default
-
logLookUpSwitch
public void logLookUpSwitch(int value, int iid, int dflt, int[] cases)- Specified by:
logLookUpSwitchin interfaceFastCoverageListener- Overrides:
logLookUpSwitchin classFastCoverageListener.Default
-
logTableSwitch
public void logTableSwitch(int value, int iid, int min, int max, int dflt)- Specified by:
logTableSwitchin interfaceFastCoverageListener- Overrides:
logTableSwitchin classFastCoverageListener.Default
-
-