From 07d5ef529bda80376995de1b2241b66c7c768fcb Mon Sep 17 00:00:00 2001 From: Emil Dotchevski Date: Tue, 3 Jan 2017 00:00:52 -0800 Subject: [PATCH] Added error_info_basic_test.cpp to test ticket 11874 --- test/Jamfile.v2 | 1 + test/error_info_basic_test.cpp | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 test/error_info_basic_test.cpp diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index e7cf00d..53d277f 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -34,6 +34,7 @@ run exception_test.cpp ; run enable_error_info_test.cpp helper1.cpp ; run throw_exception_test.cpp helper2.cpp ; run errno_test.cpp ; +run error_info_basic_test.cpp ; run error_info_lv_test.cpp ; run error_info_lv_const_test.cpp ; run error_info_rv_test.cpp ; diff --git a/test/error_info_basic_test.cpp b/test/error_info_basic_test.cpp new file mode 100644 index 0000000..45d2fcf --- /dev/null +++ b/test/error_info_basic_test.cpp @@ -0,0 +1,28 @@ +//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. + +//Distributed under the Boost Software License, Version 1.0. (See accompanying +//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include +#include +#include + +struct my_exception: virtual boost::exception {}; +typedef boost::error_info error_info_string; + +int +main() + { + try + { + throw my_exception() << error_info_string("doh"); + } + catch( my_exception & e ) + { + BOOST_TEST(boost::get_error_info(e) && !strcmp(boost::get_error_info(e)->c_str(),"doh")); + } + return 0; + }