From a5bb0860caf443cb89a7d4b67a040485e7509e74 Mon Sep 17 00:00:00 2001 From: Sune Vuorela Date: Mon, 15 Jun 2015 20:03:54 +0200 Subject: Unittest of reading config data from qt resource REVIEW: 124098 --- autotests/ksharedconfigtest.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'autotests/ksharedconfigtest.cpp') diff --git a/autotests/ksharedconfigtest.cpp b/autotests/ksharedconfigtest.cpp index c22623b4..ae3d40a2 100644 --- a/autotests/ksharedconfigtest.cpp +++ b/autotests/ksharedconfigtest.cpp @@ -30,6 +30,7 @@ private Q_SLOTS: void testUnicity(); void testReadWrite(); void testReadWriteSync(); + void testQrcFile(); private: QString m_path; }; @@ -79,6 +80,16 @@ void KSharedConfigTest::testReadWriteSync() } } +void KSharedConfigTest::testQrcFile() +{ + QVERIFY(QFile::exists(QStringLiteral(":/testdata/test.ini"))); + KSharedConfig::Ptr sharedConfig = KSharedConfig::openConfig(QStringLiteral(":/testdata/test.ini"), KConfig::NoGlobals); + QVERIFY(sharedConfig); + + KConfigGroup cfg(sharedConfig, QStringLiteral("MainSection")); + QCOMPARE(cfg.readEntry(QStringLiteral("TestEntry"), QStringLiteral("UnexpectedData")), QStringLiteral("ExpectedData")); +} + QTEST_MAIN(KSharedConfigTest) #include "ksharedconfigtest.moc" -- cgit v1.2.1