979899100101102103104105106107
assertTrue(keys[1] == 4); assertTrue(values[0] == 5.0); assertTrue(values[1] == 22.0); m2.decode(); assertTrue(m2.isDecoded()); double value; assertEquals(m2.size(), 2);
136137138139140141142143144145146
assertTrue(keys[1] == 4); assertTrue(values[0] == 5.0); assertTrue(values[1] == 22.0); m2.decode(); double value; assertEquals(m2.size(), 2); value = m2.get(3); assertTrue(value == 5.0);
214215216217218219220221222223224
assertFalse(n2.isDecoded()); assertEquals(3, n2.size()); // n1 isn't decoded, n2 is n2.decode(); n1.plus(n2); assertTrue(n1.size() == 3); assertTrue(n1.get(3) == 6.0); assertTrue(n1.get(4) == 23.0);
291292293294295296297298299300301
assertFalse(n2.isDecoded()); assertEquals(3, n2.size()); // both n1 and n2 are decoded n1.decode(); n2.decode(); n1.plus(n2); assertTrue(n1.size() == 3); assertTrue(n1.get(3) == 6.0); assertTrue(n1.get(4) == 23.0);
307308309310311312313314315316317
@Test public void testSerializeEmpty() throws IOException { HMapIDW m1 = new HMapIDW(); // make sure this does nothing m1.decode(); assertTrue(m1.size() == 0); byte[] bytes = m1.serialize(); HMapIDW m2 = HMapIDW.create(bytes);
assertTrue(keys[1] == 4); assertTrue(values[0] == 5.0f); assertTrue(values[1] == 22.0f); m2.decode(); assertTrue(m2.isDecoded()); float value; assertEquals(m2.size(), 2);
assertTrue(keys[1] == 4); assertTrue(values[0] == 5.0f); assertTrue(values[1] == 22.0f); m2.decode(); float value; assertEquals(m2.size(), 2); value = m2.get(3); assertTrue(value == 5.0f);
assertFalse(n2.isDecoded()); assertEquals(3, n2.size()); // n1 isn't decoded, n2 is n2.decode(); n1.plus(n2); assertTrue(n1.size() == 3); assertTrue(n1.get(3) == 6.0f); assertTrue(n1.get(4) == 23.0f);
assertFalse(n2.isDecoded()); assertEquals(3, n2.size()); // both n1 and n2 are decoded n1.decode(); n2.decode(); n1.plus(n2); assertTrue(n1.size() == 3); assertTrue(n1.get(3) == 6.0f); assertTrue(n1.get(4) == 23.0f);
@Test public void testSerializeEmpty() throws IOException { HMapIFW m1 = new HMapIFW(); // make sure this does nothing m1.decode(); assertTrue(m1.size() == 0); byte[] bytes = m1.serialize(); HMapIFW m2 = HMapIFW.create(bytes);