예제 #1
0
 @Test
 public void pack_unpack_3() {
   final PackOrientation<Integer> p =
       new PackOrientation<Integer>(getBools("00110011"), getBools("00000011"), 2, PART_IDS_8, 3);
   assertEquals(3 * 3 * 3 * 3 * Coder.unordered.size(8, 4), p.size());
   p.unpack(0);
   assertEquals(". . . . 0 0 0 0", p.toString());
   p.unpack(1);
   assertEquals(". . . . 0 0 0 1", p.toString());
   p.unpack(p.size() - 2);
   assertEquals("2 2 2 1 . . . .", p.toString());
   p.unpack(p.size() - 1);
   assertEquals("2 2 2 2 . . . .", p.toString());
   checkPackUnpack(p);
 }
예제 #2
0
 @Test
 public void start_3() {
   final PackOrientation<Integer> p =
       new PackOrientation<Integer>(getBools("00110011"), getBools("00000011"), 2, PART_IDS_8, 3);
   assertEquals(Coder.unordered.size(4, 2), p.startSize());
   p.unpack(p.start(0));
   assertEquals(". . . . 0 0 0 0", p.toString());
   p.unpack(p.start(1));
   assertEquals(". 0 . . . 0 0 0", p.toString());
   p.unpack(p.start(2));
   assertEquals(". 0 . . 0 . 0 0", p.toString());
   p.unpack(p.start(3));
   assertEquals("0 . . . . 0 0 0", p.toString());
   p.unpack(p.start(4));
   assertEquals("0 . . . 0 . 0 0", p.toString());
   p.unpack(p.start(5));
   assertEquals("0 0 . . . . 0 0", p.toString());
 }