From 5d32295a6e991bac6e38ec2f315131e4afd104d4 Mon Sep 17 00:00:00 2001 From: Aaron Jacobs Date: Wed, 23 Apr 2014 23:57:59 +0000 Subject: [PATCH] Fixed a test that causes a crash when exceptions are disabled. While I was at it, corrected whitespace too. --- src/test_lib_json/main.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/test_lib_json/main.cpp b/src/test_lib_json/main.cpp index f82a384..8c5a20b 100644 --- a/src/test_lib_json/main.cpp +++ b/src/test_lib_json/main.cpp @@ -1463,14 +1463,16 @@ ValueTest::checkIsEqual( const Json::Value &x, const Json::Value &y ) JSONTEST_FIXTURE( ValueTest, checkInteger ) { - try { - Json::Value x = 1; - x["key"]; // SIGABRT? - // regression for https://sourceforge.net/p/jsoncpp/bugs/67/ - JSONTEST_ASSERT( 0 ); - } catch (std::runtime_error const&) { - JSONTEST_ASSERT( 1 ); // good - } +#if JSON_USE_EXCEPTION + try { + Json::Value x = 1; + x["key"]; // SIGABRT? + // regression for https://sourceforge.net/p/jsoncpp/bugs/67/ + JSONTEST_ASSERT( 0 ); + } catch (std::runtime_error const&) { + JSONTEST_ASSERT( 1 ); // good + } +#endif // JSON_USE_EXCEPTION }