aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMarco Trevisan (Treviño) <mail@3v1n0.net>2016-10-18 16:09:51 +0200
committerMarco Trevisan (Treviño) <mail@3v1n0.net>2016-10-18 16:09:51 +0200
commitd3899e64d6c24337d1547854da7e3cb9499d9d14 (patch)
treebabe5d057584323ffa8e9909c533c39b5257e8b3 /tests
parent36681ba81d33e3c1e66bef49450f4e7008154b61 (diff)
downloadqmenumodel-d3899e64d6c24337d1547854da7e3cb9499d9d14.tar.gz
qmenumodel-d3899e64d6c24337d1547854da7e3cb9499d9d14.tar.bz2
qmenumodel-d3899e64d6c24337d1547854da7e3cb9499d9d14.zip
convertertest: add conversion from map to qvariant check
Diffstat (limited to 'tests')
-rw-r--r--tests/client/convertertest.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/client/convertertest.cpp b/tests/client/convertertest.cpp
index 933ed2f..89e1de4 100644
--- a/tests/client/convertertest.cpp
+++ b/tests/client/convertertest.cpp
@@ -246,10 +246,19 @@ private Q_SLOTS:
void testByteArrayListToQVariant()
{
// ByteArrayList
- const gchar * byteArray[] = {"42", "53", NULL};
+ const gchar *byteArray[] = {"42", "53", NULL};
QVERIFY(compare(g_variant_new_bytestring_array(byteArray, -1), QMetaType::QByteArrayList));
}
+ void testMapToQVariant()
+ {
+ // Map
+ GVariantBuilder *b = g_variant_builder_new(G_VARIANT_TYPE_VARDICT);
+ g_variant_builder_add(b, "{sv}", "Foo", g_variant_new_int32(53));
+ QVERIFY(compare(g_variant_builder_end(b), QVariant::Map));
+ g_variant_builder_unref(b);
+ }
+
void testTupleConversion()
{
QVariantList qTuple;