iquadrat/jbenchx — Issue #8: Way to assert returned object of the benchmark
Author: iquadrat
Created: 2011-10-31 21:12:01+00:00
State: open

Sometimes it would be nice to have the possibility to assert that the return of a benchmark is equal to some expected value. This check should be done outside the benchmark timings.

Suggestion: Use the toString on the returned object and compare against the string from an annotation:
@Bench
@AssertReturns("2")
public int oneAndOne() {
return 1+1;
}

Better name for the annotation?