summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAli Akhtarzada <ali.akhtarzada@nokia.com>2012-05-07 18:09:39 +0200
committerQt by Nokia <qt-info@nokia.com>2012-05-08 09:27:30 +0200
commite483b9bf378fc157631e57dc23b45659bb6512c2 (patch)
tree8d7553479ec57831b0b88ae9a9d2dd2fc1a3c05b /tests
parent427fe6c2fdd33d86a254af937cf12df2a7ad28ec (diff)
Add assignment operator for QJsonValueRef
The implicit cast to QJsonValue was being ignored probably because the compiler was generating a default QJsonValueRef assignment operator Change-Id: I3a041595497308868dd7e4aab71027ce21bf8f0b Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/corelib/json/tst_qtjson.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/auto/corelib/json/tst_qtjson.cpp b/tests/auto/corelib/json/tst_qtjson.cpp
index 73b79b1607..7a11b5aec2 100644
--- a/tests/auto/corelib/json/tst_qtjson.cpp
+++ b/tests/auto/corelib/json/tst_qtjson.cpp
@@ -550,6 +550,11 @@ void TestQtJson::testValueRef()
QJsonValue val = object[QLatin1String("null")];
QCOMPARE(val.toDouble(), 100.);
QCOMPARE(object.size(), 2);
+
+ array[1] = array[2] = object[QLatin1String("key")] = 42;
+ QCOMPARE(array[1], array[2]);
+ QCOMPARE(array[2], object[QLatin1String("key")]);
+ QCOMPARE(object.value(QLatin1String("key")), QJsonValue(42));
}
void TestQtJson::testObjectIteration()