diff options
author | lloyd <[email protected]> | 2008-10-11 19:10:35 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2008-10-11 19:10:35 +0000 |
commit | 92d468fd255ea97bdac18594334386215c96a5a2 (patch) | |
tree | 0053e5963cca16164ec79f0d0c9ca12a31586173 /doc/examples | |
parent | 6378c18eabf9e41b6ea2d114c397ed139456c039 (diff) |
Catch and print exceptions in the CHECK macros
Diffstat (limited to 'doc/examples')
-rw-r--r-- | doc/examples/ecdsa_tests.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/doc/examples/ecdsa_tests.cpp b/doc/examples/ecdsa_tests.cpp index dd50b76af..ad57b8e13 100644 --- a/doc/examples/ecdsa_tests.cpp +++ b/doc/examples/ecdsa_tests.cpp @@ -27,8 +27,8 @@ using namespace Botan; using namespace std; #define BOOST_AUTO_TEST_CASE(name) void name() -#define BOOST_CHECK_MESSAGE(expr, print) if(!(expr)) std::cout << print << "\n"; -#define BOOST_CHECK(expr) if(!(expr)) std::cout << #expr << "\n"; +#define BOOST_CHECK_MESSAGE(expr, print) try { if(!(expr)) std::cout << print << "\n"; } catch(std::exception& e) { std::cout << __FUNCTION__ << ": " << e.what() << "\n"; } +#define BOOST_CHECK(expr) try { if(!(expr)) std::cout << #expr << "\n"; } catch(std::exception& e) { std::cout << __FUNCTION__ << ": " << e.what() << "\n"; } namespace { @@ -590,8 +590,8 @@ BOOST_AUTO_TEST_CASE( test_non_init_ecdsa_keys ) int main() { - Botan::InitializerOptions init_options(""); - Botan::LibraryInitializer init(init_options); + Botan::InitializerOptions init_options(""); + Botan::LibraryInitializer init(init_options); test_hash_larger_than_n(); test_message_larger_than_n(); |