From 1fad6902629191558e53ea9b58a8a67a0bfc9440 Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Fri, 26 May 2017 00:57:35 +0200 Subject: tests: use QIODevice::Text in kconfigcompiler_test This way, different newline endings in OSes are handled as \n when reading, and thus fixing the comparison on non-\n OSes. --- autotests/kconfig_compiler/kconfigcompiler_test.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'autotests/kconfig_compiler/kconfigcompiler_test.cpp') diff --git a/autotests/kconfig_compiler/kconfigcompiler_test.cpp b/autotests/kconfig_compiler/kconfigcompiler_test.cpp index 61de0b61..752af57f 100644 --- a/autotests/kconfig_compiler/kconfigcompiler_test.cpp +++ b/autotests/kconfig_compiler/kconfigcompiler_test.cpp @@ -110,11 +110,11 @@ void KConfigCompiler_Test::testBaselineComparison() QFile file(QFINDTESTDATA(testName)); QFile fileRef(QFINDTESTDATA(testName + QLatin1String(".ref"))); - if (!file.open(QIODevice::ReadOnly)) { + if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { qWarning() << "Failed to open" << file.fileName() << "(" << testName << ")"; QFAIL("Can't open file for comparison"); } - if (!fileRef.open(QIODevice::ReadOnly)) { + if (!fileRef.open(QIODevice::ReadOnly | QIODevice::Text)) { qWarning() << "Failed to open" << fileRef.fileName() << "(" << testName << ".ref )"; QFAIL("Can't open file for comparison"); } -- cgit v1.2.1