Daniel John Debrunner wrote:
...
> This style of code
> can be expensive at runtime:
> for (int i = 0; i < count; i++) {
> assertEquals("Testing at iteration " + i, f(i), g(i));
> }
I'm a fresh guinea pig eager for advice ....
In CallableTest.java I have this:
for(int i=0; i< updateCount.length; i++){
if(i == 1) // The second command in the batch failed.
assertEquals("Batch updateCount", -3, updateCount[i]);
else
assertEquals("Batch updateCount", -1, updateCount[i]);
}
would this be advised?
for(int i=0; i< updateCount.length; i++){
if( (i == 1) && (updateCount[i] != -3) )
assertEquals("Batch updateCount", -3, updateCount[i]);
else if (updateCount[i] != -1)
assertEquals("Batch updateCount", -1, updateCount[i]);
}
thanks,
-jean