fix infinite loop in test

This commit is contained in:
fjy 2014-07-15 16:00:56 -07:00
parent bdfeccd092
commit 27c4750780
1 changed files with 6 additions and 5 deletions

View File

@ -196,14 +196,15 @@ public class HashBasedNumberedShardSpecTest
}
@Test
public void testValidity(){
for(int i=Integer.MIN_VALUE;i<=Integer.MAX_VALUE;i++){
public void testValidity()
{
for (int i = Integer.MIN_VALUE; i < Integer.MAX_VALUE; i++) {
{
int partitionNum = Math.abs((int) ((long) i % 2));
if(partitionNum != 0 && partitionNum != 1){
throw new ISE("for i "+ i+ "partitionNum "+ partitionNum);
if (partitionNum != 0 && partitionNum != 1) {
throw new ISE("for i " + i + "partitionNum " + partitionNum);
}
}
}
}
}
}