def test_001(self): # Just running some data through null source/sink src = blocks.null_source(gr.sizeof_float) hed = blocks.head(gr.sizeof_float, 100) dst = blocks.null_sink(gr.sizeof_float) self.tb.connect(src, hed, dst) self.tb.run()
def test_001(self): src_data = [float(x) for x in range(16)] expected_result = tuple(src_data) period = 9177 offset = 0 src = blocks.null_source(1) head = blocks.head(1, 10000000) ins = blocks.vector_insert_b([1], period, offset) dst = blocks.vector_sink_b() self.tb.connect(src, head, ins, dst) self.tb.run() result_data = dst.data() for i in range(10000): if (i % period == offset): self.assertEqual(1, result_data[i]) else: self.assertEqual(0, result_data[i])
def test_001(self): src_data = [float(x) for x in range(16)] expected_result = tuple(src_data) period = 9177; offset = 0; src = blocks.null_source(1) head = blocks.head(1, 10000000); ins = blocks.vector_insert_b([1], period, offset); dst = blocks.vector_sink_b() self.tb.connect(src, head, ins, dst) self.tb.run() result_data = dst.data() for i in range(10000): if(i%period == offset): self.assertEqual(1, result_data[i]) else: self.assertEqual(0, result_data[i])