From a98d5486c37d68e1c1ce8fc1b6ad0a9018dd534d Mon Sep 17 00:00:00 2001 From: Renato Araujo Oliveira Filho Date: Mon, 15 Oct 2012 17:22:27 -0300 Subject: Created unit test for QVariantMap conversion; --- tests/client/modeltest.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests/client/modeltest.cpp') diff --git a/tests/client/modeltest.cpp b/tests/client/modeltest.cpp index 9f6ee76..ebcec34 100644 --- a/tests/client/modeltest.cpp +++ b/tests/client/modeltest.cpp @@ -202,6 +202,16 @@ private Q_SLOTS: v = extra["string"]; QCOMPARE(v.type(), QVariant::String); QCOMPARE(v.toString(), QString("42")); + + // Map + v = extra["map"]; + QVariantMap map; + map.insert("int64", QVariant::fromValue(-42)); + map.insert("string", "42"); + map.insert("double", 42.42); + + QCOMPARE(v.type(), QVariant::Map); + QCOMPARE(v.toMap(), map); } }; -- cgit v1.2.3