Пример #1
0
 public static String coverageAsString(TestWithCoverage coverage) {
   final BitSet bitset = coverage.getCoverage();
   StringBuilder stringBuffer = new StringBuilder();
   for (int i = 0; i < coverage.getNumProbePoints(); i++) {
     stringBuffer.append(bitset.get(i) ? "X" : " ");
   }
   return stringBuffer.toString();
 }
Пример #2
0
  public String coverageAsString(int stringLength, long numProbePoints) {
    StringBuilder sb = new StringBuilder("[");
    final int chunkSize = (int) (numProbePoints / (stringLength - 2));
    for (int i = 0; i < stringLength - 2; i++) {
      int chunkStart = i * chunkSize;
      int chunkEnd = (i + 1) * chunkSize;

      if (coverage.nextSetBit(chunkStart) < chunkEnd) {
        sb.append('\u2592');
      } else {
        sb.append(' ');
      }
    }
    sb.append(']');

    return sb.toString();
  }
Пример #3
0
 public double getIndividualCoverage() {
   return ((double) coverage.cardinality()) / coverage.size();
 }