9899100101102103104105106107108
assertTrue(values[1] == 22.0f); assertFalse(m2.isDecoded()); assertEquals(m2.size(), 2); m2.decode(); assertTrue(m2.isDecoded()); float value; assertEquals(m2.size(), 2);
119120121122123124125126127128129
@Test public void testSerializeEmpty() throws IOException { HMapIIW m1 = new HMapIIW(); // make sure this does nothing m1.decode(); assertTrue(m1.size() == 0); HMapIFW m2 = HMapIFW.create(m1.serialize());
123124125126127128129130131132133
assertEquals(4, keys[1]); assertEquals(5.0f, values[0], 10e-6); assertEquals(22.0f, values[1], 10e-6); m2.decode(); assertTrue(m2.hasBeenDecoded()); float value; assertEquals(2, m2.size());
167168169170171172173174175176177
assertEquals(4, keys[1]); assertEquals(5.0f, values[0], 10e-6); assertEquals(22.0f, values[1], 10e-6); m3.decode(); assertTrue(m3.hasBeenDecoded()); float value; assertEquals(2, m3.size());
188189190191192193194195196197198
@Test public void testSerializeEmpty() throws IOException { Int2FloatOpenHashMapWritable m1 = new Int2FloatOpenHashMapWritable(); // Make sure this does nothing. m1.decode(); assertEquals(0, m1.size()); Int2FloatMap m2 = Int2FloatOpenHashMapWritable.create(m1.serialize());
assertEquals(4, keys[1]); assertEquals(5, values[0]); assertEquals(22, values[1]); m2.decode(); assertTrue(m2.hasBeenDecoded()); int value; assertEquals(2, m2.size());
assertEquals(4, keys[1]); assertEquals(5, values[0]); assertEquals(22, values[1]); m3.decode(); assertTrue(m3.hasBeenDecoded()); int value; assertEquals(2, m3.size());
@Test public void testSerializeEmpty() throws IOException { Int2IntOpenHashMapWritable m1 = new Int2IntOpenHashMapWritable(); // make sure this does nothing m1.decode(); assertEquals(0, m1.size()); Int2IntMap m2 = Int2IntOpenHashMapWritable.create(m1.serialize());