From eb7e709b7aff162cc7c8f9b8004089846839ffbe Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Wed, 17 Feb 2010 00:41:38 -0800 Subject: moved host code into host directory for clean (unambiguous) top level --- host/test/device_test.cpp | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 host/test/device_test.cpp (limited to 'host/test/device_test.cpp') diff --git a/host/test/device_test.cpp b/host/test/device_test.cpp new file mode 100644 index 000000000..6373ff41b --- /dev/null +++ b/host/test/device_test.cpp @@ -0,0 +1,44 @@ +// +// Copyright 2010 Ettus Research LLC +// +// This program 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 of the License, or +// (at your option) any later version. +// +// This program 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 this program. If not, see . +// + +#include +#include + +using namespace uhd; + +BOOST_AUTO_TEST_CASE(test_device){ + device_addr_t device_addr; + device_addr["type"] = "test"; + device_addr["num_dboards"] = "2"; + device::sptr dev = device::make(device_addr); + + std::cout << "Access the device" << std::endl; + std::cout << wax::cast((*dev)[DEVICE_PROP_NAME]) << std::endl; + + std::cout << "Access the mboard" << std::endl; + wax::obj mb0 = (*dev)[DEVICE_PROP_MBOARD]; + std::cout << wax::cast(mb0[MBOARD_PROP_NAME]) << std::endl; + BOOST_CHECK_EQUAL( + 2, + wax::cast(mb0[MBOARD_PROP_RX_DBOARD_NAMES]).size() + ); + BOOST_CHECK_EQUAL( + 2, + wax::cast(mb0[MBOARD_PROP_TX_DBOARD_NAMES]).size() + ); + +} -- cgit v1.2.3