diff options
| -rw-r--r-- | autotests/kconfigtest.cpp | 11 | 
1 files changed, 8 insertions, 3 deletions
| diff --git a/autotests/kconfigtest.cpp b/autotests/kconfigtest.cpp index 4f29ea87..d82d8ca4 100644 --- a/autotests/kconfigtest.cpp +++ b/autotests/kconfigtest.cpp @@ -1630,16 +1630,21 @@ void KConfigTest::testNewlines()  {      // test that kconfig always uses the native line endings      QTemporaryFile file; -    file.open(); +    QVERIFY(file.open()); +    qWarning() << file.fileName();      KConfig anonConfig(file.fileName(), KConfig::SimpleConfig);      KConfigGroup general(&anonConfig, "General");      general.writeEntry("Foo", "Bar");      general.writeEntry("Bar", "Foo");      anonConfig.sync(); +    file.flush(); +    file.close(); +    QFile readFile(file.fileName()); +    QVERIFY(readFile.open(QFile::ReadOnly));  #ifndef Q_OS_WIN -    QCOMPARE(file.readAll(), QByteArrayLiteral("[General]\nBar=Foo\nFoo=Bar\n")); +    QCOMPARE(readFile.readAll(), QByteArrayLiteral("[General]\nBar=Foo\nFoo=Bar\n"));  #else -    QCOMPARE(file.readAll(), QByteArrayLiteral("[General]\r\nBar=Foo\r\nFoo=Bar\r\n")); +    QCOMPARE(readFile.readAll(), QByteArrayLiteral("[General]\r\nBar=Foo\r\nFoo=Bar\r\n"));  #endif  } | 
