diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-10-20 13:59:44 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-10-20 13:59:44 +1300 |
commit | 06b5113f3d98a44530c2ade6810bc75092fccc31 (patch) | |
tree | cb8c03c8f3394db0691b73547e86d2a181462607 /test/org/traccar/helper | |
parent | 7b103b43754de283e423df03042c6f75307c8466 (diff) | |
download | traccar-server-06b5113f3d98a44530c2ade6810bc75092fccc31.tar.gz traccar-server-06b5113f3d98a44530c2ade6810bc75092fccc31.tar.bz2 traccar-server-06b5113f3d98a44530c2ade6810bc75092fccc31.zip |
Refactor bit utililies class
Diffstat (limited to 'test/org/traccar/helper')
-rw-r--r-- | test/org/traccar/helper/BitUtilTest.java | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/test/org/traccar/helper/BitUtilTest.java b/test/org/traccar/helper/BitUtilTest.java index dbe3852b7..4aa295e12 100644 --- a/test/org/traccar/helper/BitUtilTest.java +++ b/test/org/traccar/helper/BitUtilTest.java @@ -13,11 +13,23 @@ public class BitUtilTest { } @Test - public void testRange() { - Assert.assertEquals(0, BitUtil.range(0, 0, 0)); - Assert.assertEquals(1, BitUtil.range(1, 0, 1)); - Assert.assertEquals(2, BitUtil.range(2, 0, 2)); - Assert.assertEquals(2, BitUtil.range(6, 0, 2)); + public void testBetween() { + Assert.assertEquals(0, BitUtil.between(0, 0, 0)); + Assert.assertEquals(1, BitUtil.between(1, 0, 1)); + Assert.assertEquals(2, BitUtil.between(2, 0, 2)); + Assert.assertEquals(2, BitUtil.between(6, 0, 2)); + } + + @Test + public void testFrom() { + Assert.assertEquals(1, BitUtil.from(1, 0)); + Assert.assertEquals(0, BitUtil.from(1, 1)); + } + + @Test + public void testTo() { + Assert.assertEquals(2, BitUtil.to(2, 2)); + Assert.assertEquals(0, BitUtil.to(2, 1)); } } |