aboutsummaryrefslogtreecommitdiff
path: root/test/org/traccar
diff options
context:
space:
mode:
Diffstat (limited to 'test/org/traccar')
-rw-r--r--test/org/traccar/helper/BitUtilTest.java22
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));
}
}