def test_006_t (self): src_data = (0, 0, 0, 254, 1, 1, 0, 0, 1, 0, 1, 0, 255, 0, 0, 0) expected_result = (0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0) src = blocks.vector_source_b(src_data) dst = blocks.vector_sink_b() deint = frame_detection.deinterleaver_bb(2,2,8) self.tb.connect(src, deint) self.tb.connect(deint, dst) self.tb.run () result_data = dst.data() self.assertEqual(expected_result, result_data)
def test_005_t(self): preamble = [2, 4, 8, 16] pre_len = len(preamble) src_data = (2, 4, 8, 15, 2, 4, 8, 16, 1, 1, 0, 0) expected_result = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0) src = blocks.vector_source_b(src_data) dst = blocks.vector_sink_b() dtct = frame_detection.preamble_detector_bb(preamble, pre_len, 4, 1) deint = frame_detection.deinterleaver_bb(2, 2, 4) self.tb.connect(src, dtct) self.tb.connect(dtct, deint) self.tb.connect(deint, dst) self.tb.run() result_data = dst.data() self.assertEqual(expected_result, result_data)
def test_005_t (self): preamble = [2, 4, 8, 16] pre_len = len(preamble); src_data = (2, 4, 8, 15, 2, 4, 8, 16, 1, 1, 0, 0) expected_result = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0) src = blocks.vector_source_b(src_data) dst = blocks.vector_sink_b() dtct = frame_detection.preamble_detector_bb(preamble, pre_len, 4, 1) deint = frame_detection.deinterleaver_bb(2, 2, 4) self.tb.connect(src, dtct) self.tb.connect(dtct, deint) self.tb.connect(deint, dst) self.tb.run () result_data = dst.data() self.assertEqual(expected_result, result_data)