aboutsummaryrefslogtreecommitdiffstats
path: root/host/tests/error_c_test.cpp
diff options
context:
space:
mode:
authorAshish Chaudhari <ashish@ettus.com>2015-08-12 16:33:26 -0700
committerAshish Chaudhari <ashish@ettus.com>2015-08-12 16:33:26 -0700
commitd745b5cf6d9a918be141339ceca5fbf9d6259eab (patch)
treee08c449fe7041b734cd537cdca06f68dac219387 /host/tests/error_c_test.cpp
parent094bf7607362b08663c1b94ca05432da519036c5 (diff)
parentbc9dd05988454428de1b6efd235d980b8eaa9afe (diff)
downloaduhd-d745b5cf6d9a918be141339ceca5fbf9d6259eab.tar.gz
uhd-d745b5cf6d9a918be141339ceca5fbf9d6259eab.tar.bz2
uhd-d745b5cf6d9a918be141339ceca5fbf9d6259eab.zip
Merge branch 'master' into ashish/register_api
Diffstat (limited to 'host/tests/error_c_test.cpp')
-rw-r--r--host/tests/error_c_test.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/host/tests/error_c_test.cpp b/host/tests/error_c_test.cpp
index bb9454678..8eb90f3d4 100644
--- a/host/tests/error_c_test.cpp
+++ b/host/tests/error_c_test.cpp
@@ -82,10 +82,11 @@ static const uhd::dict<std::string, std::string> pretty_exception_names =
uhd::cpp_exception_type cpp_exception_type ## _foo(expected_msg); \
error_code = throw_uhd_exception<uhd::cpp_exception_type>(&handle, &cpp_exception_type ## _foo); \
BOOST_CHECK_EQUAL(error_code, c_error_code); \
- BOOST_CHECK_EQUAL(handle.last_error, \
- str(boost::format("%s: %s") \
- % pretty_exception_names.get(BOOST_STRINGIZE(cpp_exception_type)) \
- % expected_msg));
+ expected_msg = str(boost::format("%s: %s") \
+ % pretty_exception_names.get(BOOST_STRINGIZE(cpp_exception_type)) \
+ % expected_msg); \
+ BOOST_CHECK_EQUAL(handle.last_error, expected_msg); \
+ BOOST_CHECK_EQUAL(get_c_global_error_string(), expected_msg);
// uhd::usb_error has a different constructor
#define UHD_TEST_CHECK_USB_ERROR_CODE() \
@@ -93,10 +94,11 @@ static const uhd::dict<std::string, std::string> pretty_exception_names =
uhd::usb_error usb_error_foo(1, expected_msg); \
error_code = throw_uhd_exception<uhd::usb_error>(&handle, &usb_error_foo); \
BOOST_CHECK_EQUAL(error_code, UHD_ERROR_USB); \
- BOOST_CHECK_EQUAL(handle.last_error, \
- str(boost::format("%s: %s") \
- % pretty_exception_names.get("usb_error") \
- % expected_msg));
+ expected_msg = str(boost::format("%s: %s") \
+ % pretty_exception_names.get("usb_error") \
+ % expected_msg); \
+ BOOST_CHECK_EQUAL(handle.last_error, expected_msg); \
+ BOOST_CHECK_EQUAL(get_c_global_error_string(), expected_msg);
BOOST_AUTO_TEST_CASE(test_uhd_exception){
dummy_handle_t handle;