Skip to content

Commit fa75f18

Browse files
committed
uhd: swig fix for stream args channel comprehension
* added %template entries for swig * added python qa tests for channels Tested on ubuntu 12.10 x64 Tested on ubuntu 11.04 x86
1 parent 0a8078a commit fa75f18

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

gr-uhd/python/qa_uhd.py

100755100644
+12
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,17 @@ def test_000_nop (self):
3636
They may not have a UHD device connected, etc. Don't try to run anything"""
3737
pass
3838

39+
def test_stream_args_channel_foo(self):
40+
"""
41+
Try to manipulate the stream args channels for proper swig'ing checks.
42+
"""
43+
sa = uhd_swig.stream_args_t()
44+
sa.channels.append(1)
45+
sa.channels.append(0)
46+
print sa.channels
47+
self.assertEqual(len(sa.channels), 2)
48+
self.assertEqual(sa.channels[0], 1)
49+
self.assertEqual(sa.channels[1], 0)
50+
3951
if __name__ == '__main__':
4052
gr_unittest.run(test_uhd, "test_uhd.xml")

gr-uhd/swig/uhd_swig.i

+4
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@
5050
// used types
5151
////////////////////////////////////////////////////////////////////////
5252

53+
%template(uhd_string_vector_t) std::vector<std::string>;
54+
55+
%template(uhd_size_vector_t) std::vector<size_t>;
56+
5357
%include <uhd/config.hpp>
5458

5559
%include <uhd/utils/pimpl.hpp>

0 commit comments

Comments
 (0)