From 096cdb3c04b13be811fc2a5a23deec2a69dc65a4 Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Fri, 2 Jun 2017 14:38:17 +0200 Subject: Fix tst_qfile::size for configurations using builtin test data As the files are packaged into the binary, they have to be extracted, before they can be ::open'ed. Change-Id: Ie83086a2b9a73b6b0de462bdb52a71bb277ae06f Reviewed-by: Maurice Kalinowski --- tests/auto/corelib/io/qfile/test/test.pro | 6 ++++++ tests/auto/corelib/io/qfile/tst_qfile.cpp | 10 ++++++++++ 2 files changed, 16 insertions(+) (limited to 'tests/auto/corelib/io') diff --git a/tests/auto/corelib/io/qfile/test/test.pro b/tests/auto/corelib/io/qfile/test/test.pro index 7ad047e8a2..1472ddbb83 100644 --- a/tests/auto/corelib/io/qfile/test/test.pro +++ b/tests/auto/corelib/io/qfile/test/test.pro @@ -4,6 +4,12 @@ QT = core-private core testlib qtHaveModule(network): QT += network else: DEFINES += QT_NO_NETWORK +contains(CONFIG, builtin_testdata) { + DEFINES += BUILTIN_TESTDATA +} + +TESTDATA += ../BLACKLIST + TARGET = ../tst_qfile SOURCES = ../tst_qfile.cpp INCLUDEPATH += ../../../../../shared/ diff --git a/tests/auto/corelib/io/qfile/tst_qfile.cpp b/tests/auto/corelib/io/qfile/tst_qfile.cpp index 9751bb4c9e..c7216dc169 100644 --- a/tests/auto/corelib/io/qfile/tst_qfile.cpp +++ b/tests/auto/corelib/io/qfile/tst_qfile.cpp @@ -250,6 +250,9 @@ private slots: void reuseQFile(); private: +#ifdef BUILTIN_TESTDATA + QSharedPointer m_dataDir; +#endif enum FileType { OpenQFile, OpenFd, @@ -428,8 +431,15 @@ void tst_QFile::initTestCase() QVERIFY(!m_forRenamingFile.isEmpty()); m_twoDotsFile = QFINDTESTDATA("two.dots.file"); QVERIFY(!m_twoDotsFile.isEmpty()); + +#ifndef BUILTIN_TESTDATA m_testFile = QFINDTESTDATA("testfile.txt"); QVERIFY(!m_testFile.isEmpty()); +#else + m_dataDir = QEXTRACTTESTDATA("/"); + QVERIFY2(!m_dataDir.isNull(), qPrintable("Could not extract test data")); + m_testFile = m_dataDir->path() + "/testfile.txt"; +#endif m_resourcesDir = QFINDTESTDATA("resources"); QVERIFY(!m_resourcesDir.isEmpty()); m_noEndOfLineFile = QFINDTESTDATA("noendofline.txt"); -- cgit v1.2.3 From 0086bf62a203f0e4bd5982532e1b7c04b0f6cdfb Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Tue, 13 Jun 2017 12:43:44 +0200 Subject: winrt: Fix tst_qtextstream Change-Id: I5e8076a344a50f70e9618ff7b2e9258182601957 Reviewed-by: Maurice Kalinowski --- tests/auto/corelib/io/qtextstream/BLACKLIST | 1 + tests/auto/corelib/io/qtextstream/test/test.pro | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'tests/auto/corelib/io') diff --git a/tests/auto/corelib/io/qtextstream/BLACKLIST b/tests/auto/corelib/io/qtextstream/BLACKLIST index bc3f118b33..b54b53cd74 100644 --- a/tests/auto/corelib/io/qtextstream/BLACKLIST +++ b/tests/auto/corelib/io/qtextstream/BLACKLIST @@ -1,2 +1,3 @@ [stillOpenWhenAtEnd] windows +winrt diff --git a/tests/auto/corelib/io/qtextstream/test/test.pro b/tests/auto/corelib/io/qtextstream/test/test.pro index 50335524d3..3dcfa0b414 100644 --- a/tests/auto/corelib/io/qtextstream/test/test.pro +++ b/tests/auto/corelib/io/qtextstream/test/test.pro @@ -18,7 +18,8 @@ TESTDATA += \ ../task113817.txt \ ../qtextstream.qrc \ ../tst_qtextstream.cpp \ - ../resources + ../resources \ + ../BLACKLIST builtin_testdata { DEFINES += BUILTIN_TESTDATA -- cgit v1.2.3 From 9ed46c28539bc93c99c4e727f4de97cf643b4e41 Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Tue, 13 Jun 2017 12:43:03 +0200 Subject: winrt: Fix tst_qurl Change-Id: Ia7e33e3892f888ead1357f5cd522480f514421e3 Reviewed-by: Maurice Kalinowski --- tests/auto/corelib/io/qurl/tst_qurl.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'tests/auto/corelib/io') diff --git a/tests/auto/corelib/io/qurl/tst_qurl.cpp b/tests/auto/corelib/io/qurl/tst_qurl.cpp index ebc240c285..c5647752fd 100644 --- a/tests/auto/corelib/io/qurl/tst_qurl.cpp +++ b/tests/auto/corelib/io/qurl/tst_qurl.cpp @@ -3078,11 +3078,7 @@ void tst_QUrl::fromUserInputWithCwd_data() // "." { - const QUrl url = QUrl::fromLocalFile(base -#ifdef Q_OS_WINRT - + QLatin1Char('/') -#endif - ); // fromUserInput cleans the path + const QUrl url = QUrl::fromLocalFile(base); // fromUserInput cleans the path QTest::newRow("dot-in-path") << "." << base << url << url; QTest::newRow("dot-in-dot") << "." << QStringLiteral(".") << url << url; } -- cgit v1.2.3