summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/serialization/json
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2021-11-27 11:27:51 -0600
committerThiago Macieira <thiago.macieira@intel.com>2022-02-15 17:00:04 -0800
commitdccd1e87f556c4c88044fa0c8a1c2f4f4c151f59 (patch)
tree3858f95c2c89c2069e2489b1562e0bf8811087fd /tests/auto/corelib/serialization/json
parente99417106f4a2a7ef75cdf3317d950c30ad78ebe (diff)
QJsonValueConcreteRef: optimize concrete()
Inline the content to avoid a round-trip through qjsonarray.cpp and qjsonobject.cpp. This change revealed an inadviseable unit test check that dereferences the end() iterator to get its type. I haven't changed it, but have marked with ###. I also fixed a likely copy&paste mistake in that test. Change-Id: I89446ea06b5742efb194fffd16bb774f3bfbe5f5 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'tests/auto/corelib/serialization/json')
-rw-r--r--tests/auto/corelib/serialization/json/tst_qtjson.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/tests/auto/corelib/serialization/json/tst_qtjson.cpp b/tests/auto/corelib/serialization/json/tst_qtjson.cpp
index 1b6148429f..98e1782840 100644
--- a/tests/auto/corelib/serialization/json/tst_qtjson.cpp
+++ b/tests/auto/corelib/serialization/json/tst_qtjson.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2021 The Qt Company Ltd.
-** Copyright (C) 2021 Intel Corporation.
+** Copyright (C) 2022 Intel Corporation.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
@@ -1226,14 +1226,12 @@ void tst_QtJson::testObjectFind()
QJsonObject::iterator it = object.find(QLatin1String("1"));
QCOMPARE((*it).toDouble(), 1.);
it = object.find(QString("11"));
- QCOMPARE((*it).type(), QJsonValue::Undefined);
QCOMPARE(it, object.end());
QJsonObject::const_iterator cit = object.constFind(QLatin1String("1"));
QCOMPARE((*cit).toDouble(), 1.);
cit = object.constFind(QString("11"));
- QCOMPARE((*it).type(), QJsonValue::Undefined);
- QCOMPARE(it, object.end());
+ QCOMPARE(cit, object.constEnd());
}
void tst_QtJson::testDocument()