Beispiel #1
0
 def test_interleave3(self):
     self.assertEqual(
         hex(interleave.interleave3(0x00, 0xFF, 0x00)), '0x492492'
     )
     self.assertEqual(
         hex(interleave.interleave3(0x0000, 0xFFFF, 0x0000)), '0x12492492'
     )
Beispiel #2
0
 def test_interleave3_with_loop_comparison(self):
     """
     test that loop version of interleave3 produces the same results as
     the original
     """
     integers = (4, 42, 7)
     interleaved = interleave.interleave3(*integers)
     interleaved_with_loop = alternative_interleave.interleave3_with_loop(
         *integers
     )
     self.assertEqual(interleaved, interleaved_with_loop)
Beispiel #3
0
 def test_idempotency3(self):
     for nums in self.num_sets:
         integers = list(nums[:3])
         interleaved = interleave.interleave3(*integers)
         self.assertEqual(integers, interleave.deinterleave3(interleaved))
Beispiel #4
0
 def test_interleave3(self):
     for nums in self.num_sets:
         self.assertEqual(interleave.interleave3(*nums[:3]),
                          interleave.interleavem_naive(*nums[:3]))
Beispiel #5
0
 def test_interleave3(self):
     self.assertEqual(hex(interleave.interleave3(0x00, 0xFF, 0x00)),
                      '0x492492')
     self.assertEqual(hex(interleave.interleave3(0x0000, 0xFFFF, 0x0000)),
                      '0x12492492')
Beispiel #6
0
 def test_idempotency_3(self):
     integers = (4, 42, 36)
     interleaved = interleave.interleave3(*integers)
     self.assertEqual(integers, interleave.deinterleave3(interleaved))
Beispiel #7
0
 def test_interleave3(self):
     self.assertEqual(hex(interleave.interleave3(0x00, 0xFF, 0x00)), hex(4793490))
     self.assertEqual(hex(interleave.interleave3(0x0000, 0xFFFF, 0x0000)), hex(306783378))