Skip to content

Commit 52e6dc0

Browse files
committed
Fixed bug in evaluating test case that expected null or throw.
In one line report format, don't show stack if expected Throwable thrown.
1 parent 0ac89bd commit 52e6dc0

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

BevoTest/src/edu/utexas/cs/bevotest/BevoTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1010,7 +1010,7 @@ protected synchronized void complete() throws IllegalStateException {
10101010
} else {
10111011
if (returnedValueValid) {
10121012
setStatus(Status.COMPLETE_NORMAL);
1013-
if (testCase.getExpectedReturn() == null ? testCase.getExpectedReturn() == null : testCase.getExpectedReturn().equals(returnedValue)) {
1013+
if (testCase.getExpectedThrowClass() == null && (testCase.getExpectedReturn() == null ? returnedValue == null : testCase.getExpectedReturn().equals(returnedValue))) {
10141014
setEvaluation(Evaluation.PASSED);
10151015
} else {
10161016
setEvaluation(Evaluation.FAILED);

BevoTest/src/edu/utexas/cs/bevotest/PlaintextTestReporter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ public void reportEntry(final TestExecutionResult<?, ?> entry, final Appendable
285285
}
286286
out.append((statusColumn+" ").substring(0, 24)).append(" | ");
287287
out.append(entry.getTestCase().getDescription()).append(newLine);
288-
if (entry.getCaughtValue() != null && !(entry.getCaughtValue() instanceof NullTestItemException) && reportOpts.contains(ReportOption.ONE_LINE_SHOW_STACK)) {
288+
if (entry.getCaughtValue() != null && !(entry.getCaughtValue() instanceof NullTestItemException) && entry.getEvaluation() != Evaluation.PASSED && reportOpts.contains(ReportOption.ONE_LINE_SHOW_STACK)) {
289289
out.append(" ");
290290
appendStackTrace(entry.getCaughtValue(), out);
291291
}

0 commit comments

Comments
 (0)