From 4066b1f8fd87b1bca747d5b37a0b28179e188756 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Thu, 24 Feb 2011 14:07:11 -0800 Subject: uhd: added a bunch of custom exceptions, not used yet --- host/tests/error_test.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'host/tests') 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 +#include #include #include #include +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 vec; vec.push_back(2); -- cgit v1.2.3