From e1ee47eaef71ffa0519843c5022d1d239512b866 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Wed, 26 Oct 2016 14:28:59 +0200 Subject: converterTest: add conversion to GVariant and back to verify content is correct --- tests/client/convertertest.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'tests/client') 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; -- cgit v1.2.3