本文整理汇总了Java中org.jacoco.core.analysis.ICounter.EMPTY属性的典型用法代码示例。如果您正苦于以下问题:Java ICounter.EMPTY属性的具体用法?Java ICounter.EMPTY怎么用?Java ICounter.EMPTY使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.jacoco.core.analysis.ICounter
的用法示例。
在下文中一共展示了ICounter.EMPTY属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createAnnotations
private void createAnnotations(final ISourceNode linecoverage) {
AnnotationModelEvent event = new AnnotationModelEvent(this);
clear(event);
final int firstline = linecoverage.getFirstLine();
final int lastline = Math.min(linecoverage.getLastLine(),
document.getNumberOfLines());
try {
for (int l = firstline; l <= lastline; l++) {
final ILine line = linecoverage.getLine(l);
if (line.getStatus() != ICounter.EMPTY) {
final IRegion region = document.getLineInformation(l - 1);
final CoverageAnnotation ca = new CoverageAnnotation(
region.getOffset(), region.getLength(), line);
annotations.add(ca);
event.annotationAdded(ca);
}
}
} catch (BadLocationException ex) {
EclEmmaUIPlugin.log(ex);
}
fireModelChanged(event);
}
示例2: getCoverableStmts
public boolean[] getCoverableStmts() {
int testsNum = this.getTestCount();
if(testsNum == 0) return new boolean[0];
int[] test = this.testStmtMatrix.get(0);
int[] decodedCoverge = null;
if(format == LineCoverageFormat.DENSE) {
decodedCoverge = decodeDense(test);
} else {
decodedCoverge = decodeCompact(test);
}
boolean[] stmts = new boolean[decodedCoverge.length];
for(int i = 0; i < decodedCoverge.length; i += 1) {
int coverageStatus = decodedCoverge[i];
if(coverageStatus == ICounter.EMPTY) {
stmts[i] = false;
} else {
stmts[i] = true;
}
}
return stmts;
}
示例3: findCoverableStmts
boolean[] findCoverableStmts(
int[] coverage, LineCoverageFormat format, int length) {
int[] decodedCoverge = null;
if(format == LineCoverageFormat.DENSE) {
decodedCoverge = decodeDense(coverage);
} else {
decodedCoverge = decodeCompact(coverage);
}
boolean[] stmts = new boolean[length];
for(int i = 0; i < length; i += 1) {
int coverageStatus = decodedCoverge[i];
if(coverageStatus == ICounter.EMPTY) {
stmts[i] = false;
} else {
stmts[i] = true;
}
}
return stmts;
}
示例4: print_source_counter_verbose
public static void print_source_counter_verbose(ISourceNode source)
{
int firstLine = source.getFirstLine();
int lastLine = source.getLastLine();
System.out.printf("%18s: %s\n", "First Line", firstLine);
System.out.printf("%18s: %s\n", "Last Line", lastLine);
for(int i = firstLine; i <= lastLine; i++)
{
ILine line = source.getLine(i);
ICounter instructionCounter = line.getInstructionCounter();
int status = instructionCounter.getStatus();
if(status != ICounter.EMPTY)
{
String status_string = "";
switch(status)
{
case ICounter.NOT_COVERED:
status_string = "NOT_COVERED";
break;
case ICounter.FULLY_COVERED:
status_string = "FULLY_COVERED";
break;
case ICounter.PARTLY_COVERED:
status_string = "PARTLY_COVERED";
break;
default:
}
System.out.printf("%18s: %6s (%s)\n", "Line "+i, instructionCounter.getCoveredCount() + "/" + instructionCounter.getTotalCount(), status_string);
}
}
}
示例5: lineStatusString
private String lineStatusString(int lineStatus) {
switch(lineStatus) {
case ICounter.EMPTY: return "EMPTY";
case ICounter.NOT_COVERED: return "NOT COVERED";
case ICounter.PARTLY_COVERED: return "PARTLY COVERED";
case ICounter.FULLY_COVERED: return "FULLY COVERED";
default: return "UNKNOWN STATUS";
}
}
示例6: printCoverage
@SuppressWarnings("rawtypes")
@Override
public void printCoverage() {
ArrayList<ISourceFileCoverage> sourcefilesCovergae =
amassSourcefilesCoverage();
SourceFileCoverage[] sourcefiles = coverage(sourcefilesCovergae);
for(SourceFileCoverage<Integer> sourcefile: sourcefiles){
String sourceFQN = sourcefile.getPackageName()+"."+sourcefile.getFileName();
Integer[] encodedLinesStatuses = sourcefile.getLinesCoverage();
int[] encodedStatuses = new int[encodedLinesStatuses.length];
for(int i = 0; i < encodedLinesStatuses.length; i += 1) {
encodedStatuses[i] = encodedLinesStatuses[i];
}
LinesStatusCoder coder = new LinesStatusCoder();
int[] decodedStatuses = coder.decode(encodedStatuses);
int fl = sourcefile.getFirstLine();
int ll = sourcefile.getLastLine();
int emptyLineCnt=0;
String testFQN = sourcefile.getSessionName();
if(testFQN.endsWith("_F")) testFQN = testFQN.replaceAll("_F", "");
int sourceID = db.getSourceID(sourceFQN);
int testID = db.getTestID(testFQN);
for(int i=0; i<ll-fl+1; ++i){
int lineNumber = i+fl;
switch(decodedStatuses[i]){
case ICounter.EMPTY:
++emptyLineCnt;break;
case ICounter.FULLY_COVERED:
case ICounter.PARTLY_COVERED:
db.insertLineCoverage(testID, sourceID, lineNumber, projectID);
break;
case ICounter.NOT_COVERED:
break;
}
}
if(updateSourceInfo){
db.insertSource(sourceFQN, (ll-fl-emptyLineCnt+1), projectID);
}
}
}