diff options
author | Josh Blum <josh@joshknows.com> | 2010-01-25 16:07:07 -0800 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-01-25 16:07:07 -0800 |
commit | 998aebf83c2796fdfabc2efd804ca14103adcaaf (patch) | |
tree | 7e3675ffc14e41e390369fdeca4b9d7643ae6834 /test/usrp_dboard_test.cpp | |
parent | 069a7ce0570001ea3d9512a11d238ea4d6773f1d (diff) | |
download | uhd-998aebf83c2796fdfabc2efd804ca14103adcaaf.tar.gz uhd-998aebf83c2796fdfabc2efd804ca14103adcaaf.tar.bz2 uhd-998aebf83c2796fdfabc2efd804ca14103adcaaf.zip |
Various tweaks, switched to boost unit testing.
Diffstat (limited to 'test/usrp_dboard_test.cpp')
-rw-r--r-- | test/usrp_dboard_test.cpp | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/test/usrp_dboard_test.cpp b/test/usrp_dboard_test.cpp index 8d8b1de4a..1e89f36f9 100644 --- a/test/usrp_dboard_test.cpp +++ b/test/usrp_dboard_test.cpp @@ -2,8 +2,8 @@ // Copyright 2010 Ettus Research LLC // +#include <boost/test/unit_test.hpp> #include <usrp_uhd/usrp/dboard/manager.hpp> -#include <cppunit/extensions/HelperMacros.h> using namespace usrp_uhd::usrp::dboard; @@ -26,21 +26,7 @@ public: std::string read_spi (spi_dev_t, spi_latch_t, size_t){return "";} }; -/*********************************************************************** - * cpp unit setup - **********************************************************************/ -class dboard_test : public CppUnit::TestFixture{ - CPPUNIT_TEST_SUITE(dboard_test); - CPPUNIT_TEST(test_manager); - CPPUNIT_TEST_SUITE_END(); - -public: - void test_manager(void); -}; - -CPPUNIT_TEST_SUITE_REGISTRATION(dboard_test); - -void dboard_test::test_manager(void){ +BOOST_AUTO_TEST_CASE(test_manager){ std::cout << "Making a dummy usrp dboard interface..." << std::endl; interface::sptr ifc0(new dummy_interface()); @@ -48,12 +34,12 @@ void dboard_test::test_manager(void){ manager::sptr mgr0(new manager(0x0001, 0x0000, ifc0)); //basic rx, basic tx std::cout << "Testing the dboard manager..." << std::endl; - CPPUNIT_ASSERT_EQUAL(size_t(3), mgr0->get_num_rx_subdevs()); - CPPUNIT_ASSERT_EQUAL(size_t(1), mgr0->get_num_tx_subdevs()); + BOOST_CHECK_EQUAL(size_t(3), mgr0->get_num_rx_subdevs()); + BOOST_CHECK_EQUAL(size_t(1), mgr0->get_num_tx_subdevs()); std::cout << "Testing access (will fail later when db code filled in)..." << std::endl; - CPPUNIT_ASSERT_THROW(mgr0->get_rx_subdev(3), std::out_of_range); - CPPUNIT_ASSERT_THROW(mgr0->get_tx_subdev(1), std::out_of_range); + BOOST_CHECK_THROW(mgr0->get_rx_subdev(3), std::out_of_range); + BOOST_CHECK_THROW(mgr0->get_tx_subdev(1), std::out_of_range); (*mgr0->get_rx_subdev(0))[NULL]; (*mgr0->get_tx_subdev(0))[NULL]; } |