[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r5949 - gnuradio/branches/developers/trondeau/regen/gn
From: |
trondeau |
Subject: |
[Commit-gnuradio] r5949 - gnuradio/branches/developers/trondeau/regen/gnuradio-core/src/python/gnuradio/gr |
Date: |
Fri, 13 Jul 2007 06:36:54 -0600 (MDT) |
Author: trondeau
Date: 2007-07-13 06:36:54 -0600 (Fri, 13 Jul 2007)
New Revision: 5949
Added:
gnuradio/branches/developers/trondeau/regen/gnuradio-core/src/python/gnuradio/gr/qa_regenerate.py
Log:
adding QA code for regenerate block
Added:
gnuradio/branches/developers/trondeau/regen/gnuradio-core/src/python/gnuradio/gr/qa_regenerate.py
===================================================================
---
gnuradio/branches/developers/trondeau/regen/gnuradio-core/src/python/gnuradio/gr/qa_regenerate.py
(rev 0)
+++
gnuradio/branches/developers/trondeau/regen/gnuradio-core/src/python/gnuradio/gr/qa_regenerate.py
2007-07-13 12:36:54 UTC (rev 5949)
@@ -0,0 +1,60 @@
+#!/usr/bin/env python
+#
+# Copyright 2007 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 2, 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 math
+
+class test_sig_source (gr_unittest.TestCase):
+
+ def setUp (self):
+ self.fg = gr.flow_graph ()
+
+ def tearDown (self):
+ self.fg = None
+
+ def test_regen (self):
+ fg = self.fg
+
+ data = [0, 0, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
+
+ expected_result = (0, 0, 0,
+ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
0, 0,
+ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0)
+
+
+ src = gr.vector_source_b(data, False)
+ regen = gr.regenerate_bb(5, 2)
+ dst = gr.vector_sink_b()
+
+ fg.connect (src, regen)
+ fg.connect (regen, dst)
+ fg.run ()
+
+ dst_data = dst.data ()
+
+ self.assertEqual (expected_result, dst_data)
+
+
+if __name__ == '__main__':
+ gr_unittest.main ()
Property changes on:
gnuradio/branches/developers/trondeau/regen/gnuradio-core/src/python/gnuradio/gr/qa_regenerate.py
___________________________________________________________________
Name: svn:executable
+ *
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r5949 - gnuradio/branches/developers/trondeau/regen/gnuradio-core/src/python/gnuradio/gr,
trondeau <=