def test_201b(self): """ test int version """ random.seed(0) src_data = [] for i in xrange(100): src_data.append((random.randint(-2 ** 31, 2 ** 31 - 1))) src_data = tuple(src_data) expected_results = src_data src = gr.vector_source_i(tuple(src_data), False) op1 = gr.packed_to_unpacked_ii(8, gr.GR_LSB_FIRST) op2 = gr.unpacked_to_packed_ii(8, gr.GR_LSB_FIRST) self.tb.connect(src, op1, op2) dst = gr.vector_sink_i() self.tb.connect(op2, dst) self.tb.run() self.assertEqual(expected_results, dst.data())
def test_201b(self): """ test int version """ random.seed(0) src_data = [] for i in xrange(100): src_data.append((random.randint(-2**31,2**31-1))) src_data = tuple(src_data) expected_results = src_data src = gr.vector_source_i(tuple(src_data),False) op1 = gr.packed_to_unpacked_ii(8, gr.GR_LSB_FIRST) op2 = gr.unpacked_to_packed_ii(8, gr.GR_LSB_FIRST) self.tb.connect(src, op1, op2) dst = gr.vector_sink_i() self.tb.connect(op2, dst) self.tb.run() self.assertEqual(expected_results, dst.data())