File tree 1 file changed +18
-0
lines changed
1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -1515,6 +1515,24 @@ JSONTEST_FIXTURE(ValueTest, CopyObject) {
1515
1515
JSONTEST_ASSERT (copy1 == " string value" );
1516
1516
copy2.copy (arrayVal);
1517
1517
JSONTEST_ASSERT (copy2.size () == 5 );
1518
+ {
1519
+ Json::Value srcObject, objectCopy, otherObject;
1520
+ srcObject[" key0" ] = 10 ;
1521
+ objectCopy.copy (srcObject);
1522
+ JSONTEST_ASSERT (srcObject[" key0" ] == 10 );
1523
+ JSONTEST_ASSERT (objectCopy[" key0" ] == 10 );
1524
+ JSONTEST_ASSERT (srcObject.getMemberNames ().size () == 1 );
1525
+ JSONTEST_ASSERT (objectCopy.getMemberNames ().size () == 1 );
1526
+ otherObject[" key1" ] = 15 ;
1527
+ otherObject[" key2" ] = 16 ;
1528
+ JSONTEST_ASSERT (otherObject.getMemberNames ().size () == 2 );
1529
+ objectCopy.copy (otherObject);
1530
+ JSONTEST_ASSERT (objectCopy[" key1" ] == 15 );
1531
+ JSONTEST_ASSERT (objectCopy[" key2" ] == 16 );
1532
+ JSONTEST_ASSERT (objectCopy.getMemberNames ().size () == 2 );
1533
+ otherObject[" key1" ] = 20 ;
1534
+ JSONTEST_ASSERT (objectCopy[" key1" ] == 15 );
1535
+ }
1518
1536
}
1519
1537
1520
1538
void ValueTest::checkIsLess (const Json::Value& x, const Json::Value& y) {
You can’t perform that action at this time.
0 commit comments