mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2024-12-13 10:22:55 +01:00
Fixed a test that causes a crash when exceptions are disabled.
While I was at it, corrected whitespace too.
This commit is contained in:
parent
68db655347
commit
5d32295a6e
@ -1463,14 +1463,16 @@ ValueTest::checkIsEqual( const Json::Value &x, const Json::Value &y )
|
|||||||
|
|
||||||
JSONTEST_FIXTURE( ValueTest, checkInteger )
|
JSONTEST_FIXTURE( ValueTest, checkInteger )
|
||||||
{
|
{
|
||||||
try {
|
#if JSON_USE_EXCEPTION
|
||||||
Json::Value x = 1;
|
try {
|
||||||
x["key"]; // SIGABRT?
|
Json::Value x = 1;
|
||||||
// regression for https://sourceforge.net/p/jsoncpp/bugs/67/
|
x["key"]; // SIGABRT?
|
||||||
JSONTEST_ASSERT( 0 );
|
// regression for https://sourceforge.net/p/jsoncpp/bugs/67/
|
||||||
} catch (std::runtime_error const&) {
|
JSONTEST_ASSERT( 0 );
|
||||||
JSONTEST_ASSERT( 1 ); // good
|
} catch (std::runtime_error const&) {
|
||||||
}
|
JSONTEST_ASSERT( 1 ); // good
|
||||||
|
}
|
||||||
|
#endif // JSON_USE_EXCEPTION
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user