aboutsummaryrefslogtreecommitdiffstats
path: root/host/tests
diff options
context:
space:
mode:
Diffstat (limited to 'host/tests')
-rw-r--r--host/tests/error_test.cpp13
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);