diff options
Diffstat (limited to 'autotests')
| -rw-r--r-- | autotests/kconfig_compiler/test10.cpp.ref | 2 | ||||
| -rw-r--r-- | autotests/kconfig_compiler/test1main.cpp | 13 | ||||
| -rw-r--r-- | autotests/kconfig_compiler/test4.cpp.ref | 2 | ||||
| -rw-r--r-- | autotests/kconfig_compiler/test4main.cpp | 16 | ||||
| -rw-r--r-- | autotests/kconfig_compiler/test5.cpp.ref | 2 | ||||
| -rw-r--r-- | autotests/kconfig_compiler/test8b.cpp.ref | 2 | ||||
| -rw-r--r-- | autotests/kconfig_compiler/test_dpointer.cpp.ref | 2 | ||||
| -rw-r--r-- | autotests/kconfig_compiler/test_signal.cpp.ref | 2 | ||||
| -rw-r--r-- | autotests/kconfigskeletontest.cpp | 3 | 
9 files changed, 34 insertions, 10 deletions
diff --git a/autotests/kconfig_compiler/test10.cpp.ref b/autotests/kconfig_compiler/test10.cpp.ref index 21aea9d8..f067cc68 100644 --- a/autotests/kconfig_compiler/test10.cpp.ref +++ b/autotests/kconfig_compiler/test10.cpp.ref @@ -18,7 +18,7 @@ Test10 *Test10::self()  {    if (!s_globalTest10()->q) {      new Test10; -    s_globalTest10()->q->readConfig(); +    s_globalTest10()->q->read();    }    return s_globalTest10()->q; diff --git a/autotests/kconfig_compiler/test1main.cpp b/autotests/kconfig_compiler/test1main.cpp index d7dc038d..8ab7838c 100644 --- a/autotests/kconfig_compiler/test1main.cpp +++ b/autotests/kconfig_compiler/test1main.cpp @@ -20,12 +20,23 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.  */  #include "test1.h"  #include <QGuiApplication> +#include <KConfig> +#include <KConfigGroup>  int main(int argc, char **argv)  {      QGuiApplication app(argc, argv);      Q_UNUSED(app); + +    { +        KConfig initialConfig(QLatin1String("examplerc")); +        KConfigGroup group = initialConfig.group(QLatin1String("MyOptions")); +        group.writeEntry(QLatin1String("MyString"), QStringLiteral("The String")); +    }      Test1 *t = new Test1(QString(), QString()); + +    bool ok = t->myString() == QLatin1String("The String"); +      delete t; -    return 0; +    return ok ? 0 : 1;  } diff --git a/autotests/kconfig_compiler/test4.cpp.ref b/autotests/kconfig_compiler/test4.cpp.ref index 66d0357f..2199c166 100644 --- a/autotests/kconfig_compiler/test4.cpp.ref +++ b/autotests/kconfig_compiler/test4.cpp.ref @@ -18,7 +18,7 @@ Test4 *Test4::self()  {    if (!s_globalTest4()->q) {      new Test4; -    s_globalTest4()->q->readConfig(); +    s_globalTest4()->q->read();    }    return s_globalTest4()->q; diff --git a/autotests/kconfig_compiler/test4main.cpp b/autotests/kconfig_compiler/test4main.cpp index 8f1c1ec8..1df7cc5e 100644 --- a/autotests/kconfig_compiler/test4main.cpp +++ b/autotests/kconfig_compiler/test4main.cpp @@ -21,12 +21,26 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.  #include "test4.h"  #include <QGuiApplication> +#include <QStandardPaths> +#include <QFile>  int main(int argc, char **argv)  {      QGuiApplication app(argc, argv);      Q_UNUSED(app); +    { +        KConfig initialConfig(QLatin1String("test4rc")); +        KConfigGroup group = initialConfig.group(QLatin1String("Foo")); +        group.writeEntry(QLatin1String("foo bar"), QStringLiteral("Value")); +    }      Test4 *t = Test4::self(); +    bool ok = QFile::exists(QStandardPaths::writableLocation(QStandardPaths::ConfigLocation) + "/test4rc"); +    if (!ok) { +        qWarning() << "config file was not created!"; +    } +    if (t->fooBar() != QStringLiteral("Value")) { +        qWarning() << "wrong value for foo bar:" << t->fooBar(); +    }      delete t; -    return 0; +    return ok ? 0 : 1;  } diff --git a/autotests/kconfig_compiler/test5.cpp.ref b/autotests/kconfig_compiler/test5.cpp.ref index 088cc78f..323c1eee 100644 --- a/autotests/kconfig_compiler/test5.cpp.ref +++ b/autotests/kconfig_compiler/test5.cpp.ref @@ -18,7 +18,7 @@ Test5 *Test5::self()  {    if (!s_globalTest5()->q) {      new Test5; -    s_globalTest5()->q->readConfig(); +    s_globalTest5()->q->read();    }    return s_globalTest5()->q; diff --git a/autotests/kconfig_compiler/test8b.cpp.ref b/autotests/kconfig_compiler/test8b.cpp.ref index dcd61693..8890815b 100644 --- a/autotests/kconfig_compiler/test8b.cpp.ref +++ b/autotests/kconfig_compiler/test8b.cpp.ref @@ -18,7 +18,7 @@ Test8b *Test8b::self()  {    if (!s_globalTest8b()->q) {      new Test8b; -    s_globalTest8b()->q->readConfig(); +    s_globalTest8b()->q->read();    }    return s_globalTest8b()->q; diff --git a/autotests/kconfig_compiler/test_dpointer.cpp.ref b/autotests/kconfig_compiler/test_dpointer.cpp.ref index e50bf8aa..324ba168 100644 --- a/autotests/kconfig_compiler/test_dpointer.cpp.ref +++ b/autotests/kconfig_compiler/test_dpointer.cpp.ref @@ -57,7 +57,7 @@ TestDPointer *TestDPointer::self()  {    if (!s_globalTestDPointer()->q) {      new TestDPointer; -    s_globalTestDPointer()->q->readConfig(); +    s_globalTestDPointer()->q->read();    }    return s_globalTestDPointer()->q; diff --git a/autotests/kconfig_compiler/test_signal.cpp.ref b/autotests/kconfig_compiler/test_signal.cpp.ref index 35b5cba2..58e73efd 100644 --- a/autotests/kconfig_compiler/test_signal.cpp.ref +++ b/autotests/kconfig_compiler/test_signal.cpp.ref @@ -18,7 +18,7 @@ TestSignal *TestSignal::self()  {    if (!s_globalTestSignal()->q) {      new TestSignal; -    s_globalTestSignal()->q->readConfig(); +    s_globalTestSignal()->q->read();    }    return s_globalTestSignal()->q; diff --git a/autotests/kconfigskeletontest.cpp b/autotests/kconfigskeletontest.cpp index 31278e76..a25aaf40 100644 --- a/autotests/kconfigskeletontest.cpp +++ b/autotests/kconfigskeletontest.cpp @@ -65,13 +65,12 @@ void KConfigSkeletonTest::testSimple()      mMyString.clear();      mMyFont = QFont(); -    readConfig(); +    read();      QCOMPARE(mMyBool, WRITE_SETTING1);      QCOMPARE(mMyColor, WRITE_SETTING2);      QCOMPARE(mMyFont, WRITE_SETTING3);      QCOMPARE(mMyString, WRITE_SETTING4); -  }  void KConfigSkeletonTest::testRemoveItem()  | 
