test all ntz bit positions

git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@664151 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Yonik Seeley 2008-06-06 21:56:37 +00:00
parent d75e9410c3
commit 2ce5049e36
1 changed files with 6 additions and 5 deletions

View File

@ -135,10 +135,11 @@ public class TestUtils extends TestCase {
assertEquals( 1, BitUtil.ntz2(num) );
assertEquals( 1, BitUtil.ntz3(num) );
num = 234;
//????? why 1?
// assertEquals( 0, BitUtil.ntz(num) );
// assertEquals( 0, BitUtil.ntz2(num) );
// assertEquals( 0, BitUtil.ntz3(num) );
for (int i=0; i<64; i++) {
num = 1L << i;
assertEquals( i, BitUtil.ntz(num) );
assertEquals( i, BitUtil.ntz2(num) );
assertEquals( i, BitUtil.ntz3(num) );
}
}
}