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 void
clear()
Clears the coverage map.org.eclipse.collections.api.list.primitive.IntList
computeNewCoverage(ICoverage baseline)
Returns a set of edges in this coverage that don't exist in baselineFastNonCollidingCoverage
copy()
Creates a copy of an existing coverage map.Counter
getCounter()
org.eclipse.collections.api.list.primitive.IntList
getCovered()
Returns a collection of branches that are covered.int
getNonZeroCount()
Returns the number of edges covered.int
hashCode()
Returns a hash code of the edge counts in the coverage map.void
logJump(int iid, int branch)
void
logLookUpSwitch(int value, int iid, int dflt, int[] cases)
void
logMethodBegin(int iid)
void
logTableSwitch(int value, int iid, int min, int max, int dflt)
int
nonZeroHashCode()
Returns a hash code of the list of edges that have been covered at least once.int
size()
Returns the size of the coverage map.String
toString()
boolean
updateBits(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:
copy
in interfaceICoverage<FastNonCollidingCounter>
-
size
public int size()
Returns the size of the coverage map.- Specified by:
size
in interfaceICoverage<FastNonCollidingCounter>
- Returns:
- the size of the coverage map
-
getNonZeroCount
public int getNonZeroCount()
Returns the number of edges covered.- Specified by:
getNonZeroCount
in 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:
getCovered
in 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:
computeNewCoverage
in 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:
clear
in interfaceICoverage<FastNonCollidingCounter>
-
updateBits
public boolean updateBits(ICoverage that)
Updates this coverage with bits from the parameter.- Specified by:
updateBits
in interfaceICoverage<FastNonCollidingCounter>
- Parameters:
that
- the run coverage whose bits to OR- Returns:
true
iffthat
is not a subset ofthis
, causingthis
to 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:
nonZeroHashCode
in interfaceICoverage<FastNonCollidingCounter>
- Returns:
- a hash of non-zero entries
-
getCounter
public Counter getCounter()
- Specified by:
getCounter
in interfaceICoverage<FastNonCollidingCounter>
-
toString
public String toString()
-
logMethodBegin
public void logMethodBegin(int iid)
- Specified by:
logMethodBegin
in interfaceFastCoverageListener
- Overrides:
logMethodBegin
in classFastCoverageListener.Default
-
logJump
public void logJump(int iid, int branch)
- Specified by:
logJump
in interfaceFastCoverageListener
- Overrides:
logJump
in classFastCoverageListener.Default
-
logLookUpSwitch
public void logLookUpSwitch(int value, int iid, int dflt, int[] cases)
- Specified by:
logLookUpSwitch
in interfaceFastCoverageListener
- Overrides:
logLookUpSwitch
in classFastCoverageListener.Default
-
logTableSwitch
public void logTableSwitch(int value, int iid, int min, int max, int dflt)
- Specified by:
logTableSwitch
in interfaceFastCoverageListener
- Overrides:
logTableSwitch
in classFastCoverageListener.Default
-
-