diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2019-07-30 10:51:52 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2019-07-30 11:08:24 +0200 |
commit | 31ffc7bf2a0efe40116764a8c84939d2df4cdeae (patch) | |
tree | 9794916f1815b58d17e8e4201aa4ee4e7474f757 /tests/auto/corelib/serialization | |
parent | 23841083e33c85baed3441c7cc80dafcf5bea0d9 (diff) |
Fix removal of QJsonObject properties when assigning undefined
Commit 8010e906d3612aface0daccde41d1a65fca04b0c accidentally ended up
removing the removal-on-undefined-insertion check by calling insertAt
instead of insert, which had it. This patch moves the check back into
setValueAt.
Change-Id: Ic381e284d3da37e31c4eb29f79dfab9c55c2e3e9
Fixes: QTBUG-77204
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'tests/auto/corelib/serialization')
-rw-r--r-- | tests/auto/corelib/serialization/json/tst_qtjson.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/auto/corelib/serialization/json/tst_qtjson.cpp b/tests/auto/corelib/serialization/json/tst_qtjson.cpp index 7b055b5b63..57aa67c142 100644 --- a/tests/auto/corelib/serialization/json/tst_qtjson.cpp +++ b/tests/auto/corelib/serialization/json/tst_qtjson.cpp @@ -1132,6 +1132,8 @@ void tst_QtJson::undefinedValues() QJsonObject object; object.insert("Key", QJsonValue(QJsonValue::Undefined)); QCOMPARE(object.size(), 0); + object["Key"] = QJsonValue(QJsonValue::Undefined); + QCOMPARE(object.size(), 0); object.insert("Key", QLatin1String("Value")); QCOMPARE(object.size(), 1); |