summaryrefslogtreecommitdiffstats
path: root/test/wax_test.cpp
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-01-25 16:07:07 -0800
committerJosh Blum <josh@joshknows.com>2010-01-25 16:07:07 -0800
commit998aebf83c2796fdfabc2efd804ca14103adcaaf (patch)
tree7e3675ffc14e41e390369fdeca4b9d7643ae6834 /test/wax_test.cpp
parent069a7ce0570001ea3d9512a11d238ea4d6773f1d (diff)
downloaduhd-998aebf83c2796fdfabc2efd804ca14103adcaaf.tar.gz
uhd-998aebf83c2796fdfabc2efd804ca14103adcaaf.tar.bz2
uhd-998aebf83c2796fdfabc2efd804ca14103adcaaf.zip
Various tweaks, switched to boost unit testing.
Diffstat (limited to 'test/wax_test.cpp')
-rw-r--r--test/wax_test.cpp32
1 files changed, 6 insertions, 26 deletions
diff --git a/test/wax_test.cpp b/test/wax_test.cpp
index 0221f13b8..353130410 100644
--- a/test/wax_test.cpp
+++ b/test/wax_test.cpp
@@ -2,8 +2,8 @@
// Copyright 2010 Ettus Research LLC
//
+#include <boost/test/unit_test.hpp>
#include <usrp_uhd/wax.hpp>
-#include <cppunit/extensions/HelperMacros.h>
/***********************************************************************
* demo class for wax framework
@@ -40,29 +40,9 @@ public:
}
};
-/***********************************************************************
- * cpp unit setup
- **********************************************************************/
-class wax_test : public CppUnit::TestFixture{
- CPPUNIT_TEST_SUITE(wax_test);
- CPPUNIT_TEST(test_chaining);
- CPPUNIT_TEST(test_set_get);
- CPPUNIT_TEST(test_proxy);
- CPPUNIT_TEST(test_print);
- CPPUNIT_TEST_SUITE_END();
-
-public:
- void test_chaining(void);
- void test_set_get(void);
- void test_proxy(void);
- void test_print(void);
-};
-
-CPPUNIT_TEST_SUITE_REGISTRATION(wax_test);
-
static wax_demo wd(2, 10);
-void wax_test::test_chaining(void){
+BOOST_AUTO_TEST_CASE(test_chaining){
std::cout << "chain 1" << std::endl;
wd[size_t(0)];
std::cout << "chain 2" << std::endl;
@@ -71,7 +51,7 @@ void wax_test::test_chaining(void){
wd[size_t(0)][size_t(0)][size_t(0)];
}
-void wax_test::test_set_get(void){
+BOOST_AUTO_TEST_CASE(test_set_get){
std::cout << "set and get all" << std::endl;
for (size_t i = 0; i < 10; i++){
for (size_t j = 0; j < 10; j++){
@@ -79,19 +59,19 @@ void wax_test::test_set_get(void){
float val = i * j * k + i + j + k;
//std::cout << i << " " << j << " " << k << std::endl;
wd[i][j][k] = val;
- CPPUNIT_ASSERT_EQUAL(val, wax::cast<float>(wd[i][j][k]));
+ BOOST_CHECK_EQUAL(val, wax::cast<float>(wd[i][j][k]));
}
}
}
}
-void wax_test::test_proxy(void){
+BOOST_AUTO_TEST_CASE(test_proxy){
std::cout << "store proxy" << std::endl;
wax::proxy p = wd[size_t(0)][size_t(0)];
p[size_t(0)] = float(5);
}
-void wax_test::test_print(void){
+BOOST_AUTO_TEST_CASE(test_print){
std::cout << "print type" << std::endl;
wax::type test_type = float(3.33);
std::cout << test_type << std::endl;