From 7fc2864dc5391096a19c2d5f80695129c24cc303 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 23 Mar 2016 10:25:46 +0100 Subject: QtCore: Remove Windows CE. Remove QSysInfo::WV_CE_5/6 enumeration values, #ifdef sections for Q_OS_WINCE and wince .pro file clauses in library, examples and tests. Task-number: QTBUG-51673 Change-Id: Ib63463445f3a26e04d018b193e4655030002f5f9 Reviewed-by: Lars Knoll --- .../tst_qparallelanimationgroup.cpp | 4 +- .../auto/corelib/codecs/qtextcodec/qtextcodec.pro | 4 +- tests/auto/corelib/global/qtendian/qtendian.pro | 4 - tests/auto/corelib/io/io.pro | 2 +- tests/auto/corelib/io/largefile/largefile.pro | 2 - tests/auto/corelib/io/largefile/tst_largefile.cpp | 16 +-- .../corelib/io/qdatastream/tst_qdatastream.cpp | 27 +--- tests/auto/corelib/io/qdir/tst_qdir.cpp | 43 ++---- .../auto/corelib/io/qdiriterator/qdiriterator.pro | 2 - .../corelib/io/qdiriterator/tst_qdiriterator.cpp | 27 +--- tests/auto/corelib/io/qfile/qfile.pro | 7 +- tests/auto/corelib/io/qfile/test/test.pro | 1 - tests/auto/corelib/io/qfile/tst_qfile.cpp | 93 +++---------- tests/auto/corelib/io/qfileinfo/qfileinfo.pro | 2 +- tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp | 95 +++++-------- .../qfilesystemwatcher/tst_qfilesystemwatcher.cpp | 11 -- tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp | 6 - tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp | 8 +- tests/auto/corelib/io/qlockfile/tst_qlockfile.pro | 2 +- tests/auto/corelib/io/qprocess/qprocess.pri | 3 +- tests/auto/corelib/io/qprocess/qprocess.pro | 2 +- .../io/qprocess/testProcessSpacesArgs/main.cpp | 11 -- .../io/qprocess/testSoftExit/testSoftExit.pro | 2 +- tests/auto/corelib/io/qprocess/tst_qprocess.cpp | 151 +-------------------- .../tst_qprocessenvironment.cpp | 14 +- tests/auto/corelib/io/qsettings/tst_qsettings.cpp | 2 +- .../corelib/io/qtemporarydir/tst_qtemporarydir.cpp | 4 +- .../io/qtemporaryfile/tst_qtemporaryfile.cpp | 11 +- .../corelib/io/qtextstream/tst_qtextstream.cpp | 22 --- .../corelib/itemmodels/qitemmodel/modelstotest.cpp | 24 ---- .../qcoreapplication/tst_qcoreapplication.cpp | 2 +- .../auto/corelib/kernel/qeventloop/qeventloop.pro | 2 +- tests/auto/corelib/kernel/qmetatype/qmetatype.pro | 4 +- .../corelib/kernel/qobject/signalbug/signalbug.pro | 3 - tests/auto/corelib/kernel/qobject/tst_qobject.cpp | 4 - .../qsharedmemory/test/tst_qsharedmemory.cpp | 7 +- tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp | 3 - tests/auto/corelib/plugin/qlibrary/lib/lib.pro | 1 - tests/auto/corelib/plugin/qlibrary/lib2/lib2.pro | 1 - .../auto/corelib/plugin/qlibrary/tst_qlibrary.cpp | 13 +- .../plugin/qpluginloader/tst_qpluginloader.cpp | 5 - .../corelib/thread/qsemaphore/tst_qsemaphore.cpp | 6 - tests/auto/corelib/thread/qthread/tst_qthread.cpp | 20 +-- .../corelib/thread/qthreadonce/tst_qthreadonce.cpp | 2 +- .../thread/qthreadstorage/tst_qthreadstorage.cpp | 10 +- .../corelib/tools/qbytearray/tst_qbytearray.cpp | 14 +- tests/auto/corelib/tools/qchar/tst_qchar.cpp | 3 - .../qcommandlineparser/tst_qcommandlineparser.cpp | 6 - .../auto/corelib/tools/qdatetime/tst_qdatetime.cpp | 32 +---- tests/auto/corelib/tools/qhash/tst_qhash.cpp | 4 - tests/auto/corelib/tools/qlocale/tst_qlocale.cpp | 18 +-- tests/auto/corelib/tools/qregexp/tst_qregexp.cpp | 20 +-- .../corelib/tools/qsharedpointer/externaltests.cpp | 4 +- .../tools/qsharedpointer/tst_qsharedpointer.cpp | 8 +- tests/auto/corelib/tools/qstring/tst_qstring.cpp | 55 +------- .../corelib/tools/qstringlist/tst_qstringlist.cpp | 13 -- .../auto/corelib/tools/qtimeline/tst_qtimeline.cpp | 4 - 57 files changed, 124 insertions(+), 742 deletions(-) (limited to 'tests/auto') diff --git a/tests/auto/corelib/animation/qparallelanimationgroup/tst_qparallelanimationgroup.cpp b/tests/auto/corelib/animation/qparallelanimationgroup/tst_qparallelanimationgroup.cpp index 320e0095d3..a8d64f1cd9 100644 --- a/tests/auto/corelib/animation/qparallelanimationgroup/tst_qparallelanimationgroup.cpp +++ b/tests/auto/corelib/animation/qparallelanimationgroup/tst_qparallelanimationgroup.cpp @@ -62,8 +62,8 @@ private slots: void tst_QParallelAnimationGroup::initTestCase() { qRegisterMetaType("QAbstractAnimation::State"); -#if defined(Q_OS_MAC) || defined(Q_OS_WINCE) - // give the mac/wince app start event queue time to clear +#if defined(Q_OS_DARWIN) + // give the Darwin app start event queue time to clear QTest::qWait(1000); #endif } diff --git a/tests/auto/corelib/codecs/qtextcodec/qtextcodec.pro b/tests/auto/corelib/codecs/qtextcodec/qtextcodec.pro index 9f2e4f9c92..302d887fc7 100644 --- a/tests/auto/corelib/codecs/qtextcodec/qtextcodec.pro +++ b/tests/auto/corelib/codecs/qtextcodec/qtextcodec.pro @@ -1,4 +1,2 @@ TEMPLATE = subdirs -SUBDIRS = test - -!wince: SUBDIRS += echo +SUBDIRS = test echo diff --git a/tests/auto/corelib/global/qtendian/qtendian.pro b/tests/auto/corelib/global/qtendian/qtendian.pro index 2b0af4fa4c..214c706ca5 100644 --- a/tests/auto/corelib/global/qtendian/qtendian.pro +++ b/tests/auto/corelib/global/qtendian/qtendian.pro @@ -2,7 +2,3 @@ CONFIG += testcase TARGET = tst_qtendian QT = core testlib SOURCES = tst_qtendian.cpp -wince* { # QTBUG-37194 , internal compiler errors with MSVC2008 for Windows CE - QMAKE_CFLAGS_RELEASE -= -O2 - QMAKE_CXXFLAGS_RELEASE -= -O2 -} diff --git a/tests/auto/corelib/io/io.pro b/tests/auto/corelib/io/io.pro index 29717b3a1c..24c762ed84 100644 --- a/tests/auto/corelib/io/io.pro +++ b/tests/auto/corelib/io/io.pro @@ -35,7 +35,7 @@ SUBDIRS=\ qurlquery \ qwinoverlappedionotifier \ -!win32|wince* { +!win32 { SUBDIRS -=\ qwinoverlappedionotifier } diff --git a/tests/auto/corelib/io/largefile/largefile.pro b/tests/auto/corelib/io/largefile/largefile.pro index caef116684..6c1bb8d7ea 100644 --- a/tests/auto/corelib/io/largefile/largefile.pro +++ b/tests/auto/corelib/io/largefile/largefile.pro @@ -2,5 +2,3 @@ CONFIG += testcase TARGET = tst_largefile QT = core testlib SOURCES = tst_largefile.cpp - -wince: SOURCES += $$QT_SOURCE_TREE/src/corelib/kernel/qfunctions_wince.cpp diff --git a/tests/auto/corelib/io/largefile/tst_largefile.cpp b/tests/auto/corelib/io/largefile/tst_largefile.cpp index e448093062..a19a5ce58d 100644 --- a/tests/auto/corelib/io/largefile/tst_largefile.cpp +++ b/tests/auto/corelib/io/largefile/tst_largefile.cpp @@ -39,18 +39,12 @@ #include #ifdef Q_OS_WIN - -#include - -#ifndef Q_OS_WINCE -#include -#endif - -#ifndef FSCTL_SET_SPARSE +# include +# include +# ifndef FSCTL_SET_SPARSE // MinGW doesn't define this. -#define FSCTL_SET_SPARSE (0x900C4) -#endif - +# define FSCTL_SET_SPARSE (0x900C4) +# endif #endif // Q_OS_WIN class tst_LargeFile diff --git a/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp b/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp index f5a546ebf1..8fb367482c 100644 --- a/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp +++ b/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp @@ -88,10 +88,8 @@ private slots: void stream_QPen_data(); void stream_QPen(); -#ifndef Q_OS_WINCE void stream_QPixmap_data(); void stream_QPixmap(); -#endif void stream_QPoint_data(); void stream_QPoint(); @@ -123,10 +121,8 @@ private slots: void stream_qint64_data(); void stream_qint64(); -#ifndef Q_OS_WINCE void stream_QIcon_data(); void stream_QIcon(); -#endif void stream_QEasingCurve_data(); void stream_QEasingCurve(); @@ -1542,24 +1538,16 @@ void tst_QDataStream::readQPen(QDataStream *s) // pixmap testing is currently limited to one pixmap only. // -#ifndef Q_OS_WINCE -// Test depends on more memory than available on Qt/CE void tst_QDataStream::stream_QPixmap_data() { stream_data(1); } -#endif -#ifndef Q_OS_WINCE -// Test depends on more memory than available on Qt/CE void tst_QDataStream::stream_QPixmap() { STREAM_IMPL(QPixmap); } -#endif -#ifndef Q_OS_WINCE -// Test depends on more memory than available on Qt/CE void tst_QDataStream::stream_QIcon_data() { stream_data(1); @@ -1569,7 +1557,6 @@ void tst_QDataStream::stream_QIcon() { STREAM_IMPL(QIcon); } -#endif void tst_QDataStream::writeQPixmap(QDataStream *s) { @@ -1844,7 +1831,7 @@ static QRegion qRegionData(int index) case 4: return QRegion(100, -100, 2048, 4096, QRegion::Rectangle); case 5: return QRegion(-100, 100, 4096, 2048, QRegion::Rectangle); case 6: return QRegion(0, 0, 0, 0, QRegion::Ellipse); -#if (!defined(Q_OS_UNIX) && !defined(Q_OS_WINCE)) // all our Unix platforms use X regions. +#if !defined(Q_OS_UNIX) // all our Unix platforms use X regions. case 7: return QRegion(1, 2, 300, 400, QRegion::Ellipse); case 8: return QRegion(100, 100, 1024, 768, QRegion::Ellipse); case 9: return QRegion(-100, -100, 1024, 1024, QRegion::Ellipse); @@ -2496,12 +2483,10 @@ void tst_QDataStream::status_charptr_QByteArray_data() QTest::addColumn("expectedStatus"); QTest::addColumn("expectedString"); -#if !defined(Q_OS_WINCE) QByteArray oneMbMinus1(1024 * 1024 - 1, '\0'); for (int i = 0; i < oneMbMinus1.size(); ++i) oneMbMinus1[i] = 0x1 | (8 * ((uchar)i / 9)); QByteArray threeMbMinus1 = oneMbMinus1 + 'j' + oneMbMinus1 + 'k' + oneMbMinus1; -#endif // ok QTest::newRow("size 0") << QByteArray("\x00\x00\x00\x00", 4) << (int) QDataStream::Ok << QByteArray(); @@ -2510,14 +2495,12 @@ void tst_QDataStream::status_charptr_QByteArray_data() QTest::newRow("size 3") << QByteArray("\x00\x00\x00\x03jkl", 7) << (int) QDataStream::Ok << QByteArray("jkl"); QTest::newRow("size 4") << QByteArray("\x00\x00\x00\x04jklm", 8) << (int) QDataStream::Ok << QByteArray("jklm"); QTest::newRow("size 4j") << QByteArray("\x00\x00\x00\x04jklmj", 8) << (int) QDataStream::Ok << QByteArray("jklm"); -#if !defined(Q_OS_WINCE) QTest::newRow("size 1MB-1") << QByteArray("\x00\x0f\xff\xff", 4) + oneMbMinus1 + QByteArray("j") << (int) QDataStream::Ok << oneMbMinus1; QTest::newRow("size 1MB") << QByteArray("\x00\x10\x00\x00", 4) + oneMbMinus1 + QByteArray("jkl") << (int) QDataStream::Ok << oneMbMinus1 + "j"; QTest::newRow("size 1MB+1") << QByteArray("\x00\x10\x00\x01", 4) + oneMbMinus1 + QByteArray("jkl") << (int) QDataStream::Ok << oneMbMinus1 + "jk"; QTest::newRow("size 3MB-1") << QByteArray("\x00\x2f\xff\xff", 4) + threeMbMinus1 + QByteArray("j") << (int) QDataStream::Ok << threeMbMinus1; QTest::newRow("size 3MB") << QByteArray("\x00\x30\x00\x00", 4) + threeMbMinus1 + QByteArray("jkl") << (int) QDataStream::Ok << threeMbMinus1 + "j"; QTest::newRow("size 3MB+1") << QByteArray("\x00\x30\x00\x01", 4) + threeMbMinus1 + QByteArray("jkl") << (int) QDataStream::Ok << threeMbMinus1 + "jk"; -#endif // past end QTest::newRow("empty") << QByteArray() << (int) QDataStream::ReadPastEnd << QByteArray(); @@ -2530,12 +2513,10 @@ void tst_QDataStream::status_charptr_QByteArray_data() QTest::newRow("badsize 2") << QByteArray("\x00\x00\x00\x02j", 5) << (int) QDataStream::ReadPastEnd << QByteArray(); QTest::newRow("badsize 3") << QByteArray("\x00\x00\x00\x03jk", 6) << (int) QDataStream::ReadPastEnd << QByteArray(); QTest::newRow("badsize 4") << QByteArray("\x00\x00\x00\x04jkl", 7) << (int) QDataStream::ReadPastEnd << QByteArray(); -#if !defined(Q_OS_WINCE) QTest::newRow("badsize 1MB") << QByteArray("\x00\x10\x00\x00", 4) + oneMbMinus1 << (int) QDataStream::ReadPastEnd << QByteArray(); QTest::newRow("badsize 1MB+1") << QByteArray("\x00\x10\x00\x01", 4) + oneMbMinus1 + QByteArray("j") << (int) QDataStream::ReadPastEnd << QByteArray(); QTest::newRow("badsize 3MB") << QByteArray("\x00\x30\x00\x00", 4) + threeMbMinus1 << (int) QDataStream::ReadPastEnd << QByteArray(); QTest::newRow("badsize 3MB+1") << QByteArray("\x00\x30\x00\x01", 4) + threeMbMinus1 + QByteArray("j") << (int) QDataStream::ReadPastEnd << QByteArray(); -#endif QTest::newRow("size -1") << QByteArray("\xff\xff\xff\xff", 4) << (int) QDataStream::ReadPastEnd << QByteArray(); QTest::newRow("size -2") << QByteArray("\xff\xff\xff\xfe", 4) << (int) QDataStream::ReadPastEnd << QByteArray(); } @@ -2600,7 +2581,6 @@ void tst_QDataStream::status_QString_data() QTest::addColumn("expectedStatus"); QTest::addColumn("expectedString"); -#if !defined(Q_OS_WINCE) QString oneMbMinus1; oneMbMinus1.resize(1024 * 1024 - 1); for (int i = 0; i < oneMbMinus1.size(); ++i) @@ -2609,7 +2589,6 @@ void tst_QDataStream::status_QString_data() QByteArray threeMbMinus1Data = qstring2qbytearray(threeMbMinus1); QByteArray oneMbMinus1Data = qstring2qbytearray(oneMbMinus1); -#endif // ok QTest::newRow("size 0") << QByteArray("\x00\x00\x00\x00", 4) << (int) QDataStream::Ok << QString(); @@ -2618,14 +2597,12 @@ void tst_QDataStream::status_QString_data() QTest::newRow("size 3") << QByteArray("\x00\x00\x00\x06\x00j\x00k\x00l", 10) << (int) QDataStream::Ok << QString("jkl"); QTest::newRow("size 4") << QByteArray("\x00\x00\x00\x08\x00j\x00k\x00l\x00m", 12) << (int) QDataStream::Ok << QString("jklm"); QTest::newRow("size 4j") << QByteArray("\x00\x00\x00\x08\x00j\x00k\x00l\x00mjj", 14) << (int) QDataStream::Ok << QString("jklm"); -#if !defined(Q_OS_WINCE) QTest::newRow("size 1MB-1") << QByteArray("\x00\x1f\xff\xfe", 4) + oneMbMinus1Data + QByteArray("jj") << (int) QDataStream::Ok << oneMbMinus1; QTest::newRow("size 1MB") << QByteArray("\x00\x20\x00\x00", 4) + oneMbMinus1Data + QByteArray("\x00j\x00k\x00l", 6) << (int) QDataStream::Ok << oneMbMinus1 + "j"; QTest::newRow("size 1MB+1") << QByteArray("\x00\x20\x00\x02", 4) + oneMbMinus1Data + QByteArray("\x00j\x00k\x00l", 6) << (int) QDataStream::Ok << oneMbMinus1 + "jk"; QTest::newRow("size 3MB-1") << QByteArray("\x00\x5f\xff\xfe", 4) + threeMbMinus1Data + QByteArray("jj") << (int) QDataStream::Ok << threeMbMinus1; QTest::newRow("size 3MB") << QByteArray("\x00\x60\x00\x00", 4) + threeMbMinus1Data + QByteArray("\x00j\x00k\x00l", 6) << (int) QDataStream::Ok << threeMbMinus1 + "j"; QTest::newRow("size 3MB+1") << QByteArray("\x00\x60\x00\x02", 4) + threeMbMinus1Data + QByteArray("\x00j\x00k\x00l", 6) << (int) QDataStream::Ok << threeMbMinus1 + "jk"; -#endif // past end QTest::newRow("empty") << QByteArray() << (int) QDataStream::ReadPastEnd << QString(); @@ -2638,14 +2615,12 @@ void tst_QDataStream::status_QString_data() QTest::newRow("badsize 2") << QByteArray("\x00\x00\x00\x04jj", 6) << (int) QDataStream::ReadPastEnd << QString(); QTest::newRow("badsize 3") << QByteArray("\x00\x00\x00\x06jjkk", 8) << (int) QDataStream::ReadPastEnd << QString(); QTest::newRow("badsize 4") << QByteArray("\x00\x00\x00\x08jjkkll", 10) << (int) QDataStream::ReadPastEnd << QString(); -#if !defined(Q_OS_WINCE) QTest::newRow("badsize 1MB") << QByteArray("\x00\x20\x00\x00", 4) + oneMbMinus1Data << (int) QDataStream::ReadPastEnd << QString(); QTest::newRow("badsize 1MB+1") << QByteArray("\x00\x20\x00\x02", 4) + oneMbMinus1Data + QByteArray("j") << (int) QDataStream::ReadPastEnd << QString(); QTest::newRow("badsize 3MB") << QByteArray("\x00\x60\x00\x00", 4) + threeMbMinus1Data << (int) QDataStream::ReadPastEnd << QString(); QTest::newRow("badsize 3MB+1") << QByteArray("\x00\x60\x00\x02", 4) + threeMbMinus1Data + QByteArray("j") << (int) QDataStream::ReadPastEnd << QString(); QTest::newRow("size -2") << QByteArray("\xff\xff\xff\xfe", 4) << (int) QDataStream::ReadPastEnd << QString(); QTest::newRow("size MAX") << QByteArray("\x7f\xff\xff\xfe", 4) << (int) QDataStream::ReadPastEnd << QString(); -#endif // corrupt data QTest::newRow("corrupt1") << QByteArray("yyyy") << (int) QDataStream::ReadCorruptData << QString(); diff --git a/tests/auto/corelib/io/qdir/tst_qdir.cpp b/tests/auto/corelib/io/qdir/tst_qdir.cpp index 5046f5abf4..5780f2508c 100644 --- a/tests/auto/corelib/io/qdir/tst_qdir.cpp +++ b/tests/auto/corelib/io/qdir/tst_qdir.cpp @@ -35,7 +35,7 @@ #include #include -#if (defined(Q_OS_WIN) && !defined(Q_OS_WINCE)) +#if defined(Q_OS_WIN) #include #include "../../../network-settings.h" #endif @@ -163,9 +163,8 @@ private slots: void operator_eq(); -#ifndef Q_OS_WINCE void dotAndDotDot(); -#endif + void homePath(); void tempPath(); void rootPath(); @@ -316,7 +315,7 @@ void tst_QDir::setPath_data() QTest::addColumn("dir2"); QTest::newRow("data0") << QString(".") << QString(".."); -#if (defined(Q_OS_WIN) && !defined(Q_OS_WINCE)) +#if defined(Q_OS_WIN) QTest::newRow("data1") << QString("c:/") << QDir::currentPath(); #endif } @@ -543,7 +542,7 @@ void tst_QDir::exists_data() QTest::newRow("simple dir") << (m_dataPath + "/resources") << true; QTest::newRow("simple dir with slash") << (m_dataPath + "/resources/") << true; -#if (defined(Q_OS_WIN) && !defined(Q_OS_WINCE)) && !defined(Q_OS_WINRT) +#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) const QString uncRoot = QStringLiteral("//") + QtNetworkSettings::winServerName(); QTest::newRow("unc 1") << uncRoot << true; QTest::newRow("unc 2") << uncRoot + QLatin1Char('/') << true; @@ -555,7 +554,7 @@ void tst_QDir::exists_data() QTest::newRow("unc 8") << uncRoot + "/asharethatshouldnotexist" << false; QTest::newRow("unc 9") << "//ahostthatshouldnotexist" << false; #endif -#if (defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)) +#if (defined(Q_OS_WIN) && !defined(Q_OS_WINRT)) QTest::newRow("This drive should exist") << "C:/" << true; // find a non-existing drive and check if it does not exist #ifdef QT_BUILD_INTERNAL @@ -596,7 +595,7 @@ void tst_QDir::isRelativePath_data() QTest::addColumn("relative"); QTest::newRow("data0") << "../somedir" << true; -#if (defined(Q_OS_WIN) && !defined(Q_OS_WINCE)) +#if defined(Q_OS_WIN) QTest::newRow("data1") << "C:/sOmedir" << false; #endif QTest::newRow("data2") << "somedir" << true; @@ -802,12 +801,6 @@ void tst_QDir::entryList() QFile::remove(entrylistPath + "brokenlink.lnk"); QFile::remove(entrylistPath + "brokenlink"); - // WinCE does not have . and .. in the directory listing -#if defined(Q_OS_WINCE) - expected.removeAll("."); - expected.removeAll(".."); -#endif - #ifndef Q_NO_SYMLINKS #if defined(Q_OS_WIN) // ### Sadly, this is a platform difference right now. @@ -900,15 +893,10 @@ void tst_QDir::entryListSimple_data() QTest::addColumn("countMin"); QTest::newRow("data2") << "do_not_expect_this_path_to_exist/" << 0; -#if defined(Q_OS_WINCE) - QTest::newRow("simple dir") << (m_dataPath + "/resources") << 0; - QTest::newRow("simple dir with slash") << (m_dataPath + "/resources/") << 0; -#else QTest::newRow("simple dir") << (m_dataPath + "/resources") << 2; QTest::newRow("simple dir with slash") << (m_dataPath + "/resources/") << 2; -#endif -#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT) +#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) const QString uncRoot = QStringLiteral("//") + QtNetworkSettings::winServerName(); QTest::newRow("unc 1") << uncRoot << 2; QTest::newRow("unc 2") << uncRoot + QLatin1Char('/') << 2; @@ -1170,25 +1158,21 @@ tst_QDir::cleanPath_data() QTest::newRow("data2") << "/" << "/"; QTest::newRow("data3") << QDir::cleanPath("../.") << ".."; QTest::newRow("data4") << QDir::cleanPath("../..") << "../.."; -#if !defined(Q_OS_WINCE) #if defined(Q_OS_WIN) QTest::newRow("data5") << "d:\\a\\bc\\def\\.." << "d:/a/bc"; QTest::newRow("data6") << "d:\\a\\bc\\def\\../../.." << "d:/"; #else QTest::newRow("data5") << "d:\\a\\bc\\def\\.." << "d:\\a\\bc\\def\\.."; QTest::newRow("data6") << "d:\\a\\bc\\def\\../../.." << ".."; -#endif #endif QTest::newRow("data7") << ".//file1.txt" << "file1.txt"; QTest::newRow("data8") << "/foo/bar/..//file1.txt" << "/foo/file1.txt"; QTest::newRow("data9") << "//" << "/"; -#if !defined(Q_OS_WINCE) #if defined Q_OS_WIN QTest::newRow("data10") << "c:\\" << "c:/"; #else QTest::newRow("data10") << "/:/" << "/:"; #endif -#endif #if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) QTest::newRow("data11") << "//foo//bar" << "//foo/bar"; #endif @@ -1350,7 +1334,7 @@ void tst_QDir::absolutePath_data() QTest::addColumn("expectedPath"); QTest::newRow("0") << "/machine/share/dir1" << "/machine/share/dir1"; -#if (defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)) +#if (defined(Q_OS_WIN) && !defined(Q_OS_WINRT)) QTest::newRow("1") << "\\machine\\share\\dir1" << "/machine/share/dir1"; QTest::newRow("2") << "//machine/share/dir1" << "//machine/share/dir1"; QTest::newRow("3") << "\\\\machine\\share\\dir1" << "//machine/share/dir1"; @@ -1399,7 +1383,7 @@ void tst_QDir::relativeFilePath_data() QTest::newRow("same path 1") << "/tmp" << "/tmp" << "."; QTest::newRow("same path 2") << "//tmp" << "/tmp/" << "."; -#if (defined(Q_OS_WIN) && !defined(Q_OS_WINCE)) +#if defined(Q_OS_WIN) QTest::newRow("12") << "C:/foo/bar" << "ding" << "ding"; QTest::newRow("13") << "C:/foo/bar" << "C:/ding/dong" << "../../ding/dong"; QTest::newRow("14") << "C:/foo/bar" << "/ding/dong" << "../../ding/dong"; @@ -1575,7 +1559,6 @@ void tst_QDir::operator_eq() dir1.setPath(".."); } -#ifndef Q_OS_WINCE // WinCE does not have . nor .. void tst_QDir::dotAndDotDot() { @@ -1585,7 +1568,6 @@ void tst_QDir::dotAndDotDot() entryList = dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot); QCOMPARE(entryList, QStringList() << QString("dir") << QString("spaces")); } -#endif void tst_QDir::homePath() { @@ -1829,16 +1811,9 @@ void tst_QDir::updateFileLists() QDir dir(fs.absoluteFilePath(dirName)); -#if defined(Q_OS_WINCE) - //no . and .. on these OS. - QCOMPARE(dir.count(), uint(4)); - QCOMPARE(dir.entryList().size(), 4); - QCOMPARE(dir.entryInfoList().size(), 4); -#else QCOMPARE(dir.count(), uint(6)); QCOMPARE(dir.entryList().size(), 6); QCOMPARE(dir.entryInfoList().size(), 6); -#endif dir.setFilter(QDir::AllEntries | QDir::NoDotAndDotDot); diff --git a/tests/auto/corelib/io/qdiriterator/qdiriterator.pro b/tests/auto/corelib/io/qdiriterator/qdiriterator.pro index 2d8dfba996..b5ac614ad1 100644 --- a/tests/auto/corelib/io/qdiriterator/qdiriterator.pro +++ b/tests/auto/corelib/io/qdiriterator/qdiriterator.pro @@ -7,6 +7,4 @@ RESOURCES += qdiriterator.qrc TESTDATA += entrylist contains(CONFIG, builtin_testdata): DEFINES += BUILTIN_TESTDATA -wince*mips*|wincewm50smart-msvc200*: DEFINES += WINCE_BROKEN_ITERATE=1 - win32: CONFIG += insignificant_test # Crashes on Windows in release builds diff --git a/tests/auto/corelib/io/qdiriterator/tst_qdiriterator.cpp b/tests/auto/corelib/io/qdiriterator/tst_qdiriterator.cpp index 9727ccb407..9bba9615ef 100644 --- a/tests/auto/corelib/io/qdiriterator/tst_qdiriterator.cpp +++ b/tests/auto/corelib/io/qdiriterator/tst_qdiriterator.cpp @@ -41,7 +41,7 @@ #define Q_NO_SYMLINKS #endif -#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) +#if defined(Q_OS_WIN) # include "../../../network-settings.h" #endif @@ -103,7 +103,7 @@ private slots: void longPath(); void dirorder(); void relativePaths(); -#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) +#if defined(Q_OS_WIN) void uncPaths_data(); void uncPaths(); #endif @@ -196,7 +196,7 @@ void tst_QDirIterator::initTestCase() # endif #endif -#if !defined(Q_OS_WIN) && !defined(Q_OS_WINCE) +#if !defined(Q_OS_WIN) createDirectory("hiddenDirs_hiddenFiles"); createFile("hiddenDirs_hiddenFiles/normalFile"); createFile("hiddenDirs_hiddenFiles/.hiddenFile"); @@ -239,10 +239,8 @@ void tst_QDirIterator::iterateRelativeDirectory_data() << QString("entrylist") << QDirIterator::IteratorFlags(0) << QDir::Filters(QDir::NoFilter) << QStringList("*") << QString( -#if !defined(Q_OS_WINCE) "entrylist/.," "entrylist/..," -#endif "entrylist/file," #ifndef Q_NO_SYMLINKS "entrylist/linktofile.lnk," @@ -257,9 +255,7 @@ void tst_QDirIterator::iterateRelativeDirectory_data() << QString("entrylist") << QDirIterator::IteratorFlags(0) << QDir::Filters(QDir::AllEntries | QDir::NoDot) << QStringList("*") << QString( -#if !defined(Q_OS_WINCE) "entrylist/..," -#endif "entrylist/file," #ifndef Q_NO_SYMLINKS "entrylist/linktofile.lnk," @@ -274,9 +270,7 @@ void tst_QDirIterator::iterateRelativeDirectory_data() << QString("entrylist") << QDirIterator::IteratorFlags(0) << QDir::Filters(QDir::AllEntries | QDir::NoDotDot) << QStringList("*") << QString( -#if !defined(Q_OS_WINCE) "entrylist/.," -#endif "entrylist/file," #ifndef Q_NO_SYMLINKS "entrylist/linktofile.lnk," @@ -305,12 +299,10 @@ void tst_QDirIterator::iterateRelativeDirectory_data() << QString("entrylist") << QDirIterator::IteratorFlags(QDirIterator::Subdirectories | QDirIterator::FollowSymlinks) << QDir::Filters(QDir::NoFilter) << QStringList("*") << QString( -#if !defined(Q_OS_WINCE) "entrylist/.," "entrylist/..," "entrylist/directory/.," "entrylist/directory/..," -#endif "entrylist/file," #ifndef Q_NO_SYMLINKS "entrylist/linktofile.lnk," @@ -345,11 +337,7 @@ void tst_QDirIterator::iterateRelativeDirectory_data() QTest::newRow("empty, default") << QString("empty") << QDirIterator::IteratorFlags(0) << QDir::Filters(QDir::NoFilter) << QStringList("*") -#if defined(Q_OS_WINCE) - << QStringList(); -#else << QString("empty/.,empty/..").split(','); -#endif QTest::newRow("empty, QDir::NoDotAndDotDot") << QString("empty") << QDirIterator::IteratorFlags(0) @@ -562,13 +550,6 @@ void tst_QDirIterator::longPath() while (dir.exists(dirName) || dir.mkdir(dirName)) { ++n; dirName.append('x'); -#if defined(Q_OS_WINCE) && defined(WINCE_BROKEN_ITERATE) - // Some Windows CE devices/emulators are broken. - // though one can create directories of length <= 217, - // FindNextFile only reports entries until ~ 214. - if (n >= 210) - break; -#endif } QDirIterator it(dir.absolutePath(), QDir::NoDotAndDotDot|QDir::Dirs, QDirIterator::Subdirectories); @@ -606,7 +587,7 @@ void tst_QDirIterator::relativePaths() } } -#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) +#if defined(Q_OS_WIN) void tst_QDirIterator::uncPaths_data() { QTest::addColumn("dirName"); diff --git a/tests/auto/corelib/io/qfile/qfile.pro b/tests/auto/corelib/io/qfile/qfile.pro index 10c8d918f7..0735daedb3 100644 --- a/tests/auto/corelib/io/qfile/qfile.pro +++ b/tests/auto/corelib/io/qfile/qfile.pro @@ -1,7 +1,2 @@ TEMPLATE = subdirs -wince* { - SUBDIRS = test -} else { - SUBDIRS = test stdinprocess -} - +SUBDIRS = test stdinprocess diff --git a/tests/auto/corelib/io/qfile/test/test.pro b/tests/auto/corelib/io/qfile/test/test.pro index c9ba96cc1b..c0c4b9d5d2 100644 --- a/tests/auto/corelib/io/qfile/test/test.pro +++ b/tests/auto/corelib/io/qfile/test/test.pro @@ -6,7 +6,6 @@ else: DEFINES += QT_NO_NETWORK TARGET = ../tst_qfile SOURCES = ../tst_qfile.cpp -wince: SOURCES += $$QT_SOURCE_TREE/src/corelib/kernel/qfunctions_wince.cpp RESOURCES += ../qfile.qrc ../rename-fallback.qrc ../copy-fallback.qrc diff --git a/tests/auto/corelib/io/qfile/tst_qfile.cpp b/tests/auto/corelib/io/qfile/tst_qfile.cpp index 0d912d7b3c..dd449a37d4 100644 --- a/tests/auto/corelib/io/qfile/tst_qfile.cpp +++ b/tests/auto/corelib/io/qfile/tst_qfile.cpp @@ -47,7 +47,7 @@ extern Q_CORE_EXPORT int qt_ntfs_permission_lookup; QT_END_NAMESPACE #endif -#if !defined(Q_OS_WINCE) && !defined(QT_NO_NETWORK) +#if !defined(QT_NO_NETWORK) #include #endif #include @@ -66,8 +66,6 @@ QT_END_NAMESPACE # include #elif defined(Q_OS_IRIX) # include -#elif defined(Q_OS_WINCE) -# include #elif defined(Q_OS_VXWORKS) # include #if defined(_WRS_KERNEL) @@ -85,7 +83,7 @@ QT_END_NAMESPACE #include #include -#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) +#if defined(Q_OS_WIN) #include "../../../network-settings.h" #endif @@ -135,11 +133,9 @@ private slots: void readAll_data(); void readAll(); void readAllBuffer(); -#if !defined(Q_OS_WINCE) void readAllStdin(); void readLineStdin(); void readLineStdin_lineByLine(); -#endif void text(); void missingEndOfLine(); void readBlock(); @@ -169,7 +165,7 @@ private slots: void writeTextFile_data(); void writeTextFile(); /* void largeFileSupport(); */ -#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT) +#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) void largeUncFileSupport(); #endif void flush(); @@ -225,10 +221,8 @@ private slots: void mapWrittenFile_data(); void mapWrittenFile(); -#ifndef Q_OS_WINCE void openStandardStreamsFileDescriptors(); void openStandardStreamsBufferedStreams(); -#endif void resize_data(); void resize(); @@ -491,7 +485,7 @@ void tst_QFile::exists() file.remove(); QVERIFY(!file.exists()); -#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT) +#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) const QString uncPath = "//" + QtNetworkSettings::winServerName() + "/testshare/readme.txt"; QFile unc(uncPath); QVERIFY2(unc.exists(), msgFileDoesNotExist(uncPath).constData()); @@ -539,7 +533,7 @@ void tst_QFile::open_data() << false << QFile::OpenError; QTest::newRow("noreadfile") << QString::fromLatin1(noReadFile) << int(QIODevice::ReadOnly) << false << QFile::OpenError; -#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT) +#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) //opening devices requires administrative privileges (and elevation). HANDLE hTest = CreateFile(_T("\\\\.\\PhysicalDrive0"), GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL); if (hTest != INVALID_HANDLE_VALUE) { @@ -570,7 +564,7 @@ void tst_QFile::open() QSKIP("Running this test as root doesn't make sense"); #endif -#if defined(Q_OS_WIN32) || defined(Q_OS_WINCE) +#if defined(Q_OS_WIN32) QEXPECT_FAIL("noreadfile", "Windows does not currently support non-readable files.", Abort); #endif if (filename.isEmpty()) @@ -622,7 +616,7 @@ void tst_QFile::size_data() QTest::addColumn("size"); QTest::newRow( "exist01" ) << m_testFile << (qint64)245; -#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT) +#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) // Only test UNC on Windows./ QTest::newRow("unc") << "//" + QString(QtNetworkSettings::winServerName() + "/testshare/test.pri") << (qint64)34; #endif @@ -633,10 +627,6 @@ void tst_QFile::size() QFETCH( QString, filename ); QFETCH( qint64, size ); -#ifdef Q_OS_WINCE - filename = QFileInfo(filename).absoluteFilePath(); -#endif - { QFile f( filename ); QCOMPARE( f.size(), size ); @@ -656,9 +646,6 @@ void tst_QFile::size() fclose(stream); } - // Currently low level file I/O is not well supported on Windows CE, so - // skip this part of the test. -#ifndef Q_OS_WINCE { QFile f; @@ -671,7 +658,6 @@ void tst_QFile::size() f.close(); QT_CLOSE(fd); } -#endif } void tst_QFile::sizeNoExist() @@ -916,7 +902,6 @@ private: }; #endif // !QT_NO_PROCESS -#if !defined(Q_OS_WINCE) void tst_QFile::readAllStdin() { #ifdef QT_NO_PROCESS @@ -1007,7 +992,6 @@ void tst_QFile::readLineStdin_lineByLine() } #endif } -#endif void tst_QFile::text() { @@ -1108,7 +1092,7 @@ void tst_QFile::ungetChar() QCOMPARE(buf[2], '4'); } -#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT) +#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) QString driveLetters() { wchar_t volumeName[MAX_PATH]; @@ -1145,7 +1129,7 @@ void tst_QFile::invalidFile_data() #if !defined(Q_OS_WIN) QTest::newRow( "x11" ) << QString( "qwe//" ); #else -#if !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT) +#if !defined(Q_OS_WINRT) QTest::newRow( "colon2" ) << invalidDriveLetter() + QString::fromLatin1(":ail:invalid"); #endif QTest::newRow( "colon3" ) << QString( ":failinvalid" ); @@ -1207,13 +1191,11 @@ void tst_QFile::permissions_data() QTest::newRow("data0") << QCoreApplication::instance()->applicationFilePath() << uint(QFile::ExeUser) << true << false; QTest::newRow("data1") << m_testSourceFile << uint(QFile::ReadUser) << true << false; QTest::newRow("readonly") << QString::fromLatin1("readonlyfile") << uint(QFile::WriteUser) << false << false; -#ifndef Q_OS_WINCE QTest::newRow("longfile") << QString::fromLatin1("longFileNamelongFileNamelongFileNamelongFileName" "longFileNamelongFileNamelongFileNamelongFileName" "longFileNamelongFileNamelongFileNamelongFileName" "longFileNamelongFileNamelongFileNamelongFileName" "longFileNamelongFileNamelongFileNamelongFileName.txt") << uint(QFile::ReadUser) << true << true; -#endif QTest::newRow("resource1") << ":/tst_qfileinfo/resources/file1.ext1" << uint(QFile::ReadUser) << true << false; QTest::newRow("resource2") << ":/tst_qfileinfo/resources/file1.ext1" << uint(QFile::WriteUser) << false << false; QTest::newRow("resource3") << ":/tst_qfileinfo/resources/file1.ext1" << uint(QFile::ExeUser) << false << false; @@ -1365,15 +1347,9 @@ void tst_QFile::copyFallback() QVERIFY(QFile::exists("file-copy-destination.txt")); QVERIFY(!file.isOpen()); -#ifdef Q_OS_WINCE - // Need to reset permissions on Windows to be able to delete - QVERIFY(QFile::setPermissions("file-copy-destination.txt", - QFile::WriteOther)); -#else // Need to reset permissions on Windows to be able to delete QVERIFY(QFile::setPermissions("file-copy-destination.txt", QFile::ReadOwner | QFile::WriteOwner)); -#endif QVERIFY(QFile::remove("file-copy-destination.txt")); // Fallback copy of open file. @@ -1394,7 +1370,7 @@ void tst_QFile::copyFallback() #endif #endif -#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT) +#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) static QString getWorkingDirectoryForLink(const QString &linkFileName) { bool neededCoInit = false; @@ -1453,7 +1429,7 @@ void tst_QFile::link() QCOMPARE(QFile::symLinkTarget("myLink.lnk"), referenceTarget); -#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT) +#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) QString wd = getWorkingDirectoryForLink(info2.absoluteFilePath()); QCOMPARE(QDir::fromNativeSeparators(wd), QDir::cleanPath(info1.absolutePath())); #endif @@ -1591,7 +1567,7 @@ void tst_QFile::writeTextFile() QCOMPARE(file.readAll(), out); } -#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT) +#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) void tst_QFile::largeUncFileSupport() { qint64 size = Q_INT64_C(8589934592); @@ -1670,11 +1646,7 @@ void tst_QFile::bufferedRead() file.write("abcdef"); file.close(); -#if defined(Q_OS_WINCE) - FILE *stdFile = fopen((QCoreApplication::applicationDirPath() + "/stdfile.txt").toLatin1() , "r"); -#else FILE *stdFile = fopen("stdfile.txt", "r"); -#endif QVERIFY(stdFile); char c; QCOMPARE(int(fread(&c, 1, 1, stdFile)), 1); @@ -1819,11 +1791,7 @@ void tst_QFile::FILEReadWrite() f.close(); } -#ifdef Q_OS_WINCE - FILE *fp = fopen(qPrintable(QCoreApplication::applicationDirPath() + "\\FILEReadWrite.txt"), "r+b"); -#else FILE *fp = fopen("FILEReadWrite.txt", "r+b"); -#endif QVERIFY(fp); QFile file; QVERIFY2(file.open(fp, QFile::ReadWrite), msgOpenFailed(file).constData()); @@ -2028,10 +1996,6 @@ void tst_QFile::longFileName() } { QFile file(fileName); -#if defined(Q_OS_WINCE) - QEXPECT_FAIL("244 chars", "Full pathname must be less than 260 chars", Abort); - QEXPECT_FAIL("244 chars to absolutepath", "Full pathname must be less than 260 chars", Abort); -#endif QVERIFY2(file.open(QFile::WriteOnly | QFile::Text), msgOpenFailed(file).constData()); QTextStream ts(&file); ts << fileName << endl; @@ -2299,7 +2263,7 @@ void tst_QFile::writeLargeDataBlock_data() QTest::newRow("localfile-Fd") << "./largeblockfile.txt" << (int)OpenFd; QTest::newRow("localfile-Stream") << "./largeblockfile.txt" << (int)OpenStream; -#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT) && !defined(QT_NO_NETWORK) +#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) && !defined(QT_NO_NETWORK) // Some semi-randomness to avoid collisions. QTest::newRow("unc file") << QString("//" + QtNetworkSettings::winServerName() + "/TESTSHAREWRITABLE/largefile-%1-%2.txt") @@ -2314,8 +2278,8 @@ static QByteArray getLargeDataBlock() if (array.isNull()) { -#if defined(Q_OS_WINCE) || defined(Q_OS_VXWORKS) - int resizeSize = 1024 * 1024; // WinCE does not have much space +#if defined(Q_OS_VXWORKS) + int resizeSize = 1024 * 1024; // VxWorks does not have much space #else int resizeSize = 64 * 1024 * 1024; #endif @@ -2443,9 +2407,7 @@ void tst_QFile::virtualFile() void tst_QFile::textFile() { -#if defined(Q_OS_WINCE) - FILE *fs = ::fopen((QCoreApplication::applicationDirPath() + "/writeabletextfile").toLatin1() , "wt"); -#elif defined(Q_OS_WIN) +#if defined(Q_OS_WIN) FILE *fs = ::fopen("writeabletextfile", "wt"); #else FILE *fs = ::fopen("writeabletextfile", "w"); @@ -2658,7 +2620,7 @@ void tst_QFile::appendAndRead() void tst_QFile::miscWithUncPathAsCurrentDir() { -#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT) +#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) QString current = QDir::currentPath(); const QString path = QLatin1String("//") + QtNetworkSettings::winServerName() + QLatin1String("/testshare"); @@ -2682,7 +2644,6 @@ void tst_QFile::standarderror() void tst_QFile::handle() { int fd; -#if !defined(Q_OS_WINCE) QFile file(m_testSourceFile); QVERIFY2(file.open(QIODevice::ReadOnly), msgOpenFailed(file).constData()); fd = int(file.handle()); @@ -2710,7 +2671,6 @@ void tst_QFile::handle() #endif QCOMPARE(c, '*'); -#endif //test round trip of adopted stdio file handle QFile file2; @@ -2953,10 +2913,6 @@ void tst_QFile::map() QString fileName = QDir::currentPath() + '/' + "qfile_map_testfile"; -#ifdef Q_OS_WINCE - fileName = QFileInfo(fileName).absoluteFilePath(); -#endif - if (QFile::exists(fileName)) { QVERIFY(QFile::setPermissions(fileName, QFile::WriteOwner | QFile::ReadOwner | QFile::WriteUser | QFile::ReadUser)); @@ -2998,7 +2954,7 @@ void tst_QFile::map() QCOMPARE(file.error(), QFile::NoError); // hpux won't let you map multiple times. -#if !defined(Q_OS_HPUX) && !defined(Q_USE_DEPRECATED_MAP_API) && !defined(Q_OS_WINCE) +#if !defined(Q_OS_HPUX) && !defined(Q_USE_DEPRECATED_MAP_API) // exotic test to make sure that multiple maps work // note: windows ce does not reference count mutliple maps @@ -3121,10 +3077,6 @@ void tst_QFile::mapOpenMode() QVERIFY2(file.open(om), msgOpenFailed(om, file).constData()); uchar *memory = file.map(0, fileSize, QFileDevice::MemoryMapFlags(flags)); -#if defined(Q_OS_WINCE) - QEXPECT_FAIL("ReadOnly + MapPrivate" , "Windows CE does not support MapPrivateOption.", Abort); - QEXPECT_FAIL("ReadWrite + MapPrivate", "Windows CE does not support MapPrivateOption.", Abort); -#endif QVERIFY(memory); QVERIFY(memcmp(memory, pattern, fileSize) == 0); @@ -3157,10 +3109,6 @@ void tst_QFile::mapWrittenFile() QString fileName = QDir::currentPath() + '/' + "qfile_map_testfile"; -#ifdef Q_OS_WINCE - fileName = QFileInfo(fileName).absoluteFilePath(); -#endif - if (QFile::exists(fileName)) { QVERIFY(QFile::setPermissions(fileName, QFile::WriteOwner | QFile::ReadOwner | QFile::WriteUser | QFile::ReadUser)); @@ -3259,10 +3207,6 @@ protected: bool MessageHandler::ok = true; QtMessageHandler MessageHandler::oldMessageHandler = 0; - //allthough Windows CE (not mobile!) has functions that allow redirecting - //the standard file descriptors to a file (see SetStdioPathW/GetStdioPathW) - //it does not have functions to simply open them like below . -#ifndef Q_OS_WINCE void tst_QFile::openStandardStreamsFileDescriptors() { @@ -3322,7 +3266,6 @@ void tst_QFile::openStandardStreamsBufferedStreams() QVERIFY(msgHandler.testPassed()); } -#endif void tst_QFile::writeNothing() { diff --git a/tests/auto/corelib/io/qfileinfo/qfileinfo.pro b/tests/auto/corelib/io/qfileinfo/qfileinfo.pro index 8aa81896cc..8d443c27ec 100644 --- a/tests/auto/corelib/io/qfileinfo/qfileinfo.pro +++ b/tests/auto/corelib/io/qfileinfo/qfileinfo.pro @@ -5,6 +5,6 @@ SOURCES = tst_qfileinfo.cpp RESOURCES += qfileinfo.qrc \ testdata.qrc -win32:!wince:!winrt:LIBS += -ladvapi32 -lnetapi32 +win32:!winrt:LIBS += -ladvapi32 -lnetapi32 win32: CONFIG += insignificant_test # Crashes on Windows in release builds diff --git a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp index 4362bace8c..f10c746618 100644 --- a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp +++ b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp @@ -49,13 +49,13 @@ #ifdef Q_OS_WIN #include #include -#if !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT) +#if !defined(Q_OS_WINRT) #include #endif #endif #include #include -#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) +#if defined(Q_OS_WIN) #include "../../../network-settings.h" #endif #include @@ -256,7 +256,7 @@ private slots: void refresh(); -#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT) +#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) void ntfsJunctionPointsAndSymlinks_data(); void ntfsJunctionPointsAndSymlinks(); void brokenShortcut(); @@ -273,7 +273,7 @@ private slots: void detachingOperations(); -#if !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT) +#if !defined(Q_OS_WINRT) void owner(); #endif void group(); @@ -354,17 +354,8 @@ void tst_QFileInfo::copy() file.flush(); QTest::qWait(250); -#if defined(Q_OS_WIN) || defined(Q_OS_WINCE) - if (QSysInfo::windowsVersion() & QSysInfo::WV_VISTA || - QSysInfo::windowsVersion() & QSysInfo::WV_CE_based) - file.close(); -#endif -#if defined(Q_OS_WINCE) - // On Windows CE we need to close the file. - // Otherwise the content will be cached and not - // flushed to the storage, although we flushed it - // manually!!! CE has interim cache, we cannot influence. - QTest::qWait(5000); +#if defined(Q_OS_WIN) + file.close(); #endif info3.refresh(); privateInfo3 = getPrivate(info3); @@ -422,12 +413,12 @@ void tst_QFileInfo::isDir_data() QTest::newRow("broken link") << "brokenlink.lnk" << false; -#if (defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)) +#if (defined(Q_OS_WIN) && !defined(Q_OS_WINRT)) QTest::newRow("drive 1") << "c:" << true; QTest::newRow("drive 2") << "c:/" << true; //QTest::newRow("drive 2") << "t:s" << false; #endif -#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT) +#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) const QString uncRoot = QStringLiteral("//") + QtNetworkSettings::winServerName(); QTest::newRow("unc 1") << uncRoot << true; QTest::newRow("unc 2") << uncRoot + QLatin1Char('/') << true; @@ -464,13 +455,13 @@ void tst_QFileInfo::isRoot_data() QTest::newRow("simple dir") << m_resourcesDir << false; QTest::newRow("simple dir with slash") << (m_resourcesDir + QLatin1Char('/')) << false; -#if (defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)) +#if (defined(Q_OS_WIN) && !defined(Q_OS_WINRT)) QTest::newRow("drive 1") << "c:" << false; QTest::newRow("drive 2") << "c:/" << true; QTest::newRow("drive 3") << "p:/" << false; #endif -#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT) +#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) const QString uncRoot = QStringLiteral("//") + QtNetworkSettings::winServerName(); QTest::newRow("unc 1") << uncRoot << true; QTest::newRow("unc 2") << uncRoot + QLatin1Char('/') << true; @@ -519,7 +510,7 @@ void tst_QFileInfo::exists_data() QTest::newRow("simple dir") << m_resourcesDir << true; QTest::newRow("simple dir with slash") << (m_resourcesDir + QLatin1Char('/')) << true; -#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT) +#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) const QString uncRoot = QStringLiteral("//") + QtNetworkSettings::winServerName(); QTest::newRow("unc 1") << uncRoot << true; QTest::newRow("unc 2") << uncRoot + QLatin1Char('/') << true; @@ -554,7 +545,7 @@ void tst_QFileInfo::absolutePath_data() QTest::addColumn("filename"); QString drivePrefix; -#if (defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)) +#if (defined(Q_OS_WIN) && !defined(Q_OS_WINRT)) drivePrefix = QDir::currentPath().left(2); QString nonCurrentDrivePrefix = drivePrefix.left(1).compare("X", Qt::CaseInsensitive) == 0 ? QString("Y:") : QString("X:"); @@ -573,7 +564,7 @@ void tst_QFileInfo::absolutePath_data() QTest::newRow("3") << "/usr/local/bin/" << drivePrefix + "/usr/local/bin" << ""; QTest::newRow("/test") << "/test" << drivePrefix + "/" << "test"; -#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT) +#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) QTest::newRow("c:\\autoexec.bat") << "c:\\autoexec.bat" << "C:/" << "autoexec.bat"; QTest::newRow("c:autoexec.bat") << QDir::currentPath().left(2) + "autoexec.bat" << QDir::currentPath() @@ -606,7 +597,7 @@ void tst_QFileInfo::absFilePath_data() QTest::newRow("relativeFile") << "tmp.txt" << QDir::currentPath() + "/tmp.txt"; QTest::newRow("relativeFileInSubDir") << "temp/tmp.txt" << QDir::currentPath() + "/" + "temp/tmp.txt"; QString drivePrefix; -#if (defined(Q_OS_WIN) && !defined(Q_OS_WINCE)) +#if defined(Q_OS_WIN) QString curr = QDir::currentPath(); curr.remove(0, 2); // Make it a absolute path with no drive specifier: \depot\qt-4.2\tests\auto\qfileinfo @@ -774,7 +765,7 @@ void tst_QFileInfo::fileName_data() QTest::newRow("relativeFile") << "tmp.txt" << "tmp.txt"; QTest::newRow("relativeFileInSubDir") << "temp/tmp.txt" << "tmp.txt"; -#if (defined(Q_OS_WIN) && !defined(Q_OS_WINCE)) +#if defined(Q_OS_WIN) QTest::newRow("absFilePath") << "c:\\home\\andy\\tmp.txt" << "tmp.txt"; QTest::newRow("driveWithNoSlash") << "c:tmp.txt" << "tmp.txt"; #else @@ -1024,7 +1015,7 @@ void tst_QFileInfo::size() void tst_QFileInfo::systemFiles() { -#if !defined(Q_OS_WIN) || defined(Q_OS_WINCE) || defined(Q_OS_WINRT) +#if !defined(Q_OS_WIN) || defined(Q_OS_WINRT) QSKIP("This is a Windows only test"); #endif QFileInfo fi("c:\\pagefile.sys"); @@ -1121,11 +1112,7 @@ void tst_QFileInfo::fileTimes_data() void tst_QFileInfo::fileTimes() { -#if defined(Q_OS_WINCE) - int sleepTime = 3000; -#else int sleepTime = 2000; -#endif QFETCH(QString, fileName); if (QFile::exists(fileName)) { QVERIFY(QFile::remove(fileName)); @@ -1133,10 +1120,6 @@ void tst_QFileInfo::fileTimes() QTest::qSleep(sleepTime); { QFile file(fileName); -#if defined(Q_OS_WINCE) - QEXPECT_FAIL("longfile", "No long filenames on WinCE", Abort); - QEXPECT_FAIL("longfile absolutepath", "No long filenames on WinCE", Abort); -#endif QVERIFY(file.open(QFile::WriteOnly | QFile::Text)); #if defined(Q_OS_UNIX) && !defined(Q_OS_VXWORKS) if (qIsLikelyToBeNfs(file.handle())) @@ -1162,7 +1145,7 @@ void tst_QFileInfo::fileTimes() { QFileInfo fileInfo(fileName); // On unix created() returns the same as lastModified(). -#if !defined(Q_OS_UNIX) && !defined(Q_OS_WINCE) +#if !defined(Q_OS_UNIX) QVERIFY(fileInfo.created() < beforeWrite); #endif QVERIFY(fileInfo.lastModified() > beforeWrite); @@ -1174,7 +1157,7 @@ void tst_QFileInfo::fileTimes() } QFileInfo fileInfo(fileName); -#if !defined(Q_OS_UNIX) && !defined(Q_OS_WINCE) +#if !defined(Q_OS_UNIX) QVERIFY(fileInfo.created() < beforeWrite); #endif //In Vista the last-access timestamp is not updated when the file is accessed/touched (by default). @@ -1193,9 +1176,7 @@ void tst_QFileInfo::fileTimes() RegCloseKey(key); } #endif -#if defined(Q_OS_WINCE) - QEXPECT_FAIL("simple", "WinCE only stores date of access data, not the time", Continue); -#elif defined(Q_OS_WINRT) +#if defined(Q_OS_WINRT) QEXPECT_FAIL("", "WinRT does not allow timestamp handling change in the filesystem due to sandboxing", Continue); #elif defined(Q_OS_QNX) QEXPECT_FAIL("", "QNX uses the noatime filesystem option", Continue); @@ -1211,8 +1192,8 @@ void tst_QFileInfo::fileTimes() void tst_QFileInfo::fileTimes_oldFile() { - // This is not supported on WinCE or WinRT -#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT) + // This is not supported on WinRT +#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) // All files are opened in share mode (both read and write). DWORD shareMode = FILE_SHARE_READ | FILE_SHARE_WRITE; @@ -1310,7 +1291,7 @@ void tst_QFileInfo::isHidden_data() QTest::newRow(qPrintable("drive." + info.path())) << info.path() << false; } -#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) +#if defined(Q_OS_WIN) QVERIFY(QDir("./hidden-directory").exists() || QDir().mkdir("./hidden-directory")); QVERIFY(SetFileAttributesW(reinterpret_cast(QString("./hidden-directory").utf16()),FILE_ATTRIBUTE_HIDDEN)); QTest::newRow("C:/path/to/hidden-directory") << QDir::currentPath() + QString::fromLatin1("/hidden-directory") << true; @@ -1413,7 +1394,7 @@ void tst_QFileInfo::isNativePath() void tst_QFileInfo::refresh() { -#if defined(Q_OS_WINCE) || defined(Q_OS_WIN) +#if defined(Q_OS_WIN) int sleepTime = 3000; #else int sleepTime = 2000; @@ -1436,17 +1417,8 @@ void tst_QFileInfo::refresh() QCOMPARE(info.lastModified(), lastModified); QCOMPARE(info.size(), qint64(7)); -#if defined(Q_OS_WIN) || defined(Q_OS_WINCE) - if (QSysInfo::windowsVersion() & QSysInfo::WV_VISTA || - QSysInfo::windowsVersion() & QSysInfo::WV_CE_based) - file.close(); -#endif -#if defined(Q_OS_WINCE) - // On Windows CE we need to close the file. - // Otherwise the content will be cached and not - // flushed to the storage, although we flushed it - // manually!!! CE has interim cache, we cannot influence. - QTest::qWait(5000); +#if defined(Q_OS_WIN) + file.close(); #endif info.refresh(); QCOMPARE(info.size(), qint64(13)); @@ -1459,7 +1431,7 @@ void tst_QFileInfo::refresh() QCOMPARE(info2.size(), info.size()); } -#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT) +#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) void tst_QFileInfo::ntfsJunctionPointsAndSymlinks_data() { QTest::addColumn("path"); @@ -1633,11 +1605,7 @@ void tst_QFileInfo::isWritable() tempfile.remove(); #if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) -#ifdef Q_OS_WINCE - QFileInfo fi("\\Windows\\wince.nls"); -#else QFileInfo fi("c:\\pagefile.sys"); -#endif QVERIFY2(fi.exists(), msgDoesNotExist(fi.absoluteFilePath()).constData()); QVERIFY(!fi.isWritable()); #endif @@ -1813,8 +1781,7 @@ void tst_QFileInfo::detachingOperations() QVERIFY(!info1.caching()); } -#if !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT) -#if defined (Q_OS_WIN) +#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) BOOL IsUserAdmin() { BOOL b; @@ -1835,14 +1802,14 @@ BOOL IsUserAdmin() return(b); } -#endif -#if defined(Q_OS_WIN) QT_BEGIN_NAMESPACE extern Q_CORE_EXPORT int qt_ntfs_permission_lookup; QT_END_NAMESPACE -#endif +#endif // Q_OS_WIN && !Q_OS_WINRT + +#ifndef Q_OS_WINRT void tst_QFileInfo::owner() { QString userName; @@ -1904,7 +1871,7 @@ void tst_QFileInfo::owner() qt_ntfs_permission_lookup = 0; #endif } -#endif +#endif // !Q_OS_WINRT void tst_QFileInfo::group() { diff --git a/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp b/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp index 5c9de8abb9..7060cf46ac 100644 --- a/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp +++ b/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp @@ -146,12 +146,7 @@ void tst_QFileSystemWatcher::basicTest() // resolution of the modification time is system dependent, but it's at most 1 second when using // the polling engine. I've heard rumors that FAT32 has a 2 second resolution. So, we have to // wait a bit before we can modify the file (hrmph)... -#ifndef Q_OS_WINCE QTest::qWait(2000); -#else - // WinCE is always a little bit slower. Give it a little bit more time - QTest::qWait(5000); -#endif testFile.open(QIODevice::WriteOnly | QIODevice::Append); testFile.write(QByteArray("world")); @@ -309,9 +304,6 @@ void tst_QFileSystemWatcher::watchDirectory() QVERIFY(temporaryDir.rmdir(testDirName)); // waiting max 5 seconds for notification for directory removal to trigger -#ifdef Q_OS_WINCE - QEXPECT_FAIL("poller", "Directory does not get updated on file removal(See #137910)", Abort); -#endif QTRY_COMPARE(changedSpy.count(), 2); QCOMPARE(changedSpy.at(0).count(), 1); QCOMPARE(changedSpy.at(1).count(), 1); @@ -553,9 +545,6 @@ void tst_QFileSystemWatcher::watchFileAndItsDirectory() QEXPECT_FAIL("", "See QTBUG-30943", Continue); #endif QCOMPARE(fileChangedSpyCount, 0); -#ifdef Q_OS_WINCE - QEXPECT_FAIL("poller", "Directory does not get updated on file removal(See #137910)", Abort); -#endif QCOMPARE(dirChangedSpy.count(), 1); dirChangedSpy.clear(); diff --git a/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp b/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp index 8d5a4055b8..2a5d593d9a 100644 --- a/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp +++ b/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp @@ -100,9 +100,6 @@ void tst_QIODevice::getSetCheck() //---------------------------------------------------------------------------------- void tst_QIODevice::constructing_QTcpSocket() { -#if defined(Q_OS_WINCE) && defined(WINCE_EMULATOR_TEST) - QSKIP("Networking tests in a WinCE emulator are unstable"); -#endif if (!QtNetworkSettings::verifyTestNetworkSettings()) QSKIP("No network test server available"); @@ -205,9 +202,6 @@ void tst_QIODevice::read_QByteArray() //-------------------------------------------------------------------- void tst_QIODevice::unget() { -#if defined(Q_OS_WINCE) && defined(WINCE_EMULATOR_TEST) - QSKIP("Networking tests in a WinCE emulator are unstable"); -#endif #if defined(Q_OS_MAC) QSKIP("The unget network test is unstable on Mac. See QTBUG-39983."); #endif diff --git a/tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp b/tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp index 851c104c6a..6814302a1f 100644 --- a/tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp +++ b/tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp @@ -34,7 +34,7 @@ #include #if defined(Q_OS_UNIX) && !defined(Q_OS_VXWORKS) #include -#elif defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT) +#elif defined(Q_OS_WIN) && !defined(Q_OS_WINRT) # include #endif @@ -281,7 +281,7 @@ void tst_QLockFile::staleLockFromCrashedProcessReusedPid() { #if defined(QT_NO_PROCESS) QSKIP("This test requires QProcess support"); -#elif defined(Q_OS_WINRT) || defined(Q_OS_WINCE) || defined(Q_OS_IOS) +#elif defined(Q_OS_WINRT) || defined(Q_OS_IOS) QSKIP("We cannot retrieve information about other processes on this platform."); #else const QString fileName = dir.path() + "/staleLockFromCrashedProcessReusedPid"; @@ -455,7 +455,7 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(ProcessProperties) static inline ProcessProperties processProperties() { ProcessProperties result; -#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT) +#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) HANDLE processToken = NULL; if (OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &processToken)) { DWORD elevation; // struct containing a DWORD, not present in some MinGW headers. @@ -484,7 +484,7 @@ void tst_QLockFile::noPermissionsWindows() { // Windows: Do the permissions test in a system directory in which // files cannot be created. -#if !defined(Q_OS_WIN) || defined(Q_OS_WINCE) || defined(Q_OS_WINRT) +#if !defined(Q_OS_WIN) || defined(Q_OS_WINRT) QSKIP("This test is for desktop Windows only"); #endif #ifdef Q_OS_WIN diff --git a/tests/auto/corelib/io/qlockfile/tst_qlockfile.pro b/tests/auto/corelib/io/qlockfile/tst_qlockfile.pro index 6eb72343bc..7b83d5dbe8 100644 --- a/tests/auto/corelib/io/qlockfile/tst_qlockfile.pro +++ b/tests/auto/corelib/io/qlockfile/tst_qlockfile.pro @@ -4,4 +4,4 @@ TARGET = tst_qlockfile SOURCES += tst_qlockfile.cpp QT = core testlib concurrent -win32:!wince:!winrt:LIBS += -ladvapi32 +win32:!winrt:LIBS += -ladvapi32 diff --git a/tests/auto/corelib/io/qprocess/qprocess.pri b/tests/auto/corelib/io/qprocess/qprocess.pri index a43c823846..d5a7532ee1 100644 --- a/tests/auto/corelib/io/qprocess/qprocess.pri +++ b/tests/auto/corelib/io/qprocess/qprocess.pri @@ -10,13 +10,12 @@ SUBPROGRAMS = \ testProcessDeadWhileReading \ testProcessEOF \ testExitCodes \ + testForwarding \ testGuiProcess \ testDetached \ fileWriterProcess \ testSetWorkingDirectory \ testSoftExit -!contains(QMAKE_PLATFORM, wince): SUBPROGRAMS += testForwarding - !qtHaveModule(widgets): SUBPROGRAMS -= \ testGuiProcess diff --git a/tests/auto/corelib/io/qprocess/qprocess.pro b/tests/auto/corelib/io/qprocess/qprocess.pro index 6ba54b1e92..3867ac5741 100644 --- a/tests/auto/corelib/io/qprocess/qprocess.pro +++ b/tests/auto/corelib/io/qprocess/qprocess.pro @@ -8,7 +8,7 @@ SUBDIRS += testProcessSpacesArgs/nospace.pro \ testProcessSpacesArgs/twospaces.pro \ testSpaceInName -win32:!wince* { +win32 { SUBDIRS += \ testProcessEchoGui \ testSetNamedPipeHandleState diff --git a/tests/auto/corelib/io/qprocess/testProcessSpacesArgs/main.cpp b/tests/auto/corelib/io/qprocess/testProcessSpacesArgs/main.cpp index 494d8147a7..0d40a9b83c 100644 --- a/tests/auto/corelib/io/qprocess/testProcessSpacesArgs/main.cpp +++ b/tests/auto/corelib/io/qprocess/testProcessSpacesArgs/main.cpp @@ -31,21 +31,10 @@ int main(int argc, char ** argv) { -#if defined(WINCE) || defined(_WIN32_WCE) - // No pipes on this "OS" - FILE* file = fopen("\\temp\\qprocess_args_test.txt","w+"); - for (int i = 0; i < argc; ++i) { - if (i) - fprintf(file, "|"); - fprintf(file, argv[i]); - } - fclose(file); -#else for (int i = 0; i < argc; ++i) { if (i) printf("|"); printf("%s", argv[i]); } -#endif return 0; } diff --git a/tests/auto/corelib/io/qprocess/testSoftExit/testSoftExit.pro b/tests/auto/corelib/io/qprocess/testSoftExit/testSoftExit.pro index d19a631cae..80e8bcad98 100644 --- a/tests/auto/corelib/io/qprocess/testSoftExit/testSoftExit.pro +++ b/tests/auto/corelib/io/qprocess/testSoftExit/testSoftExit.pro @@ -1,6 +1,6 @@ win32 { SOURCES = main_win.cpp - !wince: LIBS += -luser32 + LIBS += -luser32 } unix { SOURCES = main_unix.cpp diff --git a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp index c47e88b0e6..1da9cf38a1 100644 --- a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp +++ b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp @@ -66,7 +66,6 @@ private slots: void startDetached(); void crashTest(); void crashTest2(); -#ifndef Q_OS_WINCE void echoTest_data(); void echoTest(); void echoTest2(); @@ -112,7 +111,6 @@ private slots: void discardUnwantedOutput(); void setWorkingDirectory(); void setNonExistentWorkingDirectory(); -#endif // not Q_OS_WINCE void exitStatus_data(); void exitStatus(); @@ -156,11 +154,9 @@ protected slots: void readFromProcess(); void exitLoopSlot(); void processApplicationEvents(); -#ifndef Q_OS_WINCE void restartProcess(); void waitForReadyReadInAReadyReadSlotSlot(); void waitForBytesWrittenInABytesWrittenSlotSlot(); -#endif private: qint64 bytesAvailable; @@ -411,8 +407,6 @@ void tst_QProcess::crashTest2() QCOMPARE(process.exitStatus(), QProcess::CrashExit); } -#ifndef Q_OS_WINCE -//Reading and writing to a process is not supported on Qt/CE void tst_QProcess::echoTest_data() { QTest::addColumn("input"); @@ -467,7 +461,6 @@ void tst_QProcess::echoTest() QCOMPARE(process.exitStatus(), QProcess::NormalExit); QCOMPARE(process.exitCode(), 0); } -#endif void tst_QProcess::exitLoopSlot() { @@ -479,8 +472,6 @@ void tst_QProcess::processApplicationEvents() QCoreApplication::processEvents(); } -#ifndef Q_OS_WINCE -// Reading and writing to a process is not supported on Qt/CE void tst_QProcess::echoTest2() { @@ -528,10 +519,8 @@ void tst_QProcess::echoTest2() QCOMPARE(process.exitStatus(), QProcess::NormalExit); QCOMPARE(process.exitCode(), 0); } -#endif -#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) -// Reading and writing to a process is not supported on Qt/CE +#if defined(Q_OS_WIN) void tst_QProcess::echoTestGui() { QProcess process; @@ -560,10 +549,9 @@ void tst_QProcess::testSetNamedPipeHandleState() QCOMPARE(process.exitCode(), 0); QCOMPARE(process.exitStatus(), QProcess::NormalExit); } -#endif // !Q_OS_WINCE && Q_OS_WIN +#endif // Q_OS_WIN -#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) -// Batch files are not supported on Windows CE +#if defined(Q_OS_WIN) void tst_QProcess::batFiles_data() { QTest::addColumn("batFile"); @@ -590,7 +578,7 @@ void tst_QProcess::batFiles() QVERIFY(proc.readAll().startsWith(output)); } -#endif // !Q_OS_WINCE && Q_OS_WIN +#endif // Q_OS_WIN void tst_QProcess::exitStatus_data() { @@ -632,8 +620,6 @@ void tst_QProcess::exitStatus() } } -#ifndef Q_OS_WINCE -// Reading and writing to a process is not supported on Qt/CE void tst_QProcess::loopBackTest() { @@ -654,10 +640,7 @@ void tst_QProcess::loopBackTest() QCOMPARE(process.exitStatus(), QProcess::NormalExit); QCOMPARE(process.exitCode(), 0); } -#endif -#ifndef Q_OS_WINCE -// Reading and writing to a process is not supported on Qt/CE void tst_QProcess::readTimeoutAndThenCrash() { @@ -688,7 +671,6 @@ void tst_QProcess::readTimeoutAndThenCrash() QCOMPARE(spy2.count(), 1); QCOMPARE(*static_cast(spy2.at(0).at(0).constData()), QProcess::Crashed); } -#endif void tst_QProcess::waitForFinished() { @@ -699,9 +681,6 @@ void tst_QProcess::waitForFinished() QVERIFY(process.waitForFinished()); QCOMPARE(process.exitStatus(), QProcess::NormalExit); -#if defined (Q_OS_WINCE) - QEXPECT_FAIL("", "Reading and writing to a process is not supported on Qt/CE", Continue); -#endif QString output = process.readAll(); QCOMPARE(output.count("\n"), 10*1024); @@ -713,8 +692,6 @@ void tst_QProcess::waitForFinished() QCOMPARE(process.error(), QProcess::FailedToStart); } -#ifndef Q_OS_WINCE -// Reading and writing to a process is not supported on Qt/CE void tst_QProcess::deadWhileReading() { QProcess process; @@ -732,10 +709,7 @@ void tst_QProcess::deadWhileReading() QCOMPARE(process.exitStatus(), QProcess::NormalExit); QCOMPARE(process.exitCode(), 0); } -#endif -#ifndef Q_OS_WINCE -// Reading and writing to a process is not supported on Qt/CE void tst_QProcess::restartProcessDeadlock() { @@ -765,10 +739,7 @@ void tst_QProcess::restartProcess() QVERIFY(process); process->start("testProcessEcho/testProcessEcho"); } -#endif -#ifndef Q_OS_WINCE -// Reading and writing to a process is not supported on Qt/CE void tst_QProcess::closeWriteChannel() { QProcess more; @@ -794,10 +765,7 @@ void tst_QProcess::closeWriteChannel() QCOMPARE(more.exitStatus(), QProcess::NormalExit); QCOMPARE(more.exitCode(), 0); } -#endif -#ifndef Q_OS_WINCE -// Reading and writing to a process is not supported on Qt/CE" void tst_QProcess::closeReadChannel() { for (int i = 0; i < 10; ++i) { @@ -827,10 +795,7 @@ void tst_QProcess::closeReadChannel() QCOMPARE(proc.exitCode(), 0); } } -#endif -#ifndef Q_OS_WINCE -// Reading and writing to a process is not supported on Qt/CE void tst_QProcess::openModes() { QProcess proc; @@ -871,10 +836,7 @@ void tst_QProcess::openModes() QVERIFY(!proc.isWritable()); QCOMPARE(proc.state(), QProcess::NotRunning); } -#endif -#ifndef Q_OS_WINCE -// Reading and writing to a process is not supported on Qt/CE void tst_QProcess::emitReadyReadOnlyWhenNewDataArrives() { @@ -908,17 +870,12 @@ void tst_QProcess::emitReadyReadOnlyWhenNewDataArrives() QCOMPARE(proc.exitStatus(), QProcess::NormalExit); QCOMPARE(proc.exitCode(), 0); } -#endif void tst_QProcess::hardExit() { QProcess proc; -#if defined(Q_OS_WINCE) - proc.start("testSoftExit/testSoftExit"); -#else proc.start("testProcessEcho/testProcessEcho"); -#endif QVERIFY2(proc.waitForStarted(), qPrintable(proc.errorString())); proc.kill(); @@ -935,9 +892,7 @@ void tst_QProcess::softExit() proc.start("testSoftExit/testSoftExit"); QVERIFY(proc.waitForStarted(10000)); -#if !defined(Q_OS_WINCE) QVERIFY(proc.waitForReadyRead(10000)); -#endif QVERIFY(proc.processId() > 0); @@ -948,8 +903,6 @@ void tst_QProcess::softExit() QCOMPARE(int(proc.error()), int(QProcess::UnknownError)); } -#ifndef Q_OS_WINCE -// Reading and writing to a process is not supported on Qt/CE class SoftExitProcess : public QProcess { Q_OBJECT @@ -1071,10 +1024,7 @@ void tst_QProcess::softExitInSlots() QTRY_VERIFY_WITH_TIMEOUT(proc.waitedForFinished, 10000); QCOMPARE(proc.state(), QProcess::NotRunning); } -#endif -#ifndef Q_OS_WINCE -// Reading and writing to a process is not supported on Qt/CE void tst_QProcess::mergedChannels() { QProcess process; @@ -1097,10 +1047,6 @@ void tst_QProcess::mergedChannels() QCOMPARE(process.exitStatus(), QProcess::NormalExit); QCOMPARE(process.exitCode(), 0); } -#endif - -#ifndef Q_OS_WINCE -// Reading and writing to a process is not supported on Qt/CE void tst_QProcess::forwardedChannels_data() { @@ -1153,10 +1099,7 @@ void tst_QProcess::forwardedChannels() QCOMPARE(process.readAllStandardOutput(), outdata); QCOMPARE(process.readAllStandardError(), errdata); } -#endif -#ifndef Q_OS_WINCE -// Reading and writing to a process is not supported on Qt/CE void tst_QProcess::atEnd() { QProcess process; @@ -1178,7 +1121,6 @@ void tst_QProcess::atEnd() QCOMPARE(process.exitStatus(), QProcess::NormalExit); QCOMPARE(process.exitCode(), 0); } -#endif class TestThread : public QThread { @@ -1200,9 +1142,7 @@ protected: process.start("testProcessEcho/testProcessEcho"); -#if !defined(Q_OS_WINCE) QCOMPARE(process.write("abc\0", 4), qint64(4)); -#endif exitCode = exec(); } @@ -1251,8 +1191,6 @@ void tst_QProcess::processesInMultipleThreads() } } -#ifndef Q_OS_WINCE -// Reading and writing to a process is not supported on Qt/CE void tst_QProcess::waitForFinishedWithTimeout() { QProcess process; @@ -1266,10 +1204,7 @@ void tst_QProcess::waitForFinishedWithTimeout() QVERIFY(process.waitForFinished()); } -#endif -#ifndef Q_OS_WINCE -// Reading and writing to a process is not supported on Qt/CE void tst_QProcess::waitForReadyReadInAReadyReadSlot() { QProcess process; @@ -1295,10 +1230,7 @@ void tst_QProcess::waitForReadyReadInAReadyReadSlot() QCOMPARE(process.exitCode(), 0); QVERIFY(process.bytesAvailable() > bytesAvailable); } -#endif -#ifndef Q_OS_WINCE -// Reading and writing to a process is not supported on Qt/CE void tst_QProcess::waitForReadyReadInAReadyReadSlotSlot() { QProcess *process = qobject_cast(sender()); @@ -1308,10 +1240,7 @@ void tst_QProcess::waitForReadyReadInAReadyReadSlotSlot() QVERIFY(process->waitForReadyRead(5000)); QTestEventLoop::instance().exitLoop(); } -#endif -#ifndef Q_OS_WINCE -// Reading and writing to a process is not supported on Qt/CE void tst_QProcess::waitForBytesWrittenInABytesWrittenSlot() { QProcess process; @@ -1334,10 +1263,7 @@ void tst_QProcess::waitForBytesWrittenInABytesWrittenSlot() QCOMPARE(process.exitStatus(), QProcess::NormalExit); QCOMPARE(process.exitCode(), 0); } -#endif -#ifndef Q_OS_WINCE -// Reading and writing to a process is not supported on Qt/CE void tst_QProcess::waitForBytesWrittenInABytesWrittenSlotSlot() { QProcess *process = qobject_cast(sender()); @@ -1346,7 +1272,6 @@ void tst_QProcess::waitForBytesWrittenInABytesWrittenSlotSlot() QVERIFY(process->waitForBytesWritten(5000)); QTestEventLoop::instance().exitLoop(); } -#endif void tst_QProcess::spaceArgsTest_data() { @@ -1425,14 +1350,12 @@ void tst_QProcess::spaceArgsTest() QCOMPARE(process.exitStatus(), QProcess::NormalExit); QCOMPARE(process.exitCode(), 0); -#if !defined(Q_OS_WINCE) QStringList actual = QString::fromLatin1(process.readAll()).split("|"); QVERIFY(!actual.isEmpty()); // not interested in the program name, it might be different. actual.removeFirst(); QCOMPARE(actual, args); -#endif if (program.contains(QLatin1Char(' '))) program = QLatin1Char('"') + program + QLatin1Char('"'); @@ -1449,14 +1372,12 @@ void tst_QProcess::spaceArgsTest() QVERIFY2(started, errorMessage.constData()); QVERIFY(process.waitForFinished(5000)); -#if !defined(Q_OS_WINCE) actual = QString::fromLatin1(process.readAll()).split("|"); QVERIFY(!actual.isEmpty()); // not interested in the program name, it might be different. actual.removeFirst(); QCOMPARE(actual, args); -#endif } } @@ -1477,26 +1398,12 @@ void tst_QProcess::nativeArguments() QCOMPARE(proc.exitStatus(), QProcess::NormalExit); QCOMPARE(proc.exitCode(), 0); -#if defined(Q_OS_WINCE) - // WinCE test outputs to a file, so check that - FILE* file = fopen("\\temp\\qprocess_args_test.txt","r"); - QVERIFY(file); - char buf[256]; - fgets(buf, 256, file); - fclose(file); - QStringList actual = QString::fromLatin1(buf).split(QLatin1Char('|')); -#else QStringList actual = QString::fromLatin1(proc.readAll()).split(QLatin1Char('|')); -#endif QVERIFY(!actual.isEmpty()); // not interested in the program name, it might be different. actual.removeFirst(); QStringList expected; -#if defined(Q_OS_WINCE) - expected << "hello" << "kitty," << "\"*\"!"; // Weird, weird ... -#else expected << "hello" << "kitty," << "*!"; -#endif QCOMPARE(actual, expected); } @@ -1715,8 +1622,6 @@ void tst_QProcess::failToStartEmptyArgs() QCOMPARE(process.error(), QProcess::FailedToStart); } -#ifndef Q_OS_WINCE -// Reading and writing to a process is not supported on Qt/CE void tst_QProcess::removeFileWhileProcessIsRunning() { QFile file(m_temporaryDir.path() + QLatin1String("/removeFile.txt")); @@ -1734,9 +1639,7 @@ void tst_QProcess::removeFileWhileProcessIsRunning() QCOMPARE(process.exitStatus(), QProcess::NormalExit); QCOMPARE(process.exitCode(), 0); } -#endif -#ifndef Q_OS_WINCE -// OS doesn't support environment variables + void tst_QProcess::setEnvironment_data() { QTest::addColumn("name"); @@ -1811,9 +1714,7 @@ void tst_QProcess::setEnvironment() QCOMPARE(process.readAll(), value.toLocal8Bit()); } } -#endif -#ifndef Q_OS_WINCE -// OS doesn't support environment variables + void tst_QProcess::setProcessEnvironment_data() { setEnvironment_data(); @@ -1851,25 +1752,16 @@ void tst_QProcess::setProcessEnvironment() QCOMPARE(process.readAll(), value.toLocal8Bit()); } } -#endif void tst_QProcess::systemEnvironment() { -#if defined (Q_OS_WINCE) - // there is no concept of system variables on Windows CE as there is no console - QVERIFY(QProcess::systemEnvironment().isEmpty()); - QVERIFY(QProcessEnvironment::systemEnvironment().isEmpty()); -#else QVERIFY(!QProcess::systemEnvironment().isEmpty()); QVERIFY(!QProcessEnvironment::systemEnvironment().isEmpty()); QVERIFY(QProcessEnvironment::systemEnvironment().contains("PATH")); QVERIFY(!QProcess::systemEnvironment().filter(QRegExp("^PATH=", Qt::CaseInsensitive)).isEmpty()); -#endif } -#ifndef Q_OS_WINCE -// Reading and writing to a process is not supported on Qt/CE void tst_QProcess::spaceInName() { QProcess process; @@ -1880,7 +1772,6 @@ void tst_QProcess::spaceInName() QCOMPARE(process.exitStatus(), QProcess::NormalExit); QCOMPARE(process.exitCode(), 0); } -#endif void tst_QProcess::lockupsInStartDetached() { @@ -1895,8 +1786,6 @@ void tst_QProcess::lockupsInStartDetached() QProcess::startDetached("yjhbrty"); } -#ifndef Q_OS_WINCE -// Reading and writing to a process is not supported on Qt/CE void tst_QProcess::atEnd2() { QProcess process; @@ -1911,7 +1800,6 @@ void tst_QProcess::atEnd2() } QCOMPARE(lines.size(), 7); } -#endif void tst_QProcess::waitForReadyReadForNonexistantProcess() { @@ -1944,8 +1832,6 @@ void tst_QProcess::waitForReadyReadForNonexistantProcess() QCOMPARE(finishedSpy2.count(), 0); } -#ifndef Q_OS_WINCE -// Reading and writing to a process is not supported on Qt/CE void tst_QProcess::setStandardInputFile() { static const char data[] = "A bunch\1of\2data\3\4\5\6\7..."; @@ -1973,10 +1859,7 @@ void tst_QProcess::setStandardInputFile() all = process2.readAll(); QCOMPARE(all.size(), 0); } -#endif -#ifndef Q_OS_WINCE -// Reading and writing to a process is not supported on Qt/CE void tst_QProcess::setStandardOutputFile_data() { QTest::addColumn("channelToTest"); @@ -2094,10 +1977,7 @@ void tst_QProcess::setStandardOutputFileAndWaitForBytesWritten() QCOMPARE(all, QByteArray::fromRawData(testdata, sizeof testdata - 1)); } -#endif -#ifndef Q_OS_WINCE -// Reading and writing to a process is not supported on Qt/CE void tst_QProcess::setStandardOutputProcess_data() { QTest::addColumn("merged"); @@ -2138,10 +2018,7 @@ void tst_QProcess::setStandardOutputProcess() else QCOMPARE(all, QByteArray("HHeelllloo,, WWoorrlldd")); } -#endif -#ifndef Q_OS_WINCE -// Reading and writing to a process is not supported on Qt/CE void tst_QProcess::fileWriterProcess() { const QByteArray line = QByteArrayLiteral(" -- testing testing 1 2 3\n"); @@ -2175,16 +2052,11 @@ void tst_QProcess::fileWriterProcess() QCOMPARE(QFile(fileName).size(), qint64(stdinStr.size())); } while (stopWatch.elapsed() < 3000); } -#endif void tst_QProcess::detachedWorkingDirectoryAndPid() { qint64 pid; -#ifdef Q_OS_WINCE - QTest::qSleep(1000); -#endif - QFile infoFile(m_temporaryDir.path() + QLatin1String("/detachedinfo.txt")); if (infoFile.exists()) QVERIFY(infoFile.remove()); @@ -2221,8 +2093,6 @@ void tst_QProcess::detachedWorkingDirectoryAndPid() QCOMPARE(actualPid, pid); } -#ifndef Q_OS_WINCE -// Reading and writing to a process is not supported on Qt/CE void tst_QProcess::switchReadChannels() { const char data[] = "ABCD"; @@ -2251,10 +2121,7 @@ void tst_QProcess::switchReadChannels() process.setReadChannel(QProcess::StandardOutput); QCOMPARE(process.read(1), QByteArray("D")); } -#endif -#ifndef Q_OS_WINCE -// Reading and writing to a process is not supported on Qt/CE void tst_QProcess::discardUnwantedOutput() { QProcess process; @@ -2272,11 +2139,8 @@ void tst_QProcess::discardUnwantedOutput() process.setReadChannel(QProcess::StandardError); QCOMPARE(process.bytesAvailable(), Q_INT64_C(0)); } -#endif -#ifndef Q_OS_WINCE // Q_OS_WIN - setWorkingDirectory will chdir before starting the process on unices -// Windows CE does not support working directory logic void tst_QProcess::setWorkingDirectory() { QProcess process; @@ -2315,7 +2179,6 @@ void tst_QProcess::setNonExistentWorkingDirectory() QVERIFY2(process.errorString().startsWith("chdir:"), process.errorString().toLocal8Bit()); #endif } -#endif void tst_QProcess::startFinishStartFinish() { @@ -2325,11 +2188,9 @@ void tst_QProcess::startFinishStartFinish() QCOMPARE(process.state(), QProcess::NotRunning); process.start("testProcessOutput/testProcessOutput"); -#if !defined(Q_OS_WINCE) QVERIFY(process.waitForReadyRead(10000)); QCOMPARE(QString::fromLatin1(process.readLine().trimmed()), QString("0 -this is a number")); -#endif if (process.state() != QProcess::NotRunning) { QVERIFY(process.waitForFinished(10000)); QCOMPARE(process.exitStatus(), QProcess::NormalExit); diff --git a/tests/auto/corelib/io/qprocessenvironment/tst_qprocessenvironment.cpp b/tests/auto/corelib/io/qprocessenvironment/tst_qprocessenvironment.cpp index a4a5d5b0c7..af5078a3dc 100644 --- a/tests/auto/corelib/io/qprocessenvironment/tst_qprocessenvironment.cpp +++ b/tests/auto/corelib/io/qprocessenvironment/tst_qprocessenvironment.cpp @@ -44,9 +44,7 @@ private slots: void caseSensitivity(); void systemEnvironment(); -#ifndef Q_OS_WINCE void putenv(); -#endif }; void tst_QProcessEnvironment::operator_eq() @@ -257,12 +255,6 @@ void tst_QProcessEnvironment::systemEnvironment() QVERIFY(nonexistant.isNull()); -#ifdef Q_OS_WINCE - // Windows CE has no environment - QVERIFY(path.isEmpty()); - QVERIFY(!system.contains("PATH")); - QVERIFY(system.isEmpty()); -#else // all other system have environments if (path.isEmpty()) QFAIL("Could not find the PATH environment variable -- please correct the test environment"); @@ -272,18 +264,15 @@ void tst_QProcessEnvironment::systemEnvironment() QVERIFY(!system.contains(envname)); -# ifdef Q_OS_WIN +#ifdef Q_OS_WIN // check case-insensitive too QVERIFY(system.contains("path")); QCOMPARE(system.value("path"), QString::fromLocal8Bit(path)); QVERIFY(!system.contains(QString(envname).toLower())); -# endif #endif } -#ifndef Q_OS_WINCE -//Windows CE has no environment void tst_QProcessEnvironment::putenv() { static const char envname[] = "WE_RE_SETTING_THIS_ENVIRONMENT_VARIABLE"; @@ -317,7 +306,6 @@ void tst_QProcessEnvironment::putenv() QCOMPARE(eAfter.value(lower), QString("Hello, World")); # endif } -#endif QTEST_MAIN(tst_QProcessEnvironment) diff --git a/tests/auto/corelib/io/qsettings/tst_qsettings.cpp b/tests/auto/corelib/io/qsettings/tst_qsettings.cpp index 87a801c9dd..60252a91de 100644 --- a/tests/auto/corelib/io/qsettings/tst_qsettings.cpp +++ b/tests/auto/corelib/io/qsettings/tst_qsettings.cpp @@ -1521,7 +1521,7 @@ void tst_QSettings::sync() // Now "some other app" will change other.software.org.ini QString userConfDir = settingsPath("__user__") + QDir::separator(); -#if !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT) +#if !defined(Q_OS_WINRT) unlink((userConfDir + "other.software.org.ini").toLatin1()); rename((userConfDir + "software.org.ini").toLatin1(), (userConfDir + "other.software.org.ini").toLatin1()); diff --git a/tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp b/tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp index 410f512a77..9380b7d73c 100644 --- a/tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp +++ b/tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp @@ -266,7 +266,7 @@ void tst_QTemporaryDir::nonWritableCurrentDir() void tst_QTemporaryDir::openOnRootDrives() { -#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT) +#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) unsigned int lastErrorMode = SetErrorMode(SEM_FAILCRITICALERRORS); #endif // If it's possible to create a file in the root directory, it @@ -280,7 +280,7 @@ void tst_QTemporaryDir::openOnRootDrives() QVERIFY(dir.isValid()); } } -#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT) +#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) SetErrorMode(lastErrorMode); #endif } diff --git a/tests/auto/corelib/io/qtemporaryfile/tst_qtemporaryfile.cpp b/tests/auto/corelib/io/qtemporaryfile/tst_qtemporaryfile.cpp index 53c64166c4..93a3bc895c 100644 --- a/tests/auto/corelib/io/qtemporaryfile/tst_qtemporaryfile.cpp +++ b/tests/auto/corelib/io/qtemporaryfile/tst_qtemporaryfile.cpp @@ -374,9 +374,7 @@ void tst_QTemporaryFile::size() // On CE it takes more time for the filesystem to update // the information. Usually you have to close it or seek // to get latest information. flush() does not help either. -#if !defined(Q_OS_WINCE) QCOMPARE(file.size(), qint64(6)); -#endif file.seek(0); QCOMPARE(file.size(), qint64(6)); } @@ -395,7 +393,7 @@ void tst_QTemporaryFile::resize() void tst_QTemporaryFile::openOnRootDrives() { -#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT) +#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) unsigned int lastErrorMode = SetErrorMode(SEM_FAILCRITICALERRORS); #endif // If it's possible to create a file in the root directory, it @@ -409,19 +407,14 @@ void tst_QTemporaryFile::openOnRootDrives() QVERIFY(file.open()); } } -#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT) +#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) SetErrorMode(lastErrorMode); #endif } void tst_QTemporaryFile::stressTest() { -#if defined(Q_OS_WINCE) - // 200 is still ok, first colision happens after ~30 - const int iterations = 200; -#else const int iterations = 1000; -#endif QSet names; for (int i = 0; i < iterations; ++i) { diff --git a/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp b/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp index 104873b85e..9533989b9d 100644 --- a/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp +++ b/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp @@ -175,20 +175,16 @@ private slots: void octTest(); void zeroTermination(); void ws_manipulator(); -#ifndef Q_OS_WINCE void stillOpenWhenAtEnd(); -#endif void readNewlines_data(); void readNewlines(); void seek(); void pos(); void pos2(); void pos3LargeFile(); -#if !defined(Q_OS_WINCE) void readStdin(); void readAllFromStdin(); void readLineFromStdin(); -#endif void read(); void qbool(); void forcePoint(); @@ -1207,8 +1203,6 @@ void tst_QTextStream::ws_manipulator() } // ------------------------------------------------------------------------------ -#ifndef Q_OS_WINCE -// Qt/CE: Cannot test network on emulator void tst_QTextStream::stillOpenWhenAtEnd() { QFile file(QFINDTESTDATA("tst_qtextstream.cpp")); @@ -1229,7 +1223,6 @@ void tst_QTextStream::stillOpenWhenAtEnd() while (!stream2.readLine().isNull()) {} QVERIFY(socket.isOpen()); } -#endif // ------------------------------------------------------------------------------ void tst_QTextStream::readNewlines_data() @@ -1498,8 +1491,6 @@ void tst_QTextStream::pos3LargeFile() } // ------------------------------------------------------------------------------ -// Qt/CE has no stdin/out support for processes -#if !defined(Q_OS_WINCE) void tst_QTextStream::readStdin() { #ifdef QT_NO_PROCESS @@ -1527,7 +1518,6 @@ void tst_QTextStream::readStdin() } // ------------------------------------------------------------------------------ -// Qt/CE has no stdin/out support for processes void tst_QTextStream::readAllFromStdin() { #ifdef QT_NO_PROCESS @@ -1549,7 +1539,6 @@ void tst_QTextStream::readAllFromStdin() } // ------------------------------------------------------------------------------ -// Qt/CE has no stdin/out support for processes void tst_QTextStream::readLineFromStdin() { #ifdef QT_NO_PROCESS @@ -1572,7 +1561,6 @@ void tst_QTextStream::readLineFromStdin() QVERIFY(stdinProcess.waitForFinished(5000)); #endif } -#endif // ------------------------------------------------------------------------------ void tst_QTextStream::read() @@ -2799,12 +2787,7 @@ void tst_QTextStream::status_real_read() void tst_QTextStream::status_integer_read() { -#ifdef Q_OS_WINCE - QString text = QLatin1String("123 abc "); - QTextStream s(&text); -#else QTextStream s("123 abc "); -#endif int i; QString w; s >> i; @@ -2822,12 +2805,7 @@ void tst_QTextStream::status_integer_read() void tst_QTextStream::status_word_read() { -#ifdef Q_OS_WINCE - QString text = QLatin1String("abc "); - QTextStream s(&text); -#else QTextStream s("abc "); -#endif QString w; s >> w; QCOMPARE(s.status(), QTextStream::Ok); diff --git a/tests/auto/corelib/itemmodels/qitemmodel/modelstotest.cpp b/tests/auto/corelib/itemmodels/qitemmodel/modelstotest.cpp index 4b3f76a78e..6ea7a38137 100644 --- a/tests/auto/corelib/itemmodels/qitemmodel/modelstotest.cpp +++ b/tests/auto/corelib/itemmodels/qitemmodel/modelstotest.cpp @@ -239,18 +239,10 @@ QModelIndex ModelsToTest::populateTestArea(QAbstractItemModel *model) // Basic tree StandardItemModel QModelIndex parent; QVariant blue = QVariant(QColor(Qt::blue)); -#ifndef Q_OS_WINCE for (int i = 0; i < 4; ++i) { -#else - for (int i = 0; i < 2; ++i) { -#endif parent = model->index(0, 0, parent); model->insertRows(0, 26 + i, parent); -#ifndef Q_OS_WINCE - model->insertColumns(0, 26 + i, parent); -#else model->insertColumns(0, 4 + i, parent); -#endif // Fill in some values to make it easier to debug /* for (int x = 0; x < 26 + i; ++x) { @@ -272,18 +264,10 @@ QModelIndex ModelsToTest::populateTestArea(QAbstractItemModel *model) // Basic tree StandardItemModel QModelIndex parent; QVariant blue = QVariant(QColor(Qt::blue)); -#ifndef Q_OS_WINCE for (int i = 0; i < 4; ++i) { -#else - for (int i = 0; i < 2; ++i) { -#endif parent = realModel->index(0, 0, parent); realModel->insertRows(0, 26+i, parent); -#ifndef Q_OS_WINCE - realModel->insertColumns(0, 26+i, parent); -#else realModel->insertColumns(0, 4, parent); -#endif // Fill in some values to make it easier to debug /* for (int x = 0; x < 26+i; ++x) { @@ -324,11 +308,7 @@ QModelIndex ModelsToTest::populateTestArea(QAbstractItemModel *model) QSqlQuery q; q.exec("CREATE TABLE test(id int primary key, name varchar(30))"); q.prepare("INSERT INTO test(id, name) values (?, ?)"); -#ifndef Q_OS_WINCE for (int i = 0; i < 1024; ++i) { -#else - for (int i = 0; i < 512; ++i) { -#endif q.addBindValue(i); q.addBindValue("Mr. Smith" + QString::number(i)); q.exec(); @@ -344,11 +324,7 @@ QModelIndex ModelsToTest::populateTestArea(QAbstractItemModel *model) } if (QListWidget *listWidget = qobject_cast(model->parent())) { -#ifndef Q_OS_WINCE - int items = 100; -#else int items = 50; -#endif while (items--) listWidget->addItem(QLatin1String("item ") + QString::number(items)); return QModelIndex(); diff --git a/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp b/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp index a8de5b7a9a..0691297497 100644 --- a/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp +++ b/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp @@ -155,7 +155,7 @@ void tst_QCoreApplication::qAppName() void tst_QCoreApplication::argc() { -#if defined(Q_OS_WINCE) || defined(Q_OS_WINRT) +#if defined(Q_OS_WINRT) QSKIP("QCoreApplication::arguments() parses arguments from actual command line on this platform."); #endif { diff --git a/tests/auto/corelib/kernel/qeventloop/qeventloop.pro b/tests/auto/corelib/kernel/qeventloop/qeventloop.pro index 5cd043b584..50072dc612 100644 --- a/tests/auto/corelib/kernel/qeventloop/qeventloop.pro +++ b/tests/auto/corelib/kernel/qeventloop/qeventloop.pro @@ -3,6 +3,6 @@ TARGET = tst_qeventloop QT = core network testlib core-private SOURCES = $$PWD/tst_qeventloop.cpp -win32:!wince:!winrt: LIBS += -luser32 +win32:!winrt: LIBS += -luser32 contains(QT_CONFIG, glib): DEFINES += HAVE_GLIB diff --git a/tests/auto/corelib/kernel/qmetatype/qmetatype.pro b/tests/auto/corelib/kernel/qmetatype/qmetatype.pro index 1d4e647a4b..b5f1d0fe00 100644 --- a/tests/auto/corelib/kernel/qmetatype/qmetatype.pro +++ b/tests/auto/corelib/kernel/qmetatype/qmetatype.pro @@ -6,11 +6,11 @@ SOURCES = tst_qmetatype.cpp TESTDATA=./typeFlags.bin DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 -win32-msvc*|wince|winrt { +win32-msvc*|winrt { # Prevents "fatal error C1128: number of sections exceeded object file format limit". QMAKE_CXXFLAGS += /bigobj # Reduce compile time - win32-msvc2012|wince|winrt { + win32-msvc2012|winrt { QMAKE_CXXFLAGS_RELEASE -= -O2 QMAKE_CFLAGS_RELEASE -= -O2 } diff --git a/tests/auto/corelib/kernel/qobject/signalbug/signalbug.pro b/tests/auto/corelib/kernel/qobject/signalbug/signalbug.pro index 125915047a..cc51b4c661 100644 --- a/tests/auto/corelib/kernel/qobject/signalbug/signalbug.pro +++ b/tests/auto/corelib/kernel/qobject/signalbug/signalbug.pro @@ -2,9 +2,6 @@ CONFIG -= app_bundle debug_and_release CONFIG += console DESTDIR = ./ QT = core -wince { - LIBS += coredll.lib -} HEADERS += signalbug.h SOURCES += signalbug.cpp diff --git a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp index 23f8ff5857..6898fa717e 100644 --- a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp +++ b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp @@ -1572,11 +1572,7 @@ Q_DECLARE_METATYPE(PropertyObject::Priority) void tst_QObject::threadSignalEmissionCrash() { -#if defined(Q_OS_WINCE) - int loopCount = 100; -#else int loopCount = 1000; -#endif for (int i = 0; i < loopCount; ++i) { QTcpSocket socket; socket.connectToHost("localhost", 80); diff --git a/tests/auto/corelib/kernel/qsharedmemory/test/tst_qsharedmemory.cpp b/tests/auto/corelib/kernel/qsharedmemory/test/tst_qsharedmemory.cpp index b6f6d2a7f3..26caff4301 100644 --- a/tests/auto/corelib/kernel/qsharedmemory/test/tst_qsharedmemory.cpp +++ b/tests/auto/corelib/kernel/qsharedmemory/test/tst_qsharedmemory.cpp @@ -90,7 +90,7 @@ private slots: // extreme cases void useTooMuchMemory(); -#if !defined(Q_OS_HPUX) && !defined(Q_OS_WINCE) +#if !defined(Q_OS_HPUX) void attachTooMuch(); #endif @@ -516,8 +516,7 @@ void tst_QSharedMemory::useTooMuchMemory() attach before the system runs out of resources. */ // HPUX doesn't allow for multiple attaches per process. -// For WinCE, this test nearly kills the system, so skip it. -#if !defined(Q_OS_HPUX) && !defined(Q_OS_WINCE) +#if !defined(Q_OS_HPUX) void tst_QSharedMemory::attachTooMuch() { QSKIP("disabled"); @@ -576,9 +575,7 @@ void tst_QSharedMemory::simpleProducerConsumer() char *get = (char*)consumer.data(); // On Windows CE you always have ReadWrite access. Thus // ViewMapOfFile returns the same pointer -#if !defined(Q_OS_WINCE) QVERIFY(put != get); -#endif for (int i = 0; i < size; ++i) { put[i] = 'Q'; QCOMPARE(get[i], 'Q'); diff --git a/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp b/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp index 6fd192c357..de7a3721d8 100644 --- a/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp +++ b/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp @@ -295,9 +295,6 @@ void tst_QTimer::livelock() QTRY_COMPARE(tester.timeoutsForFirst, 1); QCOMPARE(tester.timeoutsForExtra, 0); QTRY_COMPARE(tester.timeoutsForSecond, 1); -#if defined(Q_OS_WINCE) - QEXPECT_FAIL("non-zero timer", "Windows CE devices often too slow", Continue); -#endif QVERIFY(tester.postEventAtRightTime); } diff --git a/tests/auto/corelib/plugin/qlibrary/lib/lib.pro b/tests/auto/corelib/plugin/qlibrary/lib/lib.pro index 44bd0be14e..3e15861021 100644 --- a/tests/auto/corelib/plugin/qlibrary/lib/lib.pro +++ b/tests/auto/corelib/plugin/qlibrary/lib/lib.pro @@ -6,7 +6,6 @@ TARGET = mylib DESTDIR = ../ QT = core -wince: DEFINES += WIN32_MSVC win32-msvc: DEFINES += WIN32_MSVC # This project is testdata for tst_qlibrary diff --git a/tests/auto/corelib/plugin/qlibrary/lib2/lib2.pro b/tests/auto/corelib/plugin/qlibrary/lib2/lib2.pro index d55747501c..bd73227b3d 100644 --- a/tests/auto/corelib/plugin/qlibrary/lib2/lib2.pro +++ b/tests/auto/corelib/plugin/qlibrary/lib2/lib2.pro @@ -7,7 +7,6 @@ DESTDIR = ../ VERSION = 2 QT = core -wince: DEFINES += WIN32_MSVC win32-msvc: DEFINES += WIN32_MSVC # Force a copy of the library to have an extension that is non-standard. diff --git a/tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp b/tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp index ed41ab51e1..dec8448ce3 100644 --- a/tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp +++ b/tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp @@ -189,7 +189,7 @@ void tst_QLibrary::load_data() QTest::newRow("ok (libmylib ver. 1)") << appDir + "/libmylib" < #endif #ifdef Q_OS_WIN -#ifndef Q_OS_WINCE -#include -#endif -#include +# include +# include #endif class tst_QThreadStorage : public QObject @@ -221,11 +219,7 @@ void tst_QThreadStorage::adoptedThreads() pthread_join(thread, 0); #elif defined Q_OS_WIN && !defined(Q_OS_WINRT) HANDLE thread; -#if defined(Q_OS_WINCE) - thread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)testAdoptedThreadStorageWin, &pointers, 0, NULL); -#else thread = (HANDLE)_beginthread(testAdoptedThreadStorageWin, 0, &pointers); -#endif QVERIFY(thread); WaitForSingleObject(thread, INFINITE); #endif diff --git a/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp b/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp index 910d7abf51..586a4446b4 100644 --- a/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp +++ b/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp @@ -34,9 +34,6 @@ #include #include #include -#if defined(Q_OS_WINCE) -#include -#endif class tst_QByteArray : public QObject { @@ -246,11 +243,7 @@ void tst_QByteArray::qCompress_data() { QTest::addColumn("ba"); -#ifndef Q_OS_WINCE const int size1 = 1024*1024; -#else - const int size1 = 1024; -#endif QByteArray ba1( size1, 0 ); QTest::newRow( "00" ) << QByteArray(); @@ -267,11 +260,6 @@ void tst_QByteArray::qCompress_data() ba1.fill( 'A' ); QTest::newRow( "03" ) << ba1; -#if defined(Q_OS_WINCE) - int tmpArgc = 0; - char** tmpArgv = 0; - QCoreApplication app(tmpArgc, tmpArgv); -#endif QFile file( QFINDTESTDATA("rfc3252.txt") ); QVERIFY( file.open(QIODevice::ReadOnly) ); QTest::newRow( "04" ) << file.readAll(); @@ -728,7 +716,7 @@ void tst_QByteArray::qvsnprintf() memset(buf, 42, sizeof(buf)); #ifdef Q_OS_WIN // VS 2005 uses the Qt implementation of vsnprintf. -# if defined(_MSC_VER) && _MSC_VER >= 1400 && !defined(Q_OS_WINCE) +# if defined(_MSC_VER) QCOMPARE(::qsnprintf(buf, 3, "%s", "bubu"), -1); QCOMPARE(static_cast(buf), "bu"); # else diff --git a/tests/auto/corelib/tools/qchar/tst_qchar.cpp b/tests/auto/corelib/tools/qchar/tst_qchar.cpp index e51f5d4694..92585fd471 100644 --- a/tests/auto/corelib/tools/qchar/tst_qchar.cpp +++ b/tests/auto/corelib/tools/qchar/tst_qchar.cpp @@ -31,9 +31,6 @@ #include #include #include -#if defined(Q_OS_WINCE) -#include -#endif class tst_QChar : public QObject { diff --git a/tests/auto/corelib/tools/qcommandlineparser/tst_qcommandlineparser.cpp b/tests/auto/corelib/tools/qcommandlineparser/tst_qcommandlineparser.cpp index fd835daa3a..319b04fa1a 100644 --- a/tests/auto/corelib/tools/qcommandlineparser/tst_qcommandlineparser.cpp +++ b/tests/auto/corelib/tools/qcommandlineparser/tst_qcommandlineparser.cpp @@ -512,9 +512,6 @@ void tst_QCommandLineParser::testVersionOption() #ifdef QT_NO_PROCESS QSKIP("This test requires QProcess support"); #else -#ifdef Q_OS_WINCE - QSKIP("Reading and writing to a process is not supported on Qt/CE"); -#endif #if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_NO_SDK) QSKIP("Deploying executable applications to file system on Android not supported."); #endif @@ -581,9 +578,6 @@ void tst_QCommandLineParser::testHelpOption() #ifdef QT_NO_PROCESS QSKIP("This test requires QProcess support"); #else -#ifdef Q_OS_WINCE - QSKIP("Reading and writing to a process is not supported on Qt/CE"); -#endif #if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_NO_SDK) QSKIP("Deploying executable applications to file system on Android not supported."); #endif diff --git a/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp b/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp index cfec327319..3b791fec70 100644 --- a/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp +++ b/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp @@ -28,10 +28,7 @@ ****************************************************************************/ #include -#ifndef Q_OS_WINCE #include -#endif - #include #include @@ -108,10 +105,8 @@ private slots: void msecsTo(); void operator_eqeq_data(); void operator_eqeq(); -#ifndef Q_OS_WINCE void operator_insert_extract_data(); void operator_insert_extract(); -#endif void currentDateTime(); void currentDateTimeUtc(); void currentDateTimeUtc2(); @@ -259,9 +254,7 @@ void tst_QDateTime::initTestCase() void tst_QDateTime::init() { -#if defined(Q_OS_WINCE) - SetUserDefaultLCID(MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT)); -#elif defined(Q_OS_WIN32) +#if defined(Q_OS_WIN32) SetThreadLocale(MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT)); #endif } @@ -1429,13 +1422,8 @@ void tst_QDateTime::msecsTo() void tst_QDateTime::currentDateTime() { -#if defined(Q_OS_WINCE) - __time64_t buf1, buf2; - ::_time64(&buf1); -#else time_t buf1, buf2; ::time(&buf1); -#endif QDateTime lowerBound; lowerBound.setTime_t(buf1); @@ -1443,11 +1431,8 @@ void tst_QDateTime::currentDateTime() QDateTime dt2 = QDateTime::currentDateTime().toLocalTime(); QDateTime dt3 = QDateTime::currentDateTime().toUTC(); -#if defined(Q_OS_WINCE) - ::_time64(&buf2); -#else ::time(&buf2); -#endif + QDateTime upperBound; upperBound.setTime_t(buf2); // Note we must add 2 seconds here because time() may return up to @@ -1482,13 +1467,9 @@ void tst_QDateTime::currentDateTime() void tst_QDateTime::currentDateTimeUtc() { -#if defined(Q_OS_WINCE) - __time64_t buf1, buf2; - ::_time64(&buf1); -#else time_t buf1, buf2; ::time(&buf1); -#endif + QDateTime lowerBound; lowerBound.setTime_t(buf1); @@ -1496,11 +1477,8 @@ void tst_QDateTime::currentDateTimeUtc() QDateTime dt2 = QDateTime::currentDateTimeUtc().toLocalTime(); QDateTime dt3 = QDateTime::currentDateTimeUtc().toUTC(); -#if defined(Q_OS_WINCE) - ::_time64(&buf2); -#else ::time(&buf2); -#endif + QDateTime upperBound; upperBound.setTime_t(buf2); // Note we must add 2 seconds here because time() may return up to @@ -1859,7 +1837,6 @@ void tst_QDateTime::operator_eqeq() } } -#ifndef Q_OS_WINCE Q_DECLARE_METATYPE(QDataStream::Version) void tst_QDateTime::operator_insert_extract_data() @@ -1988,7 +1965,6 @@ void tst_QDateTime::operator_insert_extract() qputenv("TZ", previousTimeZone.constData()); tzset(); } -#endif void tst_QDateTime::toString_strformat() { diff --git a/tests/auto/corelib/tools/qhash/tst_qhash.cpp b/tests/auto/corelib/tools/qhash/tst_qhash.cpp index 4336d02b2c..1ec0924254 100644 --- a/tests/auto/corelib/tools/qhash/tst_qhash.cpp +++ b/tests/auto/corelib/tools/qhash/tst_qhash.cpp @@ -996,11 +996,7 @@ void tst_QHash::rehash_isnt_quadratic() // this test should be incredibly slow if rehash() is quadratic for (int j = 0; j < 5; ++j) { QHash testHash; -#if defined(Q_OS_WINCE) // mobiles do not have infinite mem... - for (int i = 0; i < 50000; ++i) -#else for (int i = 0; i < 500000; ++i) -#endif testHash.insertMulti(1, 1); } } diff --git a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp index 352d82796d..80f354671a 100644 --- a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp +++ b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp @@ -52,15 +52,6 @@ # include #endif -#ifdef Q_OS_WINCE -#include // needed for GetUserDefaultLCID -#define _control87 _controlfp -extern "C" DWORD GetThreadLocale(void) { - return GetUserDefaultLCID(); -} - -#endif - #if defined(Q_OS_UNIX) && !defined(Q_OS_MAC) # include #endif @@ -85,9 +76,7 @@ private slots: #endif void ctor(); -#if !defined(Q_OS_WINCE) void emptyCtor(); -#endif void legacyNames(); void unixLocaleName(); void matchingLocales(); @@ -394,10 +383,7 @@ void tst_QLocale::ctor() #undef TEST_CTOR } -#if !defined(Q_OS_WINCE) && !defined(QT_NO_PROCESS) -// Not when Q_OS_WINCE is defined because the test uses unsupported -// Windows CE QProcess functionality (std streams, env) -// Also Qt needs to be compiled without QT_NO_PROCESS +#if !defined(QT_NO_PROCESS) static inline bool runSysApp(const QString &binary, const QStringList &env, QString *output, @@ -447,7 +433,6 @@ static inline bool runSysAppTest(const QString &binary, } #endif -#if !defined(Q_OS_WINCE) void tst_QLocale::emptyCtor() { #ifdef QT_NO_PROCESS @@ -517,7 +502,6 @@ void tst_QLocale::emptyCtor() #undef TEST_CTOR #endif } -#endif void tst_QLocale::legacyNames() { diff --git a/tests/auto/corelib/tools/qregexp/tst_qregexp.cpp b/tests/auto/corelib/tools/qregexp/tst_qregexp.cpp index 2f285f3393..a98d37d733 100644 --- a/tests/auto/corelib/tools/qregexp/tst_qregexp.cpp +++ b/tests/auto/corelib/tools/qregexp/tst_qregexp.cpp @@ -927,11 +927,7 @@ void tst_QRegExp::rainersSlowRegExpCopyBug() { // this test should take an extreme amount of time if QRegExp is broken QRegExp original(email); -#if defined(Q_OS_WINCE) - for (int i = 0; i < 100; ++i) { -#else for (int i = 0; i < 100000; ++i) { -#endif QRegExp copy = original; (void)copy.exactMatch("~"); QRegExp copy2 = original; @@ -980,13 +976,9 @@ void Thread::run() str += "abbbdekcz"; int x; -#if defined(Q_OS_WINCE) - for (int j = 0; j < 100; ++j) { -#else - for (int j = 0; j < 10000; ++j) { -#endif + for (int j = 0; j < 10000; ++j) x = rx.indexIn(str); - } + QCOMPARE(x, 3072); } @@ -1022,13 +1014,9 @@ void Thread2::run() str += "abbbdekcz"; int x; -#if defined(Q_OS_WINCE) - for (int j = 0; j < 100; ++j) { -#else - for (int j = 0; j < 10000; ++j) { -#endif + for (int j = 0; j < 10000; ++j) x = rx.indexIn(str); - } + QCOMPARE(x, 3072); } diff --git a/tests/auto/corelib/tools/qsharedpointer/externaltests.cpp b/tests/auto/corelib/tools/qsharedpointer/externaltests.cpp index 0cccdb8262..7bebe5e9e0 100644 --- a/tests/auto/corelib/tools/qsharedpointer/externaltests.cpp +++ b/tests/auto/corelib/tools/qsharedpointer/externaltests.cpp @@ -342,7 +342,7 @@ namespace QTest { "\n" "#ifdef Q_OS_WIN\n" "#include \n" - "#if defined(Q_CC_MSVC) && !defined(Q_OS_WINCE)\n" + "#if defined(Q_CC_MSVC)\n" "#include \n" "#endif\n" "static void q_test_setup()\n" @@ -358,7 +358,7 @@ namespace QTest { "#endif\n" "int main(int argc, char **argv)\n" "{\n" - "#if defined(Q_CC_MSVC) && defined(QT_DEBUG) && defined(_DEBUG) && defined(_CRT_ERROR) && !defined(Q_OS_WINCE)\n" + "#if defined(Q_CC_MSVC) && defined(QT_DEBUG) && defined(_DEBUG) && defined(_CRT_ERROR)\n" " _CrtSetReportHook2(_CRT_RPTHOOK_INSTALL, CrtDbgHook);\n" "#endif\n"; diff --git a/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp b/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp index b5912badf2..cefe1e526d 100644 --- a/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp +++ b/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp @@ -1771,13 +1771,11 @@ void tst_QSharedPointer::threadStressTest_data() QTest::newRow("1+1") << 1 << 1; QTest::newRow("2+10") << 2 << 10; -#ifndef Q_OS_WINCE - // Windows CE cannot run this many threads + QTest::newRow("5+10") << 5 << 10; QTest::newRow("5+30") << 5 << 30; QTest::newRow("100+100") << 100 << 100; -#endif } void tst_QSharedPointer::threadStressTest() @@ -1811,11 +1809,7 @@ void tst_QSharedPointer::threadStressTest() base.clear(); -#ifdef Q_OS_WINCE - srand(QDateTime::currentDateTime().toTime_t()); -#else srand(time(NULL)); -#endif // start threads for (int i = 0; i < allThreads.count(); ++i) if (allThreads[i]) allThreads[i]->start(); diff --git a/tests/auto/corelib/tools/qstring/tst_qstring.cpp b/tests/auto/corelib/tools/qstring/tst_qstring.cpp index 0a81e3f6bb..9dc564a361 100644 --- a/tests/auto/corelib/tools/qstring/tst_qstring.cpp +++ b/tests/auto/corelib/tools/qstring/tst_qstring.cpp @@ -37,10 +37,6 @@ # undef QT_ASCII_CAST_WARNINGS #endif -#if defined(Q_OS_WIN) && defined(Q_OS_WINCE) -#define Q_OS_WIN_AND_WINCE -#endif - #include #include #include @@ -527,7 +523,7 @@ private slots: void integer_conversion(); void tortureSprintfDouble(); void toNum(); -#if !defined(Q_OS_WIN) || defined(Q_OS_WIN_AND_WINCE) +#if !defined(Q_OS_WIN) void localeAwareCompare_data(); void localeAwareCompare(); #endif @@ -1053,10 +1049,6 @@ void tst_QString::acc_01() QVERIFY(a.isNull()); QVERIFY(*a.toLatin1().constData() == '\0'); { -#if defined(Q_OS_WINCE) - int argc = 0; - QCoreApplication app(argc, 0); -#endif QFile f("COMPARE.txt"); f.open(QIODevice::ReadOnly); QTextStream ts( &f ); @@ -5309,15 +5301,11 @@ void tst_QString::tortureSprintfDouble() #include -#if !defined(Q_OS_WIN) || defined(Q_OS_WIN_AND_WINCE) -// On Q_OS_WIN others than Win CE, we cannot set the system or user locale +#if !defined(Q_OS_WIN) +// On Q_OS_WIN, we cannot set the system or user locale void tst_QString::localeAwareCompare_data() { -#ifdef Q_OS_WIN_AND_WINCE - QTest::addColumn("locale"); -#else QTest::addColumn("locale"); -#endif QTest::addColumn("s1"); QTest::addColumn("s2"); QTest::addColumn("result"); @@ -5327,15 +5315,9 @@ void tst_QString::localeAwareCompare_data() Latin-1-specific characters (I think). Compare with Swedish below. */ -#ifdef Q_OS_WIN_AND_WINCE // assume c locale to be english - QTest::newRow("c1") << MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT) << QString::fromLatin1("\xe5") << QString::fromLatin1("\xe4") << 1; - QTest::newRow("c2") << MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT) << QString::fromLatin1("\xe4") << QString::fromLatin1("\xf6") << -1; - QTest::newRow("c3") << MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT) << QString::fromLatin1("\xe5") << QString::fromLatin1("\xf6") << -1; -#else QTest::newRow("c1") << QString("C") << QString::fromLatin1("\xe5") << QString::fromLatin1("\xe4") << 1; QTest::newRow("c2") << QString("C") << QString::fromLatin1("\xe4") << QString::fromLatin1("\xf6") << -1; QTest::newRow("c3") << QString("C") << QString::fromLatin1("\xe5") << QString::fromLatin1("\xf6") << -1; -#endif /* It's hard to test English, because it's treated differently @@ -5345,15 +5327,9 @@ void tst_QString::localeAwareCompare_data() comparison of Latin-1 values, although I'm not sure. So I just test digits to make sure that it's not totally broken. */ -#ifdef Q_OS_WIN_AND_WINCE - QTest::newRow("english1") << MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT) << QString("5") << QString("4") << 1; - QTest::newRow("english2") << MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT) << QString("4") << QString("6") << -1; - QTest::newRow("english3") << MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT) << QString("5") << QString("6") << -1; -#else QTest::newRow("english1") << QString("en_US") << QString("5") << QString("4") << 1; QTest::newRow("english2") << QString("en_US") << QString("4") << QString("6") << -1; QTest::newRow("english3") << QString("en_US") << QString("5") << QString("6") << -1; -#endif /* In Swedish, a with ring above (E5) comes before a with diaresis (E4), which comes before o diaresis (F6), which @@ -5364,11 +5340,6 @@ void tst_QString::localeAwareCompare_data() QTest::newRow("swedish2") << QString("sv_SE.ISO8859-1") << QString::fromLatin1("\xe4") << QString::fromLatin1("\xf6") << -1; QTest::newRow("swedish3") << QString("sv_SE.ISO8859-1") << QString::fromLatin1("\xe5") << QString::fromLatin1("\xf6") << -1; QTest::newRow("swedish4") << QString("sv_SE.ISO8859-1") << QString::fromLatin1("z") << QString::fromLatin1("\xe5") << -1; -#elif defined(Q_OS_WIN_AND_WINCE) - QTest::newRow("swedish1") << MAKELCID(MAKELANGID(LANG_SWEDISH, SUBLANG_SWEDISH), SORT_DEFAULT) << QString::fromLatin1("\xe5") << QString::fromLatin1("\xe4") << -1; - QTest::newRow("swedish2") << MAKELCID(MAKELANGID(LANG_SWEDISH, SUBLANG_SWEDISH), SORT_DEFAULT) << QString::fromLatin1("\xe4") << QString::fromLatin1("\xf6") << -1; - QTest::newRow("swedish3") << MAKELCID(MAKELANGID(LANG_SWEDISH, SUBLANG_SWEDISH), SORT_DEFAULT) << QString::fromLatin1("\xe5") << QString::fromLatin1("\xf6") << -1; - QTest::newRow("swedish4") << MAKELCID(MAKELANGID(LANG_SWEDISH, SUBLANG_SWEDISH), SORT_DEFAULT) << QString::fromLatin1("z") << QString::fromLatin1("\xe5") << -1; #else QTest::newRow("swedish1") << QString("sv_SE") << QString::fromLatin1("\xe5") << QString::fromLatin1("\xe4") << -1; QTest::newRow("swedish2") << QString("sv_SE") << QString::fromLatin1("\xe4") << QString::fromLatin1("\xf6") << -1; @@ -5394,10 +5365,6 @@ void tst_QString::localeAwareCompare_data() QTest::newRow("german1") << QString("de_DE.ISO8859-1") << QString::fromLatin1("z") << QString::fromLatin1("\xe4") << 1; QTest::newRow("german2") << QString("de_DE.ISO8859-1") << QString::fromLatin1("\xe4") << QString::fromLatin1("\xf6") << -1; QTest::newRow("german3") << QString("de_DE.ISO8859-1") << QString::fromLatin1("z") << QString::fromLatin1("\xf6") << 1; -#elif defined(Q_OS_WIN_AND_WINCE) - QTest::newRow("german1") << MAKELCID(MAKELANGID(LANG_GERMAN, SUBLANG_GERMAN), SORT_DEFAULT) << QString::fromLatin1("z") << QString::fromLatin1("\xe4") << 1; - QTest::newRow("german2") << MAKELCID(MAKELANGID(LANG_GERMAN, SUBLANG_GERMAN), SORT_DEFAULT) << QString::fromLatin1("\xe4") << QString::fromLatin1("\xf6") << -1; - QTest::newRow("german3") << MAKELCID(MAKELANGID(LANG_GERMAN, SUBLANG_GERMAN), SORT_DEFAULT) << QString::fromLatin1("z") << QString::fromLatin1("\xf6") << 1; #else QTest::newRow("german1") << QString("de_DE") << QString::fromLatin1("z") << QString::fromLatin1("\xe4") << 1; QTest::newRow("german2") << QString("de_DE") << QString::fromLatin1("\xe4") << QString::fromLatin1("\xf6") << -1; @@ -5407,11 +5374,7 @@ void tst_QString::localeAwareCompare_data() void tst_QString::localeAwareCompare() { -#ifdef Q_OS_WIN_AND_WINCE - QFETCH(ulong, locale); -#else QFETCH(QString, locale); -#endif QFETCH(QString, s1); QFETCH(QString, s2); QFETCH(int, result); @@ -5419,11 +5382,7 @@ void tst_QString::localeAwareCompare() QStringRef r1(&s1, 0, s1.length()); QStringRef r2(&s2, 0, s2.length()); -#ifdef Q_OS_WIN_AND_WINCE - DWORD oldLcid = GetUserDefaultLCID(); - SetUserDefaultLCID(locale); - QCOMPARE(locale, GetUserDefaultLCID()); -#elif defined (Q_OS_MAC) || defined(QT_USE_ICU) +#if defined (Q_OS_DARWIN) || defined(QT_USE_ICU) QSKIP("Setting the locale is not supported on OS X or ICU (you can set the C locale, but that won't affect localeAwareCompare)"); #else if (!locale.isEmpty()) { @@ -5485,14 +5444,10 @@ void tst_QString::localeAwareCompare() QVERIFY(testres == 0); } -#ifdef Q_OS_WIN_AND_WINCE - SetUserDefaultLCID(oldLcid); -#else if (!locale.isEmpty()) setlocale(LC_ALL, ""); -#endif } -#endif //!defined(Q_OS_WIN) || defined(Q_OS_WIN_AND_WINCE) +#endif //!defined(Q_OS_WIN) void tst_QString::reverseIterators() { diff --git a/tests/auto/corelib/tools/qstringlist/tst_qstringlist.cpp b/tests/auto/corelib/tools/qstringlist/tst_qstringlist.cpp index dc3547f9ba..0fdafd9b01 100644 --- a/tests/auto/corelib/tools/qstringlist/tst_qstringlist.cpp +++ b/tests/auto/corelib/tools/qstringlist/tst_qstringlist.cpp @@ -32,9 +32,6 @@ #include #include -#ifdef Q_OS_WINCE -#include // needed for GetUserDefaultLCID -#endif class tst_QStringList : public QObject { @@ -205,13 +202,7 @@ void tst_QStringList::sort() list2 << "BETA" << "Gamma" << "alpha" << "beta" << "epsilon" << "gAmma" << "gamma"; QCOMPARE( list1, list2 ); -#ifdef Q_OS_WINCE - DWORD oldLcid = GetUserDefaultLCID(); - // Assume c locale to be english - SetUserDefaultLCID(MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT)); -#else char *current_locale = setlocale(LC_ALL, "C"); -#endif QStringList list3, list4; list3 << "alpha" << "beta" << "BETA" << "gamma" << "Gamma" << "gAmma" << "epsilon"; list3.sort(Qt::CaseInsensitive); @@ -224,11 +215,7 @@ void tst_QStringList::sort() QCOMPARE(list4.at(0), QString("alpha")); QVERIFY(list4.indexOf("epsilon") > 0); QVERIFY(list4.indexOf("epsilon") < (list4.count() - 1)); -#ifdef Q_OS_WINCE - SetUserDefaultLCID(oldLcid); -#else setlocale(LC_ALL, current_locale); -#endif } void tst_QStringList::replaceInStrings() diff --git a/tests/auto/corelib/tools/qtimeline/tst_qtimeline.cpp b/tests/auto/corelib/tools/qtimeline/tst_qtimeline.cpp index 83838570be..cd2cdab11b 100644 --- a/tests/auto/corelib/tools/qtimeline/tst_qtimeline.cpp +++ b/tests/auto/corelib/tools/qtimeline/tst_qtimeline.cpp @@ -68,11 +68,7 @@ protected: void tst_QTimeLine::range() { -#ifdef Q_OS_WINCE //On WinCE timer resolution is bad - using longer times instead - QTimeLine timeLine(2000); -#else QTimeLine timeLine(200); -#endif QCOMPARE(timeLine.startFrame(), 0); QCOMPARE(timeLine.endFrame(), 0); timeLine.setFrameRange(0, 1); -- cgit v1.2.3