[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 01/05: blocks: add socket_pdu qa
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 01/05: blocks: add socket_pdu qa |
Date: |
Wed, 14 Oct 2015 02:48:37 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
jcorgan pushed a commit to branch maint
in repository gnuradio.
commit 7d9f13824e9986650a2f46806d6d6714b99780ce
Author: Nathan West <address@hidden>
Date: Mon Oct 5 18:12:10 2015 -0400
blocks: add socket_pdu qa
This test shows a current bug in blocks::socket_pdu. The block hangs
in the destructor.
---
gr-blocks/python/blocks/qa_socket_pdu.py | 45 ++++++++++++++++++++++++++++++++
1 file changed, 45 insertions(+)
diff --git a/gr-blocks/python/blocks/qa_socket_pdu.py
b/gr-blocks/python/blocks/qa_socket_pdu.py
new file mode 100755
index 0000000..4dba2bf
--- /dev/null
+++ b/gr-blocks/python/blocks/qa_socket_pdu.py
@@ -0,0 +1,45 @@
+#!/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, blocks
+import random
+
+
+class qa_socket_pdu (gr_unittest.TestCase):
+
+ def setUp (self):
+ self.tb = gr.top_block ()
+
+ def tearDown (self):
+ self.tb = None
+
+ def test_001 (self):
+ # Test that blocks can be created and destroyed without hanging
+ port = str(random.Random().randint(0, 30000) + 10000)
+ self.pdu_send = blocks.socket_pdu("UDP_CLIENT", "localhost", port)
+ self.pdu_recv = blocks.socket_pdu("UDP_SERVER", "localhost", port)
+ self.pdu_send = None
+ self.pdu_recv = None
+
+if __name__ == '__main__':
+ gr_unittest.run(qa_socket_pdu, "qa_socket_pdu.xml")
+