mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2025-10-15 23:20:05 +02:00
Allow Json::Value to be used in a boolean context (#695)
Must bump soversion too.
This commit is contained in:

committed by
Christopher Dunn

parent
c39aa295e4
commit
9079422ac1
@@ -308,6 +308,12 @@ JSONTEST_FIXTURE(ValueTest, null) {
|
||||
JSONTEST_ASSERT_STRING_EQUAL("", null_.asString());
|
||||
|
||||
JSONTEST_ASSERT_EQUAL(Json::Value::null, null_);
|
||||
|
||||
// Test using a Value in a boolean context (false iff null)
|
||||
JSONTEST_ASSERT_EQUAL(null_,false);
|
||||
JSONTEST_ASSERT_EQUAL(object1_,true);
|
||||
JSONTEST_ASSERT_EQUAL(!null_,true);
|
||||
JSONTEST_ASSERT_EQUAL(!object1_,false);
|
||||
}
|
||||
|
||||
JSONTEST_FIXTURE(ValueTest, strings) {
|
||||
|
Reference in New Issue
Block a user