on xenial help sign in
Dbus encode/decode test
89023c3Ted Gould
tests/plugins/Unity/Launcher/launcherbackendtest.cpp+19
@@ -102,6 +102,25 @@ private Q_SLOTS:
102
102
103 QCOMPARE(backend.count(appId), expectedCount);
103 QCOMPARE(backend.count(appId), expectedCount);
104 }
104 }
105+
106+ void testDbusName_data() {
107+ QTest::addColumn<QString>("decoded");
108+ QTest::addColumn<QString>("encoded");
109+
110+ /* Passthrough test */
111+ QTest::newRow("Passthrough") << "fine" << "fine";
112+ }
113+
114+ void testDbusName() {
115+ QFETCH(QString, decoded);
116+ QFETCH(QString, encoded);
117+
118+ QString decodeOut = LauncherBackend::decodeAppId(encoded);
119+ QCOMPARE(decoded, decodeOut);
120+
121+ QString encodeOut = LauncherBackend::encodeAppId(encoded);
122+ QCOMPARE(encoded, encodeOut);
123+ }
105};
124};
106
125
107QTEST_GUILESS_MAIN(LauncherBackendTest)
126QTEST_GUILESS_MAIN(LauncherBackendTest)