Closed Kappenn closed 4 years ago
Has 93% coverage according to OpenClover.
Resolved by f7df84e.
Each if statement should be followed by an else statement, so that we can call CodeCoverage in both branches. CodeCoverage calls can, and should, be added after loops:
while(cond) {
CodeCoverage.run("example");
// do something
}
CodeCoverage.run("example");
But not after if statements (except in else statements). "Before the first statement of each branch outcome, (including to-be-added "else" clauses if none exists)..." - from task.pdf.
Good catch! Thank you :)
No problem, I went ahead and fixed it in 4dc11fa14d94c42a6bb0020a01ff58d4653a0da5. Forgot to mention it here.
Great!
Implement branch coverage by manual instrumentation of the source code for ten functions, Do this for: Unit::setLocation@4090-4153@./src/net/sf/freecol/common/model/Unit.java See 3.5.1 in task pdf