aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-01-21 15:30:34 -0800
committerJosh Blum <josh@joshknows.com>2010-01-21 15:30:34 -0800
commite3483c7451d20b7ed1d8d4865e15751f18cdef78 (patch)
treef309a95a1b0ecd3dc3295ebc71ee5ad697c9f7a8 /test
parent5b42b774d9ac1e74fb2916bf58085fe19ecb6720 (diff)
downloaduhd-e3483c7451d20b7ed1d8d4865e15751f18cdef78.tar.gz
uhd-e3483c7451d20b7ed1d8d4865e15751f18cdef78.tar.bz2
uhd-e3483c7451d20b7ed1d8d4865e15751f18cdef78.zip
Added a usrp device abstration that creates usrp mboards.
Added a usrp mboard named test, its empty for now.
Diffstat (limited to 'test')
-rw-r--r--test/Makefile.am3
-rw-r--r--test/device_test.cpp31
2 files changed, 33 insertions, 1 deletions
diff --git a/test/Makefile.am b/test/Makefile.am
index bd32206bf..0fbb18bf8 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -20,8 +20,9 @@ LDADD = \
noinst_PROGRAMS = cppunit_test
cppunit_test_SOURCES = \
- cppunit_test.cpp \
addr_test.cpp \
+ device_test.cpp \
+ cppunit_test.cpp \
usrp_dboard_test.cpp \
wax_test.cpp
diff --git a/test/device_test.cpp b/test/device_test.cpp
new file mode 100644
index 000000000..bbcada3ab
--- /dev/null
+++ b/test/device_test.cpp
@@ -0,0 +1,31 @@
+//
+// Copyright 2010 Ettus Research LLC
+//
+
+#include <usrp_uhd/device.hpp>
+#include <cppunit/extensions/HelperMacros.h>
+
+/***********************************************************************
+ * cpp unit setup
+ **********************************************************************/
+class device_test : public CppUnit::TestFixture{
+ CPPUNIT_TEST_SUITE(device_test);
+ CPPUNIT_TEST(test);
+ CPPUNIT_TEST_SUITE_END();
+
+public:
+ void test(void);
+};
+
+CPPUNIT_TEST_SUITE_REGISTRATION(device_test);
+
+using namespace usrp_uhd;
+
+void device_test::test(void){
+ device_addr_t device_addr(DEVICE_ADDR_TYPE_VIRTUAL);
+ device_addr.virtual_args.num_dboards = 2;
+ device_addr.virtual_args.num_rx_dsps = 3;
+ device_addr.virtual_args.num_tx_dsps = 4;
+ device::sptr dev = device::make(device_addr);
+ std::cout << wax::cast<std::string>((*dev)[DEVICE_PROP_NAME]) << std::endl;
+}