diff options
author | Josh Blum <josh@joshknows.com> | 2013-05-22 15:29:49 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2013-05-22 15:29:49 -0700 |
commit | fa75f18dc4d347bd7d5a1595b162395f773858d3 (patch) | |
tree | 15a2b5c9ee855334c3330c144308c11da88d1307 | |
parent | 0a8078a57237fcc12f4a51f6d217c54031cc904d (diff) |
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
-rw-r--r--[-rwxr-xr-x] | gr-uhd/python/qa_uhd.py | 12 | ||||
-rw-r--r-- | gr-uhd/swig/uhd_swig.i | 4 |
2 files changed, 16 insertions, 0 deletions
diff --git a/gr-uhd/python/qa_uhd.py b/gr-uhd/python/qa_uhd.py index 00757369ff..dafae926c5 100755..100644 --- a/gr-uhd/python/qa_uhd.py +++ b/gr-uhd/python/qa_uhd.py @@ -36,5 +36,17 @@ class test_uhd(gr_unittest.TestCase): They may not have a UHD device connected, etc. Don't try to run anything""" pass + def test_stream_args_channel_foo(self): + """ + Try to manipulate the stream args channels for proper swig'ing checks. + """ + sa = uhd_swig.stream_args_t() + sa.channels.append(1) + sa.channels.append(0) + print sa.channels + self.assertEqual(len(sa.channels), 2) + self.assertEqual(sa.channels[0], 1) + self.assertEqual(sa.channels[1], 0) + if __name__ == '__main__': gr_unittest.run(test_uhd, "test_uhd.xml") diff --git a/gr-uhd/swig/uhd_swig.i b/gr-uhd/swig/uhd_swig.i index 28d1a7cf61..9f7e6a9eeb 100644 --- a/gr-uhd/swig/uhd_swig.i +++ b/gr-uhd/swig/uhd_swig.i @@ -50,6 +50,10 @@ // used types //////////////////////////////////////////////////////////////////////// +%template(uhd_string_vector_t) std::vector<std::string>; + +%template(uhd_size_vector_t) std::vector<size_t>; + %include <uhd/config.hpp> %include <uhd/utils/pimpl.hpp> |