qt5base-lts/tests/auto/corelib/serialization/json
Thiago Macieira e99417106f QJsonObject::erase: erase unnecessary and wrong code
Commit 35adb74ddd ("Reimplement JSON
support on top of Cbor") accidentally forgot to multiply by 2 the index
stored in the QJsonObject::iterator. The same mistake was propagated
when QJsonObject::iterator was converted to QJsonValueRef. This had no
ill effects because the o->elements container would always contain more
elements, but it meant the check was ineffective and meant nothing.

So instead of doing nothing when the iterator does not point to this
container, simply assume it does. Bad things will happen if you try to
erase an iterator that points to another container, but that's true for
almost all container/iterator mechanisms.

Drive-by modernization of some of the surrounding lines.

Change-Id: I89446ea06b5742efb194fffd16bb7c322c2fc4f2
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-02-15 17:00:04 -08:00
..
bom.json Create corelib/serialization and move existing file formats into it 2018-01-26 20:59:50 +00:00
CMakeLists.txt Cleanup tests that add test data to resources explicitly 2022-02-11 21:54:44 +01:00
simple.duplicates.json JSON: Further improve the duplicate handling in the parser 2022-01-21 00:53:49 +01:00
test2.json Create corelib/serialization and move existing file formats into it 2018-01-26 20:59:50 +00:00
test3.duplicates.json JSON: Further improve the duplicate handling in the parser 2022-01-21 00:53:49 +01:00
test3.json Create corelib/serialization and move existing file formats into it 2018-01-26 20:59:50 +00:00
test.duplicates.json JSON: Further improve the duplicate handling in the parser 2022-01-21 00:53:49 +01:00
test.json Create corelib/serialization and move existing file formats into it 2018-01-26 20:59:50 +00:00
tst_qtjson.cpp QJsonObject::erase: erase unnecessary and wrong code 2022-02-15 17:00:04 -08:00