From e483b9bf378fc157631e57dc23b45659bb6512c2 Mon Sep 17 00:00:00 2001 From: Ali Akhtarzada Date: Mon, 7 May 2012 18:09:39 +0200 Subject: 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 Reviewed-by: Lars Knoll --- tests/auto/corelib/json/tst_qtjson.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests/auto/corelib') 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() -- cgit v1.2.3