diff options
author | Josh Blum <josh@joshknows.com> | 2011-02-24 14:07:11 -0800 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2011-02-24 14:07:11 -0800 |
commit | 4066b1f8fd87b1bca747d5b37a0b28179e188756 (patch) | |
tree | fda9e4d0c8d7232e891b9c46cf97384586daa153 /host/tests/error_test.cpp | |
parent | d588314b6f6205e0ea7051d8fc7836bdf9a6b16b (diff) | |
download | uhd-4066b1f8fd87b1bca747d5b37a0b28179e188756.tar.gz uhd-4066b1f8fd87b1bca747d5b37a0b28179e188756.tar.bz2 uhd-4066b1f8fd87b1bca747d5b37a0b28179e188756.zip |
uhd: added a bunch of custom exceptions, not used yet
Diffstat (limited to 'host/tests/error_test.cpp')
-rw-r--r-- | host/tests/error_test.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/host/tests/error_test.cpp b/host/tests/error_test.cpp index c76a15ab7..041e6b943 100644 --- a/host/tests/error_test.cpp +++ b/host/tests/error_test.cpp @@ -1,5 +1,5 @@ // -// Copyright 2010 Ettus Research LLC +// Copyright 2010-2011 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 @@ -16,10 +16,21 @@ // #include <boost/test/unit_test.hpp> +#include <uhd/utils/exception.hpp> #include <uhd/utils/assert.hpp> #include <vector> #include <iostream> +BOOST_AUTO_TEST_CASE(test_exception_methods){ + try{ + throw uhd::assertion_error("your assertion failed: 1 != 2"); + } + catch(const uhd::exception &e){ + std::cout << "what: " << e.what() << std::endl; + std::cout << "code: " << e.code() << std::endl; + } +} + BOOST_AUTO_TEST_CASE(test_assert_has){ std::vector<int> vec; vec.push_back(2); |