aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMarco Trevisan (Treviño) <mail@3v1n0.net>2016-10-26 14:28:59 +0200
committerMarco Trevisan (Treviño) <mail@3v1n0.net>2016-10-26 14:28:59 +0200
commite1ee47eaef71ffa0519843c5022d1d239512b866 (patch)
tree66cbb0a7b385b0549ff01c8cfad4669062b3213b /tests
parentd56d0baefd53a8c7f3a9cd10fcaaeef1826e7d06 (diff)
downloadqmenumodel-e1ee47eaef71ffa0519843c5022d1d239512b866.tar.gz
qmenumodel-e1ee47eaef71ffa0519843c5022d1d239512b866.tar.bz2
qmenumodel-e1ee47eaef71ffa0519843c5022d1d239512b866.zip
converterTest: add conversion to GVariant and back to verify content is correct
Diffstat (limited to 'tests')
-rw-r--r--tests/client/convertertest.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/client/convertertest.cpp b/tests/client/convertertest.cpp
index 5492a02..bc10f10 100644
--- a/tests/client/convertertest.cpp
+++ b/tests/client/convertertest.cpp
@@ -148,6 +148,24 @@ private Q_SLOTS:
QVERIFY(compare(value, expectedType));
}
+ void testConvertToGVariantAndBack_data()
+ {
+ testConvertToGVariant_data();
+ }
+
+ void testConvertToGVariantAndBack()
+ {
+ QFETCH(QVariant, value);
+ QFETCH(QGVariantType, expectedType);
+
+ GVariant *gv = Converter::toGVariant(value);
+ QVERIFY(gv != NULL);
+
+ QCOMPARE(Converter::toQVariant(gv), value);
+
+ g_variant_unref(gv);
+ }
+
void testTupleConversion()
{
QVariantList qTuple;