Class Coverage

    • Constructor Detail

      • Coverage

        public Coverage()
        Creates a new coverage map.
    • Method Detail

      • size

        public int size()
        Returns the size of the coverage map.
        Specified by:
        size in interface ICoverage<Counter>
        Returns:
        the size of the coverage map
      • handleEvent

        public void handleEvent​(TraceEvent e)
        Updates coverage information based on emitted event.

        This method updates its internal counters for branch and call events.

        Parameters:
        e - the event to be processed
      • getNonZeroCount

        public int getNonZeroCount()
        Returns the number of edges covered.
        Specified by:
        getNonZeroCount in interface ICoverage<Counter>
        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 interface ICoverage<Counter>
        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 interface ICoverage<Counter>
        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 interface ICoverage<Counter>
      • updateBits

        public boolean updateBits​(ICoverage that)
        Updates this coverage with bits from the parameter.
        Specified by:
        updateBits in interface ICoverage<Counter>
        Parameters:
        that - the run coverage whose bits to OR
        Returns:
        true iff that is not a subset of this, causing this to change.
      • hashCode

        public int hashCode()
        Returns a hash code of the edge counts in the coverage map.
        Overrides:
        hashCode in class Object
      • nonZeroHashCode

        public int nonZeroHashCode()
        Returns a hash code of the list of edges that have been covered at least once.
        Specified by:
        nonZeroHashCode in interface ICoverage<Counter>
        Returns:
        a hash of non-zero entries
      • toString

        public String toString()
        Overrides:
        toString in class Object
        Returns:
        a string representing the counter