summaryrefslogtreecommitdiff
path: root/gr-blocks/python
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@kit.edu>2013-05-07 15:23:19 +0200
committerMartin Braun <martin.braun@kit.edu>2013-05-11 13:50:30 +0200
commit728c6e2138d5eb4f0814dcd3d03c65e628746eab (patch)
tree0b109eb0909477b918f97911e9e2f494c33c9ddd /gr-blocks/python
parent1601bf277002f0f83f34d672d18360d4982befad (diff)
blocks: Added tag gate
Diffstat (limited to 'gr-blocks/python')
-rwxr-xr-xgr-blocks/python/qa_tag_gate.py49
1 files changed, 49 insertions, 0 deletions
diff --git a/gr-blocks/python/qa_tag_gate.py b/gr-blocks/python/qa_tag_gate.py
new file mode 100755
index 0000000000..fa3c501fb4
--- /dev/null
+++ b/gr-blocks/python/qa_tag_gate.py
@@ -0,0 +1,49 @@
+#!/usr/bin/env python
+#
+# Copyright 2013 Free Software Foundation, Inc.
+#
+# This file is part of GNU Radio
+#
+# GNU Radio is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GNU Radio is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Radio; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street,
+# Boston, MA 02110-1301, USA.
+#
+
+from gnuradio import gr, gr_unittest
+import pmt
+import blocks_swig as blocks
+
+
+class qa_tag_gate (gr_unittest.TestCase):
+
+ def setUp (self):
+ self.tb = gr.top_block ()
+
+ def tearDown (self):
+ self.tb = None
+
+ def test_001_t (self):
+ tag = gr.gr_tag_t()
+ tag.key = pmt.pmt_string_to_symbol('key')
+ tag.value = pmt.pmt_from_long(42)
+ tag.offset = 0
+ src = blocks.vector_source_f(range(20), False, 1, (tag,))
+ gate = blocks.tag_gate(gr.sizeof_float, False)
+ sink = blocks.vector_sink_f()
+ self.tb.run ()
+ self.assertEqual(len(sink.tags()), 0)
+
+if __name__ == '__main__':
+ gr_unittest.run(qa_tag_gate, "qa_tag_gate.xml")
+