diff options
author | Josh Blum | 2013-05-09 02:06:16 -0700 |
---|---|---|
committer | Josh Blum | 2013-05-09 02:06:16 -0700 |
commit | a1b87fea68e78da0bb3f047a34f3ddc17372cd5c (patch) | |
tree | dfce158c5e2221f73cd4447065c3031cd78e5f0f | |
parent | c643859e0ef138b72bea12de694b094cb1aa6071 (diff) | |
download | sandhi-a1b87fea68e78da0bb3f047a34f3ddc17372cd5c.tar.gz sandhi-a1b87fea68e78da0bb3f047a34f3ddc17372cd5c.tar.bz2 sandhi-a1b87fea68e78da0bb3f047a34f3ddc17372cd5c.zip |
gras: added topology feedback unit test
-rw-r--r-- | tests/block_test.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/block_test.py b/tests/block_test.py index ed6e97d..2f8d91b 100644 --- a/tests/block_test.py +++ b/tests/block_test.py @@ -44,6 +44,21 @@ class BlockTest(unittest.TestCase): self.tb.run() self.assertEqual(sink.get_vector(), (1, 5j, 9, 13j, 17)) + def test_add_f32_feedback(self): + """ + Feedback adder output to input1 of the adder. + Preload input1 of the adder to set the delay. + """ + src0 = VectorSource(numpy.float32, [1, 3, 5, 7, 9]) + adder = Add2X(numpy.float32) + adder.input_config(1).preload_items = 1 #make this a feedback delay of 1 + sink = VectorSink(numpy.float32) + self.tb.connect((src0, 0), (adder, 0)) + self.tb.connect((adder, 0), (adder, 1)) + self.tb.connect(adder, sink) + self.tb.run() + self.assertEqual(sink.get_vector(), (1, 4, 9, 16, 25)) + def test_tag_source_sink(self): values = (0, 'hello', 4.2, True, None, [2, 3, 4], (9, 8, 7), 1j, {2:'d'}) src = TagSource(values) |