summaryrefslogtreecommitdiff
path: root/gr-blocks/python
diff options
context:
space:
mode:
authorJeff Long <willcode4@gmail.com>2018-01-16 08:34:57 -0500
committerMartin Braun <martin.braun@ettus.com>2018-02-08 15:59:04 -0800
commit2270a41d12ee028905302233d8178568d6da6daa (patch)
tree41ba7fc23d7624f99fd34df4518dc75c2a2b2985 /gr-blocks/python
parentdfc6dd7f0c878f4550c38fd7ef44e7dc0caadebe (diff)
qa_file_source_sink.py: create file_source after file has been populated
Test was opening zero-length file and depending on it to be populated later. With addition of offset/length fields, file_source will be required to check file size on open.
Diffstat (limited to 'gr-blocks/python')
-rw-r--r--gr-blocks/python/blocks/qa_file_source_sink.py17
1 files changed, 8 insertions, 9 deletions
diff --git a/gr-blocks/python/blocks/qa_file_source_sink.py b/gr-blocks/python/blocks/qa_file_source_sink.py
index 32910cb4bc..86d36c0cca 100644
--- a/gr-blocks/python/blocks/qa_file_source_sink.py
+++ b/gr-blocks/python/blocks/qa_file_source_sink.py
@@ -45,11 +45,11 @@ class test_file_source_sink(gr_unittest.TestCase):
snk = blocks.file_sink(gr.sizeof_float, temp.name)
snk.set_unbuffered(True)
- src2 = blocks.file_source(gr.sizeof_float, temp.name)
-
self.tb.connect(src, snk)
self.tb.run()
+ src2 = blocks.file_source(gr.sizeof_float, temp.name)
+
self.tb.disconnect(src, snk)
self.tb.connect(src2, snk2)
self.tb.run()
@@ -115,12 +115,12 @@ class test_file_source_sink(gr_unittest.TestCase):
snk = blocks.file_sink(gr.sizeof_float, temp.name)
snk.set_unbuffered(True)
- src2 = blocks.file_source(gr.sizeof_float, temp.name)
- src2.set_begin_tag(pmt.string_to_symbol("file_begin"))
-
self.tb.connect(src, snk)
self.tb.run()
+ src2 = blocks.file_source(gr.sizeof_float, temp.name)
+ src2.set_begin_tag(pmt.string_to_symbol("file_begin"))
+
self.tb.disconnect(src, snk)
self.tb.connect(src2, snk2)
self.tb.run()
@@ -141,13 +141,13 @@ class test_file_source_sink(gr_unittest.TestCase):
snk = blocks.file_sink(gr.sizeof_float, temp.name)
snk.set_unbuffered(True)
+ self.tb.connect(src, snk)
+ self.tb.run()
+
src2 = blocks.file_source(gr.sizeof_float, temp.name, True)
src2.set_begin_tag(pmt.string_to_symbol("file_begin"))
hd = blocks.head(gr.sizeof_float, 2000)
- self.tb.connect(src, snk)
- self.tb.run()
-
self.tb.disconnect(src, snk)
self.tb.connect(src2, hd, snk2)
self.tb.run()
@@ -165,4 +165,3 @@ class test_file_source_sink(gr_unittest.TestCase):
if __name__ == '__main__':
gr_unittest.run(test_file_source_sink, "test_file_source_sink.xml")
-