Пример #1
0
 @Test
 public void testAddingOnes() {
   hash.addOnBitToEnd();
   assertEquals(0x1l, hash.bits);
   assertEquals(1, hash.significantBits());
   hash.addOnBitToEnd();
   hash.addOnBitToEnd();
   hash.addOnBitToEnd();
   assertEquals(0xfl, hash.bits);
   assertEquals(4, hash.significantBits());
 }
Пример #2
0
  @Test
  public void testAddingZeroes() {
    hash.addOnBitToEnd();
    assertEquals(0x1l, hash.bits);

    hash.addOffBitToEnd();
    hash.addOffBitToEnd();
    hash.addOffBitToEnd();
    hash.addOffBitToEnd();
    assertEquals(0x10l, hash.bits);
    assertEquals(5, hash.significantBits());
  }