void tst_QParallelAnimationGroup::initTestCase()
{
qRegisterMetaType<QAbstractAnimation::State>("QAbstractAnimation::State");
-#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAC) || defined(Q_WS_WINCE)
- // give the Symbian and mac app start event queue time to clear
+#if defined(Q_WS_MAC) || defined(Q_WS_WINCE)
+ // give the mac/wince app start event queue time to clear
QTest::qWait(1000);
#endif
}
TEMPLATE = subdirs
SUBDIRS = test
-!wince*:!symbian:SUBDIRS += echo
+!wince*:SUBDIRS += echo
TARGET = tst_qtextcodec
}
-wince*|symbian {
+wince* {
addFiles.files = ../*.txt
addFiles.path = .
DEPLOYMENT += addFiles
wince*: {
DEFINES += SRCDIR=\\\"\\\"
-}else:symbian {
- # Symbian can't define SRCDIR meaningfully here
- LIBS += -lcharconv -lconvnames -lgb2312_shared -ljisx0201 -ljisx0208 -lefsrv
} else {
DEFINES += SRCDIR=\\\"$$PWD/../\\\"
}
#include <QtConcurrentMap>
#include <QThreadPool>
-#ifdef Q_OS_SYMBIAN
-#define SRCDIR ""
-#endif
-
-
class tst_QTextCodec : public QObject
{
Q_OBJECT
QTest::newRow("data16") << "ISO-8859-16" << true;
QTest::newRow("data18") << "IBM850" << true;
-#ifndef Q_OS_SYMBIAN //symbian implementation will return empty string if all char are invalid
QTest::newRow("data19") << "IBM874" << true;
-#endif
QTest::newRow("data20") << "IBM866" << true;
QTest::newRow("data21") << "windows-1250" << true;
QTest::newRow("data23") << "windows-1252" << true;
QTest::newRow("data24") << "windows-1253" << true;
QTest::newRow("data25") << "windows-1254" << true;
-#ifndef Q_OS_SYMBIAN //symbian implementation will return empty string if all char are invalid
QTest::newRow("data26") << "windows-1255" << true;
-#endif
QTest::newRow("data27") << "windows-1256" << true;
QTest::newRow("data28") << "windows-1257" << true;
QTest::newRow("data28") << "windows-1258" << true;
{
#ifdef QT_NO_PROCESS
QSKIP("This test requires QProcess", SkipAll);
-#elif defined(Q_OS_SYMBIAN)
- QSKIP("This test requires streams support in QProcess", SkipAll);
#else
QProcess process;
process.start("echo/echo");
QTest::newRow("turkish") << QByteArray("ISO-8859-9")
<< QByteArray("\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF");
-#ifdef Q_OS_SYMBIAN
- QTest::newRow("thai") << QByteArray("TIS-620")
- << QByteArray("\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB");
-#endif
-
QTest::newRow("latin1") << QByteArray("ISO-8859-1")
<< QByteArray("\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF");
sms7bit_ba.append(i);
}
}
-#ifdef Q_OS_SYMBIAN
- QTest::newRow("sms7bit") << QByteArray("SMS 7-bit") << sms7bit_ba;
-#endif
QTest::newRow("latin2") << QByteArray("ISO-8859-2")
<< QByteArray("\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF");
QTest::newRow("greek 2") << QByteArray("ISO-8859-7")
<< QByteArray("\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA6\xA7\xA8\xA9\xAB\xAC\xAD\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE");
-#ifdef Q_OS_SYMBIAN
- QTest::newRow("hebriew") << QByteArray("ISO-8859-8")
- << QByteArray("\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFD\xFE");
-#endif
-
QTest::newRow("latin5") << QByteArray("ISO-8859-9")
<< QByteArray("\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF");
qtconcurrentthreadengine \
qthreadpool
-symbian:SUBDIRS -= \
- qtconcurrentfilter \
- qtconcurrentiteratekernel \
- qtconcurrentmap \
- qtconcurrentrun \
- qtconcurrentthreadengine \
addFiles.path = .
DEPLOYMENT += addFiles
DEFINES += SRCDIR=\\\"\\\"
-} else:symbian {
- # SRCDIR defined in code in symbian
- addFiles.files = datastream.q42
- addFiles.path = .
- DEPLOYMENT += addFiles
- TARGET.EPOCHEAPSIZE = 1000000 10000000
- TARGET.UID3 = 0xE0340001
- DEFINES += SYMBIAN_SRCDIR_UID=$$lower($$replace(TARGET.UID3,"0x",""))
-}else {
+} else {
DEFINES += SRCDIR=\\\"$$PWD/\\\"
}
#include <QtTest/QtTest>
#include <QtGui/QtGui>
-#if defined(Q_OS_SYMBIAN)
-# define STRINGIFY(x) #x
-# define TOSTRING(x) STRINGIFY(x)
-# define SRCDIR "C:/Private/" TOSTRING(SYMBIAN_SRCDIR_UID) "/"
-#endif
-
Q_DECLARE_METATYPE(QBitArray)
Q_DECLARE_METATYPE(qint64)
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_SYMBIAN) || (!defined(Q_OS_UNIX) && !defined(Q_OS_WINCE)) // all our Unix platforms use X regions.
+#if (!defined(Q_OS_UNIX) && !defined(Q_OS_WINCE)) // 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);
QTest::addColumn<int>("expectedStatus");
QTest::addColumn<QByteArray>("expectedString");
-#if !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN)
+#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));
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) && !defined(Q_OS_SYMBIAN)
+#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("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) && !defined(Q_OS_SYMBIAN)
+#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::addColumn<int>("expectedStatus");
QTest::addColumn<QString>("expectedString");
-#if !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN)
+#if !defined(Q_OS_WINCE)
QString oneMbMinus1;
oneMbMinus1.resize(1024 * 1024 - 1);
for (int i = 0; i < oneMbMinus1.size(); ++i)
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) && !defined(Q_OS_SYMBIAN)
+#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("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) && !defined(Q_OS_SYMBIAN)
+#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();
RESOURCES += qdir.qrc
QT = core
-wince*|symbian {
+wince* {
DirFiles.files = testdir testData searchdir resources entrylist types tst_qdir.cpp
DirFiles.path = .
DEPLOYMENT += DirFiles
wince* {
DEFINES += SRCDIR=\\\"\\\"
-} else:symbian {
- TARGET.CAPABILITY += AllFiles
- TARGET.UID3 = 0xE0340002
- DEFINES += SYMBIAN_SRCDIR_UID=$$lower($$replace(TARGET.UID3,"0x",""))
- LIBS += -lefsrv
- INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE
} else {
DEFINES += SRCDIR=\\\"$$PWD/\\\"
}
#include "../../../../shared/filesystem.h"
-#if defined(Q_OS_SYMBIAN)
-# include <f32file.h>
-# define STRINGIFY(x) #x
-# define TOSTRING(x) STRINGIFY(x)
-# define SRCDIR "C:/Private/" TOSTRING(SYMBIAN_SRCDIR_UID) "/"
-#elif defined(Q_OS_UNIX)
+#if defined(Q_OS_UNIX)
# include <unistd.h>
# include <sys/stat.h>
#endif
#define Q_NO_SYMLINKS
#endif
-#if defined(Q_OS_SYMBIAN)
-#define Q_NO_SYMLINKS
-#define Q_NO_SYMLINKS_TO_DIRS
-#endif
-
-
//TESTED_CLASS=
//TESTED_FILES=
tst_QDir::tst_QDir()
{
-#ifdef Q_OS_SYMBIAN
- // Can't deploy empty test dir, so create it here
- QDir dir(SRCDIR);
- dir.mkdir("testData");
-#endif
}
tst_QDir::~tst_QDir()
{
-#ifdef Q_OS_SYMBIAN
- // Remove created test dir
- QDir dir(SRCDIR);
- dir.rmdir("testData");
-#endif
}
void tst_QDir::construction()
QTest::addColumn<QString>("dir2");
QTest::newRow("data0") << QString(".") << QString("..");
-#if (defined(Q_WS_WIN) && !defined(Q_OS_WINCE)) || defined(Q_OS_SYMBIAN)
+#if (defined(Q_WS_WIN) && !defined(Q_OS_WINCE))
QTest::newRow("data1") << QString("c:/") << QDir::currentPath();
#endif
}
QTest::newRow("unc 8") << "//" + QtNetworkSettings::winServerName() + "/asharethatshouldnotexist" << false;
QTest::newRow("unc 9") << "//ahostthatshouldnotexist" << false;
#endif
-#if (defined(Q_OS_WIN) && !defined(Q_OS_WINCE)) || defined(Q_OS_SYMBIAN)
+#if (defined(Q_OS_WIN) && !defined(Q_OS_WINCE))
QTest::newRow("This drive should exist") << "C:/" << true;
// find a non-existing drive and check if it does not exist
QFileInfoList drives = QFSFileEngine::drives();
QTest::addColumn<bool>("relative");
QTest::newRow("data0") << "../somedir" << true;
-#if (defined(Q_WS_WIN) && !defined(Q_OS_WINCE)) || defined(Q_OS_SYMBIAN)
+#if (defined(Q_WS_WIN) && !defined(Q_OS_WINCE))
QTest::newRow("data1") << "C:/sOmedir" << false;
#endif
QTest::newRow("data2") << "somedir" << true;
QFile::remove(SRCDIR "entrylist/brokenlink.lnk");
QFile::remove(SRCDIR "entrylist/brokenlink");
- // WinCE/Symbian does not have . and .. in the directory listing
-#if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
+ // WinCE does not have . and .. in the directory listing
+#if defined(Q_OS_WINCE)
expected.removeAll(".");
expected.removeAll("..");
#endif
QFile::link(SRCDIR "entryList/file", SRCDIR "entrylist/linktofile.lnk");
QFile::link(SRCDIR "entryList/directory", SRCDIR "entrylist/linktodirectory.lnk");
QFile::link(SRCDIR "entryList/nothing", SRCDIR "entrylist/brokenlink.lnk");
-#elif defined(Q_OS_SYMBIAN)
- // Symbian doesn't support links to directories
- expected.removeAll("linktodirectory.lnk");
-
- // Expecting failures from a couple of OpenC bugs. Do checks only once.
- static int xFailChecked = false;
- static int expectedFail1 = false;
- static int expectedFail2 = false;
-
- if (!expectedFail1) {
- // Can't create link if file doesn't exist in symbian, so create file temporarily,
- // But only if testing for
- QFile tempFile(SRCDIR "entryList/nothing");
- tempFile.open(QIODevice::WriteOnly);
- tempFile.link(SRCDIR "entryList/brokenlink.lnk");
- tempFile.remove();
- }
-
- if (!expectedFail2) {
- QFile::link(SRCDIR "entryList/file", SRCDIR "entrylist/linktofile.lnk");
- }
-
- if (!xFailChecked) {
- // ### Until OpenC supports stat correctly for symbolic links, expect them to fail.
- expectedFail1 = QFileInfo(SRCDIR "entryList/brokenlink.lnk").exists();
- expectedFail2 = !(QFileInfo(SRCDIR "entryList/linktofile.lnk").isFile());
-
- QEXPECT_FAIL("", "OpenC bug, stat for broken links returns normally, when it should return error.", Continue);
- QVERIFY(!expectedFail1);
-
- QEXPECT_FAIL("", "OpenC bug, stat for file links doesn't indicate them as such.", Continue);
- QVERIFY(!expectedFail2);
- xFailChecked = true;
- }
-
- if (expectedFail1) {
- expected.removeAll("brokenlink.lnk");
- QFile::remove(SRCDIR "entrylist/brokenlink.lnk");
- }
-
- if (expectedFail2) {
- expected.removeAll("linktofile.lnk");
- QFile::remove(SRCDIR "entrylist/linktofile.lnk");
- }
#else
QFile::link("file", SRCDIR "entrylist/linktofile.lnk");
QFile::link("directory", SRCDIR "entrylist/linktodirectory.lnk");
return;
}
bool doContentCheck = true;
-#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN)
+#if defined(Q_OS_UNIX)
if (qstrcmp(QTest::currentDataTag(), "QDir::AllEntries | QDir::Writable") == 0) {
// for root, everything is writeable
if (::getuid() == 0)
QCOMPARE(actual.count(), expected.count());
}
-#if defined(Q_OS_SYMBIAN)
- // Test cleanup on device requires setting the permissions back to normal
- QFile(SRCDIR "entrylist/file").setPermissions(QFile::WriteUser | QFile::ReadUser);
-#endif
-
QFile::remove(SRCDIR "entrylist/writable");
QFile::remove(SRCDIR "entrylist/linktofile");
QFile::remove(SRCDIR "entrylist/linktodirectory");
QTest::addColumn<int>("countMin");
QTest::newRow("data2") << "do_not_expect_this_path_to_exist/" << 0;
-#if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
+#if defined(Q_OS_WINCE)
QTest::newRow("simple dir") << SRCDIR "resources" << 0;
QTest::newRow("simple dir with slash") << SRCDIR "resources/" << 0;
#else
# ifndef Q_NO_SYMLINKS_TO_DIRS
QVERIFY(entryList.contains("myLinkToDir.lnk"));
#endif
-#if defined(Q_OS_SYMBIAN)
- QEXPECT_FAIL("", "OpenC stat for symlinks is buggy.", Continue);
-#endif
QVERIFY(!entryList.contains("myLinkToFile.lnk"));
}
{
QTest::newRow("rootPath + ./") << QDir::rootPath().append("./") << QDir::rootPath();
QTest::newRow("rootPath + ../.. ") << QDir::rootPath().append("../..") << QDir::rootPath();
-#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
+#if defined(Q_OS_WIN)
QTest::newRow("drive:\\") << QDir::toNativeSeparators(QDir::rootPath()) << QDir::rootPath();
QTest::newRow("drive:\\.\\") << QDir::toNativeSeparators(QDir::rootPath().append("./")) << QDir::rootPath();
QTest::newRow("drive:\\..\\..") << QDir::toNativeSeparators(QDir::rootPath().append("../..")) << QDir::rootPath();
QFETCH(QString, canonicalPath);
QDir dir(path);
-#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
+#if defined(Q_OS_WIN)
QCOMPARE(dir.canonicalPath().toLower(), canonicalPath.toLower());
#else
QCOMPARE(dir.canonicalPath(), canonicalPath);
if (!currentDir.isEmpty()) {
QDir newCurrent = QDir::current();
QDir::setCurrent(oldDir);
-#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
+#if defined(Q_OS_WIN)
QCOMPARE(newCurrent.absolutePath().toLower(), currentDir.toLower());
#else
QCOMPARE(newCurrent.absolutePath(), currentDir);
int index = appPath.lastIndexOf("/");
QTest::newRow("cdUp") << QDir::currentPath() << ".." << true << appPath.left(index==0?1:index);
QTest::newRow("noChange") << QDir::currentPath() << "." << true << appPath;
-#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN) // on windows QDir::root() is usually c:/ but cd "/" will not force it to be root
+#if defined(Q_OS_WIN) // on windows QDir::root() is usually c:/ but cd "/" will not force it to be root
QTest::newRow("absolute") << QDir::currentPath() << "/" << true << "/";
#else
QTest::newRow("absolute") << QDir::currentPath() << "/" << true << QDir::root().absolutePath();
QTest::newRow("data3") << QDir::cleanPath("../.") << "..";
QTest::newRow("data4") << QDir::cleanPath("../..") << "../..";
#if !defined(Q_OS_WINCE)
-#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
+#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::addColumn<QString>("expectedPath");
QTest::newRow("0") << "/machine/share/dir1" << "/machine/share/dir1";
-#if (defined(Q_OS_WIN) && !defined(Q_OS_WINCE)) || defined(Q_OS_SYMBIAN)
+#if (defined(Q_OS_WIN) && !defined(Q_OS_WINCE))
QTest::newRow("1") << "\\machine\\share\\dir1" << "/machine/share/dir1";
-# if !defined(Q_OS_SYMBIAN)
QTest::newRow("2") << "//machine/share/dir1" << "//machine/share/dir1";
QTest::newRow("3") << "\\\\machine\\share\\dir1" << "//machine/share/dir1";
-# endif
QTest::newRow("4") << "c:/machine/share/dir1" << "c:/machine/share/dir1";
QTest::newRow("5") << "c:\\machine\\share\\dir1" << "c:/machine/share/dir1";
#endif
QTest::newRow("11") << "" << "" << "";
-#if (defined(Q_OS_WIN) && !defined(Q_OS_WINCE)) || defined(Q_OS_SYMBIAN)
+#if (defined(Q_OS_WIN) && !defined(Q_OS_WINCE))
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";
QTest::newRow("27") << "C:" << "D:/" << "D:/";
QTest::newRow("28") << "C:/" << "D:" << "D:";
QTest::newRow("29") << "C:/" << "D:/" << "D:/";
-# if !defined(Q_OS_SYMBIAN)
QTest::newRow("30") << "C:/foo/bar" << "//anotherHost/foo/bar" << "//anotherHost/foo/bar";
QTest::newRow("31") << "//anotherHost/foo" << "//anotherHost/foo/bar" << "bar";
QTest::newRow("32") << "//anotherHost/foo" << "bar" << "bar";
QTest::newRow("33") << "//anotherHost/foo" << "C:/foo/bar" << "C:/foo/bar";
-# endif
#endif
QTest::newRow("resource0") << ":/prefix" << "foo.bar" << "foo.bar";
QVERIFY(dir.rename("rename-test-renamed", "rename-test"));
#if defined(Q_OS_MAC)
QVERIFY(!dir.rename("rename-test", "/etc/rename-test-renamed"));
-#elif defined(Q_OS_SYMBIAN)
- QVERIFY(!dir.rename("rename-test", "/resource/rename-test-renamed"));
#elif !defined(Q_OS_WIN)
// on windows this is possible - maybe make the test a bit better
QVERIFY(!dir.rename("rename-test", "/rename-test-renamed"));
QTest::newRow("slash0") << "c:/winnt/system32" << "system32";
QTest::newRow("slash1") << "/winnt/system32" << "system32";
QTest::newRow("slash2") << "c:/winnt/system32/kernel32.dll" << "kernel32.dll";
-#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
+#if defined(Q_OS_WIN)
QTest::newRow("bslash0") << "c:\\winnt\\system32" << "system32";
QTest::newRow("bslash1") << "\\winnt\\system32" << "system32";
QTest::newRow("bslash2") << "c:\\winnt\\system32\\kernel32.dll" << "kernel32.dll";
void tst_QDir::dotAndDotDot()
{
-#if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
- QSKIP("WinCE and Symbian do not have . nor ..", SkipAll);
+#if defined(Q_OS_WINCE)
+ QSKIP("WinCE does not have . nor ..", SkipAll);
#else
QDir dir(QString(SRCDIR "testdir/"));
QStringList entryList = dir.entryList(QDir::Dirs);
QCOMPARE(path, dir.absolutePath());
QVERIFY(QDir::isAbsolutePath(path));
-#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN)
+#if defined(Q_OS_UNIX)
QCOMPARE(path, QString("/"));
#endif
}
void tst_QDir::nativeSeparators()
{
-#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
+#if defined(Q_OS_WIN)
QCOMPARE(QDir::toNativeSeparators(QLatin1String("/")), QString("\\"));
QCOMPARE(QDir::toNativeSeparators(QLatin1String("\\")), QString("\\"));
QCOMPARE(QDir::fromNativeSeparators(QLatin1String("/")), QString("/"));
QDir dir("update-file-lists");
-#if defined(Q_OS_SYMBIAN) || defined(Q_OS_WINCE)
+#if defined(Q_OS_WINCE)
//no . and .. on these OS.
QCOMPARE(dir.count(), uint(4));
QCOMPARE(dir.entryList().size(), 4);
#endif
QTest::newRow(QString("canonicalPath " + test).toLatin1()) << test << true;
-#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
+#if defined(Q_OS_WIN)
test = QDir::rootPath().left(2);
QTest::newRow(QString("drive relative " + test).toLatin1()) << test << false;
#endif
#if defined(Q_OS_WIN)
QVERIFY(list.count() >= 1); //system
QLatin1Char systemdrive('c');
-#elif defined(Q_OS_SYMBIAN)
- QVERIFY(list.count() >= 2); //system, rom
- QLatin1Char romdrive('z');
- QLatin1Char systemdrive('a' + int(RFs::GetSystemDrive()));
#endif
-#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
+#if defined(Q_OS_WIN)
QVERIFY(list.count() <= 26);
bool foundsystem = false;
-#ifdef Q_OS_SYMBIAN
- bool foundrom = false;
-#endif
foreach (QFileInfo fi, list) {
QCOMPARE(fi.absolutePath().size(), 3); //"x:/"
QCOMPARE(fi.absolutePath().at(1), QChar(QLatin1Char(':')));
QCOMPARE(fi.absolutePath().at(2), QChar(QLatin1Char('/')));
if (fi.absolutePath().at(0).toLower() == systemdrive)
foundsystem = true;
-#ifdef Q_OS_SYMBIAN
- if (fi.absolutePath().at(0).toLower() == romdrive)
- foundrom = true;
-#endif
}
QCOMPARE(foundsystem, true);
-#ifdef Q_OS_SYMBIAN
- QCOMPARE(foundrom, true);
-#endif
#else
QCOMPARE(list.count(), 1); //root
QCOMPARE(list.at(0).absolutePath(), QLatin1String("/"));
QDir dir;
QVERIFY(dir.isReadable());
-#if defined (Q_OS_UNIX) && !defined (Q_OS_SYMBIAN)
+#if defined (Q_OS_UNIX)
QVERIFY(dir.mkdir("nonreadabledir"));
QVERIFY(0 == ::chmod("nonreadabledir", 0));
QVERIFY(!QDir("nonreadabledir").isReadable());
#define Q_NO_SYMLINKS
#endif
-#if defined(Q_OS_SYMBIAN)
-#define Q_NO_SYMLINKS
-#define Q_NO_SYMLINKS_TO_DIRS
-#endif
-
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
# include "../../../network-settings.h"
#endif
createDirectory("empty");
#ifndef Q_NO_SYMLINKS
-# if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
+# if defined(Q_OS_WIN)
// ### Sadly, this is a platform difference right now.
createLink("entrylist/file", "entrylist/linktofile.lnk");
# ifndef Q_NO_SYMLINKS_TO_DIRS
<< QString("entrylist") << QDirIterator::IteratorFlags(0)
<< QDir::Filters(QDir::NoFilter) << QStringList("*")
<< QString(
-#if !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN)
+#if !defined(Q_OS_WINCE)
"entrylist/.,"
"entrylist/..,"
#endif
<< QString("entrylist") << QDirIterator::IteratorFlags(0)
<< QDir::Filters(QDir::AllEntries | QDir::NoDot) << QStringList("*")
<< QString(
-#if !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN)
+#if !defined(Q_OS_WINCE)
"entrylist/..,"
#endif
"entrylist/file,"
<< QString("entrylist") << QDirIterator::IteratorFlags(0)
<< QDir::Filters(QDir::AllEntries | QDir::NoDotDot) << QStringList("*")
<< QString(
-#if !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN)
+#if !defined(Q_OS_WINCE)
"entrylist/.,"
#endif
"entrylist/file,"
<< QString("entrylist") << QDirIterator::IteratorFlags(QDirIterator::Subdirectories | QDirIterator::FollowSymlinks)
<< QDir::Filters(QDir::NoFilter) << QStringList("*")
<< QString(
-#if !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN)
+#if !defined(Q_OS_WINCE)
"entrylist/.,"
"entrylist/..,"
"entrylist/directory/.,"
QTest::newRow("empty, default")
<< QString("empty") << QDirIterator::IteratorFlags(0)
<< QDir::Filters(QDir::NoFilter) << QStringList("*")
-#if defined(Q_OS_SYMBIAN) || defined(Q_OS_WINCE)
+#if defined(Q_OS_WINCE)
<< QStringList();
#else
<< QString("empty/.,empty/..").split(',');
TEMPLATE = subdirs
-wince*|symbian:{
+wince* {
SUBDIRS = test
} else {
SUBDIRS = test stdinprocess
}
-!symbian:SUBDIRS += largefile
+SUBDIRS += largefile
CONFIG += parallel_test
load(qttest_p4)
SOURCES += ../tst_qfile.cpp
-wince*|symbian {
+wince* {
QT = core gui
files.files += ..\\dosfile.txt ..\\noendofline.txt ..\\testfile.txt \
..\\testlog.txt ..\\two.dots.file ..\\tst_qfile.cpp \
wince* {
SOURCES += $$QT_SOURCE_TREE/src/corelib/kernel/qfunctions_wince.cpp # needed for QT_OPEN
DEFINES += SRCDIR=\\\"\\\"
-} else:symbian {
- # do not define SRCDIR at all
- TARGET.EPOCHEAPSIZE = 0x100000 0x3000000
} else {
QT = core network
DEFINES += SRCDIR=\\\"$$PWD/../\\\"
LIBS+=-lole32 -luuid
}
-symbian {
- LIBS+=-lefsrv
-}
-
mac*:CONFIG+=insignificant_test
#include <QDir>
#include <QFile>
#include <QFileInfo>
-#if !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN)
+#if !defined(Q_OS_WINCE)
#include <QHostInfo>
#endif
#include <QProcess>
#elif defined(Q_OS_WINCE)
# include <qplatformdefs.h>
# include <private/qfsfileengine_p.h>
-#elif defined(Q_OS_SYMBIAN)
-# include <f32file.h>
#endif
#include <stdio.h>
#include <errno.h>
#include "../../../network-settings.h"
-#if defined(Q_OS_SYMBIAN)
-# define SRCDIR ""
-#endif
-
#ifndef STDIN_FILENO
#define STDIN_FILENO 0
#endif
void resize();
void objectConstructors();
-#ifdef Q_OS_SYMBIAN
- void platformSecurity_data();
- void platformSecurity();
-#endif
+
void caseSensitivity();
void autocloseHandle();
OpenQFile,
OpenFd,
OpenStream,
-#ifdef Q_OS_SYMBIAN
- OpenRFile,
-#endif
NumberOfFileTypes
};
return stream_ && file.open(stream_, mode, handleFlags);
}
-#ifdef Q_OS_SYMBIAN
- bool openRFile(QFile &file, QIODevice::OpenMode mode, QFile::FileHandleFlags handleFlags)
- {
- //connect file server first time
- if (!rfs_.Handle() && rfs_.Connect() != KErrNone)
- return false;
- //symbian does not like ./ in filenames, so open by absolute path
- QString fileName(QDir::toNativeSeparators(QFileInfo(file).absoluteFilePath()));
- TPtrC fn(fileName.utf16(), fileName.length());
- TInt smode = 0;
- if (mode & QIODevice::WriteOnly)
- smode |= EFileWrite;
- if (mode & QIODevice::ReadOnly)
- smode |= EFileRead;
- TInt r;
- if ((mode & QIODevice::Truncate) || (!(mode & QIODevice::ReadOnly) && !(mode & QIODevice::Append))) {
- r = rfile_.Replace(rfs_, fn, smode);
- } else {
- r = rfile_.Open(rfs_, fn, smode);
- if (r == KErrNotFound && (mode & QIODevice::WriteOnly)) {
- r = rfile_.Create(rfs_, fn, smode);
- }
- }
- return (r == KErrNone) && file.open(rfile_, mode, handleFlags);
- }
-#endif
-
bool openFile(QFile &file, QIODevice::OpenMode mode, FileType type = OpenQFile, QFile::FileHandleFlags handleFlags = QFile::DontCloseHandle)
{
if (mode & QIODevice::WriteOnly && !file.exists())
case OpenStream:
return openStream(file, mode, handleFlags);
-#ifdef Q_OS_SYMBIAN
- case OpenRFile:
- return openRFile(file, mode, handleFlags);
-#endif
+
case NumberOfFileTypes:
break;
}
QT_CLOSE(fd_);
if (stream_)
::fclose(stream_);
-#ifdef Q_OS_SYMBIAN
- if (rfile_.SubSessionHandle())
- rfile_.Close();
-#endif
fd_ = -1;
stream_ = 0;
int fd_;
FILE *stream_;
-#ifdef Q_OS_SYMBIAN
- RFs rfs_;
- RFile rfile_;
-#endif
};
tst_QFile::tst_QFile()
QFETCH( bool, ok );
-#if defined(Q_OS_SYMBIAN)
- if (qstrcmp(QTest::currentDataTag(), "noreadfile") == 0)
- QSKIP("Symbian does not support non-readable files", SkipSingle);
-#elif defined(Q_OS_UNIX)
+#if defined(Q_OS_UNIX)
if (::getuid() == 0)
// root and Chuck Norris don't care for file permissions. Skip.
QSKIP("Running this test as root doesn't make sense", SkipAll);
void tst_QFile::readAllStdin()
{
-#if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
- QSKIP("Currently no stdin/out supported for Windows CE or Symbian", SkipAll);
+#if defined(Q_OS_WINCE)
+ QSKIP("Currently no stdin/out supported for Windows CE", SkipAll);
#endif
#if defined(QT_NO_PROCESS)
QSKIP("Qt was compiled with QT_NO_PROCESS", SkipAll);
void tst_QFile::readLineStdin()
{
-#if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
- QSKIP("Currently no stdin/out supported for Windows CE or Symbian", SkipAll);
+#if defined(Q_OS_WINCE)
+ QSKIP("Currently no stdin/out supported for Windows CE", SkipAll);
#endif
#if defined(QT_NO_PROCESS)
QSKIP("Qt was compiled with QT_NO_PROCESS", SkipAll);
void tst_QFile::readLineStdin_lineByLine()
{
-#if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
+#if defined(Q_OS_WINCE)
QSKIP("Currently no stdin/out supported for Windows CE", SkipAll);
#endif
#if defined(QT_NO_PROCESS)
void tst_QFile::invalidFile_data()
{
QTest::addColumn<QString>("fileName");
-#if !defined(Q_WS_WIN) && !defined(Q_OS_SYMBIAN)
+#if !defined(Q_WS_WIN)
QTest::newRow( "x11" ) << QString( "qwe//" );
#else
QTest::newRow( "colon1" ) << QString( "fail:invalid" );
void tst_QFile::permissions()
{
-#if defined(Q_OS_SYMBIAN)
- if (qstrcmp(QTest::currentDataTag(), "data0") == 0)
- QSKIP("Symbian does not have execution permissions", SkipSingle);
-#endif
QFETCH(QString, file);
QFETCH(uint, perms);
QFETCH(bool, expected);
QFile::remove("tst_qfile.cpy");
QFile file(SRCDIR "tst_qfile.cpp");
QVERIFY(file.copy("tst_qfile.cpy"));
-#if defined(Q_OS_SYMBIAN)
- bool ok = QFile::setPermissions("tst_qfile.cpy", QFile::WriteUser);
-#else
- bool ok = QFile::setPermissions("tst_qfile.cpy", QFile::WriteOther);
-#endif
+
+ bool ok = QFile::setPermissions("tst_qfile.cpy", QFile::WriteOther);
QVERIFY(ok);
QVERIFY(!file.copy("tst_qfile.cpy"));
QFile::remove("tst_qfile.cpy");
void tst_QFile::link()
{
-#if defined(Q_OS_SYMBIAN)
- QSKIP("Symbian does not support links", SkipAll);
-#endif
QFile::remove("myLink.lnk");
QFileInfo info1(SRCDIR "tst_qfile.cpp");
void tst_QFile::linkToDir()
{
-#if defined(Q_OS_SYMBIAN)
- QSKIP("Symbian does not support linking to directories", SkipAll);
-#endif
QFile::remove("myLinkToDir.lnk");
QDir dir;
dir.mkdir("myDir");
void tst_QFile::absolutePathLinkToRelativePath()
{
-#if defined(Q_OS_SYMBIAN)
- QSKIP("Symbian does not support links", SkipAll);
-#endif
QFile::remove("myDir/test.txt");
QFile::remove("myDir/myLink.lnk");
QDir dir;
#else
QVERIFY(QFile::link("myDir/test.txt", "myDir/myLink.lnk"));
#endif
- QEXPECT_FAIL("", "Symlinking using relative paths is currently different on Windows and Unix/Symbian", Continue);
+ QEXPECT_FAIL("", "Symlinking using relative paths is currently different on Windows and Unix", Continue);
QCOMPARE(QFileInfo(QFile(QFileInfo("myDir/myLink.lnk").absoluteFilePath()).symLinkTarget()).absoluteFilePath(),
QFileInfo("myDir/test.txt").absoluteFilePath());
void tst_QFile::readBrokenLink()
{
-#if defined(Q_OS_SYMBIAN)
- QSKIP("Symbian does not support links", SkipAll);
-#endif
QFile::remove("myLink2.lnk");
QFileInfo info1("file12");
-#if defined(Q_OS_SYMBIAN)
- // In Symbian can't link to nonexisting file directly, so create the file temporarily
- QFile tempFile("file12");
- tempFile.open(QIODevice::WriteOnly);
- tempFile.link("myLink2.lnk");
- tempFile.remove();
-#else
QVERIFY(QFile::link("file12", "myLink2.lnk"));
-#endif
QFileInfo info2("myLink2.lnk");
QVERIFY(info2.isSymLink());
QCOMPARE(info2.symLinkTarget(), info1.absoluteFilePath());
QVERIFY(QFile::remove(info2.absoluteFilePath()));
-
-#if !defined(Q_OS_SYMBIAN)
QVERIFY(QFile::link("ole/..", "myLink2.lnk"));
QCOMPARE(QFileInfo("myLink2.lnk").symLinkTarget(), QDir::currentPath());
-#endif
}
void tst_QFile::readTextFile_data()
void tst_QFile::isSequential()
{
-#if defined (Q_OS_WIN) || defined(Q_OS_SYMBIAN)
+#if defined (Q_OS_WIN)
QSKIP("Unix only test.", SkipAll);
#endif
}
{
QFile file(fileName);
-#if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
+#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
QTest::newRow("localfile-QFile") << "./largeblockfile.txt" << (int)OpenQFile;
QTest::newRow("localfile-Fd") << "./largeblockfile.txt" << (int)OpenFd;
QTest::newRow("localfile-Stream") << "./largeblockfile.txt" << (int)OpenStream;
-#ifdef Q_OS_SYMBIAN
- QTest::newRow("localfile-RFile") << "./largeblockfile.txt" << (int)OpenRFile;
-#endif
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
// Some semi-randomness to avoid collisions.
if (array.isNull())
{
-#if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
- int resizeSize = 1024 * 1024; // WinCE and Symbian do not have much space
+#if defined(Q_OS_WINCE)
+ int resizeSize = 1024 * 1024; // WinCE does not have much space
#else
int resizeSize = 64 * 1024 * 1024;
#endif
QTest::newRow("a -> .") << QString("a") << QString(".") << false;
QTest::newRow("renamefile -> renamefile") << QString("renamefile") << QString("renamefile") << false;
QTest::newRow("renamefile -> noreadfile") << QString("renamefile") << QString("noreadfile") << false;
-#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN)
+#if defined(Q_OS_UNIX)
QTest::newRow("renamefile -> /etc/renamefile") << QString("renamefile") << QString("/etc/renamefile") << false;
#endif
QTest::newRow("renamefile -> renamedfile") << QString("renamefile") << QString("renamedfile") << true;
void tst_QFile::handle()
{
int fd;
-#if !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN)
+#if !defined(Q_OS_WINCE)
QFile file(SRCDIR "tst_qfile.cpp");
QVERIFY(file.open(QIODevice::ReadOnly));
fd = int(file.handle());
void tst_QFile::nativeHandleLeaks()
{
-#ifdef Q_OS_SYMBIAN
- QSKIP("test assumptions invalid for symbian", SkipAll);
-#else
int fd1, fd2;
#ifdef Q_OS_WIN
#ifdef Q_OS_WIN
QCOMPARE( handle2, handle1 );
#endif
-#endif
}
void tst_QFile::readEof_data()
QTest::newRow("buffered") << SRCDIR "testfile.txt" << 0;
QTest::newRow("unbuffered") << SRCDIR "testfile.txt" << int(QIODevice::Unbuffered);
-#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN)
+#if defined(Q_OS_UNIX)
QTest::newRow("sequential,buffered") << "/dev/null" << 0;
QTest::newRow("sequential,unbuffered") << "/dev/null" << int(QIODevice::Unbuffered);
#endif
file.close();
-#if defined(Q_OS_SYMBIAN)
- if (false) // No permissions for user makes no sense in Symbian
-#elif defined(Q_OS_UNIX)
+#if defined(Q_OS_UNIX)
if (::getuid() != 0)
// root always has permissions
#endif
void tst_QFile::openStandardStreamsBufferedStreams()
{
-#if defined (Q_OS_WIN) || defined(Q_OS_SYMBIAN)
+#if defined (Q_OS_WIN)
QSKIP("Unix only test.", SkipAll);
#endif
// Using streams
QTest::newRow("native") << int(OpenQFile);
QTest::newRow("fileno") << int(OpenFd);
QTest::newRow("stream") << int(OpenStream);
-#ifdef Q_OS_SYMBIAN
- QTest::newRow("rfile") << int(OpenRFile);
-#endif
}
void tst_QFile::resize()
QVERIFY(!file2->exists());
}
-#ifdef Q_OS_SYMBIAN
-void tst_QFile::platformSecurity_data()
-{
- QTest::addColumn<QString>("file");
- QTest::addColumn<bool>("readable");
- QTest::addColumn<bool>("writable");
-
- QString selfname = QCoreApplication::applicationFilePath();
- QString ownprivate = QCoreApplication::applicationDirPath();
- QString owndrive = selfname.left(2);
- bool amiprivileged = RProcess().HasCapability(ECapabilityAllFiles);
- QTest::newRow("resource") << owndrive + "/resource/apps/tst_qfile.rsc" << true << amiprivileged;
- QTest::newRow("sys") << selfname << amiprivileged << false;
- QTest::newRow("own private") << ownprivate + "/testfile.txt" << true << true;
- QTest::newRow("other private") << owndrive + "/private/10003a3f/import/apps/tst_qfile_reg.rsc" << amiprivileged << amiprivileged;
-}
-
-void tst_QFile::platformSecurity()
-{
- QFETCH(QString,file);
- QFETCH(bool,readable);
- QFETCH(bool,writable);
-
- {
- QFile f(file);
- QCOMPARE(f.open(QIODevice::ReadOnly), readable);
- }
-
- {
- QFile f(file);
- QCOMPARE(f.open(QIODevice::ReadOnly | QIODevice::Unbuffered), readable);
- }
-
- //append mode used to avoid truncating the files.
- {
- QFile f(file);
- QCOMPARE(f.open(QIODevice::WriteOnly | QIODevice::Append), writable);
- }
-
- {
- QFile f(file);
- QCOMPARE(f.open(QIODevice::WriteOnly | QIODevice::Append | QIODevice::Unbuffered), writable);
- }
-
- {
- QFile f(file);
- QCOMPARE(f.open(QIODevice::ReadWrite), writable);
- }
-
- {
- QFile f(file);
- QCOMPARE(f.open(QIODevice::ReadWrite | QIODevice::Unbuffered), writable);
- }
-}
-#endif
-
void tst_QFile::caseSensitivity()
{
-#if defined(Q_OS_SYMBIAN) || defined(Q_OS_WIN) || defined(Q_OS_MAC)
+#if defined(Q_OS_WIN) || defined(Q_OS_MAC)
const bool caseSensitive = false;
#else
const bool caseSensitive = true;
void tst_QFile::autocloseHandle()
{
-#ifdef Q_OS_SYMBIAN
- // these tests are a bit different, because using a closed file handle results in a panic rather than error
- {
- QFile file("readonlyfile");
- QFile file2("readonlyfile");
- QVERIFY(openFile(file, QIODevice::ReadOnly, OpenRFile, QFile::AutoCloseHandle));
- // file is opened with mandatory lock, so opening again should fail
- QVERIFY(!file2.open(QIODevice::ReadOnly));
-
- file.close();
- // opening again should now succeed (because handle is closed)
- QVERIFY(file2.open(QIODevice::ReadOnly));
- }
-
- {
- QFile file("readonlyfile");
- QFile file2("readonlyfile");
- QVERIFY(openFile(file, QIODevice::ReadOnly, OpenRFile, QFile::DontCloseHandle));
- // file is opened with mandatory lock, so opening again should fail
- QVERIFY(!file2.open(QIODevice::ReadOnly));
-
- file.close();
- // opening again should still fail (because handle is not auto closed)
- QVERIFY(!file2.open(QIODevice::ReadOnly));
-
- rfile_.Close();
- // now it should succeed
- QVERIFY(file2.open(QIODevice::ReadOnly));
- }
-#endif
-
{
QFile file("readonlyfile");
QVERIFY(openFile(file, QIODevice::ReadOnly, OpenFd, QFile::AutoCloseHandle));
RESOURCES += qfileinfo.qrc
-wince*:|symbian: {
+wince* {
deploy.files += qfileinfo.qrc tst_qfileinfo.cpp
res.files = resources\\file1 resources\\file1.ext1 resources\\file1.ext1.ext2
res.path = resources
win32*:LIBS += -ladvapi32 -lnetapi32
-symbian {
- TARGET.CAPABILITY=AllFiles
- LIBS *= -lefsrv
- INCLUDEPATH *= $$MW_LAYER_SYSTEMINCLUDE # Needed for e32svr.h in S^3 envs
- }
-
# support for running test from shadow build directory
wince* {
DEFINES += SRCDIR=\\\"\\\"
-} else:symbian {
- # do not define SRCDIR at all
} else {
DEFINES += SRCDIR=\\\"$$PWD/\\\"
}
#endif
#include <qplatformdefs.h>
#include <qdebug.h>
-#ifdef Q_OS_SYMBIAN
-#include <f32file.h>
-#include <private/qcore_symbian_p.h>
-#endif
#include "../../../network-settings.h"
#include <private/qfileinfo_p.h>
#include "../../../../shared/filesystem.h"
-#if defined(Q_OS_SYMBIAN)
-# define SRCDIR ""
-# define NO_SYMLINKS
-#endif
-
QT_BEGIN_NAMESPACE
extern Q_AUTOTEST_EXPORT bool qIsLikelyToBeNfs(int /* handle */);
QT_END_NAMESPACE
void detachingOperations();
-#if !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN)
+#if !defined(Q_OS_WINCE)
void owner();
#endif
void group();
QFile::remove("dummyfile");
QFile::remove("simplefile.txt");
QFile::remove("longFileNamelongFileNamelongFileNamelongFileNamelongFileNamelongFileNamelongFileNamelongFileNamelongFileNamelongFileNamelongFileNamelongFileNamelongFileNamelongFileNamelongFileNamelongFileNamelongFileNamelongFileNamelongFileNamelongFileName.txt");
-#ifdef Q_OS_SYMBIAN
- QFile::remove("hidden.txt");
- QFile::remove("nothidden.txt");
-#else
QFile::remove("tempfile.txt");
-#endif
-#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN)
+#if defined(Q_OS_UNIX)
QDir().rmdir("./.hidden-directory");
QFile::remove("link_to_tst_qfileinfo");
#endif
QTest::newRow("broken link") << "brokenlink.lnk" << false;
-#if (defined(Q_OS_WIN) && !defined(Q_OS_WINCE)) || defined(Q_OS_SYMBIAN)
+#if (defined(Q_OS_WIN) && !defined(Q_OS_WINCE))
QTest::newRow("drive 1") << "c:" << true;
QTest::newRow("drive 2") << "c:/" << true;
//QTest::newRow("drive 2") << "t:s" << false;
QTest::newRow("simple dir") << SRCDIR "resources" << false;
QTest::newRow("simple dir with slash") << SRCDIR "resources/" << false;
-#if (defined(Q_OS_WIN) && !defined(Q_OS_WINCE)) || defined(Q_OS_SYMBIAN)
+#if (defined(Q_OS_WIN) && !defined(Q_OS_WINCE))
QTest::newRow("drive 1") << "c:" << false;
QTest::newRow("drive 2") << "c:/" << true;
QTest::newRow("drive 3") << "p:/" << false;
QTest::addColumn<QString>("filename");
QString drivePrefix;
-#if (defined(Q_OS_WIN) && !defined(Q_OS_WINCE)) || defined(Q_OS_SYMBIAN)
+#if (defined(Q_OS_WIN) && !defined(Q_OS_WINCE))
drivePrefix = QDir::currentPath().left(2);
QString nonCurrentDrivePrefix =
drivePrefix.left(1).compare("X", Qt::CaseInsensitive) == 0 ? QString("Y:") : QString("X:");
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)) || defined(Q_OS_SYMBIAN)
+#if (defined(Q_OS_WIN) && !defined(Q_OS_WINCE))
QString curr = QDir::currentPath();
curr.remove(0, 2); // Make it a absolute path with no drive specifier: \depot\qt-4.2\tests\auto\qfileinfo
QFETCH(QString, expected);
QFileInfo fi(file);
-#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
+#if defined(Q_OS_WIN)
QVERIFY(QString::compare(fi.absoluteFilePath(), expected, Qt::CaseInsensitive) == 0);
#else
QCOMPARE(fi.absoluteFilePath(), expected);
QFileInfo info("/tmp/../../../../../../../../../../../../../../../../../");
info.canonicalFilePath();
-#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN)
+#if defined(Q_OS_UNIX)
// This used to crash on Mac
QFileInfo dontCrash(QLatin1String("/"));
QCOMPARE(dontCrash.canonicalFilePath(), QLatin1String("/"));
QCOMPARE(info1.canonicalFilePath(), info2.canonicalFilePath());
}
}
-# if !defined(Q_OS_SYMBIAN)
- // Symbian doesn't support links to directories
{
const QString link(QDir::tempPath() + QDir::separator() + "tst_qfileinfo");
QFile::remove(link);
QCOMPARE(info1.canonicalFilePath(), info2.canonicalFilePath());
}
}
-# endif
#endif
#ifdef Q_OS_WIN
QTest::newRow("relativeFile") << "tmp.txt" << "tmp.txt";
QTest::newRow("relativeFileInSubDir") << "temp/tmp.txt" << "tmp.txt";
-#if (defined(Q_OS_WIN) && !defined(Q_OS_WINCE)) || defined(Q_OS_SYMBIAN)
+#if (defined(Q_OS_WIN) && !defined(Q_OS_WINCE))
QTest::newRow("absFilePath") << "c:\\home\\andy\\tmp.txt" << "tmp.txt";
#else
QTest::newRow("absFilePath") << "/home/andy/tmp.txt" << "tmp.txt";
QFETCH(QString, file);
QFETCH(int, perms);
QFETCH(bool, expected);
-#ifdef Q_OS_SYMBIAN
- QSKIP("No user based rights in Symbian OS - SOS needs platform security tests instead", SkipAll);
-#endif
QFileInfo fi(file);
QCOMPARE(fi.permission(QFile::Permissions(perms)), expected);
}
QTest::newRow("casesense1")
<< QString::fromLatin1(SRCDIR "tst_qfileInfo.cpp")
<< QString::fromLatin1(SRCDIR "tst_qfileinfo.cpp")
-#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
+#if defined(Q_OS_WIN)
<< true;
#elif defined(Q_OS_MAC)
<< !caseSensitiveOnMac;
QTest::addColumn<QString>("file");
QTest::addColumn<QString>("expected");
-#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
+#if defined(Q_OS_WIN)
QTest::newRow("slashes") << QString::fromLatin1("\\a\\a\\a\\a") << QString::fromLatin1("/a/a/a/a");
#endif
QTest::newRow("ending slash") << QString::fromLatin1("/a/somedir/") << QString::fromLatin1("/a/somedir/");
#if defined(Q_OS_WINCE)
QEXPECT_FAIL("longfile", "No long filenames on WinCE", Abort);
QEXPECT_FAIL("longfile absolutepath", "No long filenames on WinCE", Abort);
-#elif defined(Q_OS_SYMBIAN)
- QEXPECT_FAIL("longfile", "Maximum total filepath cannot exceed 256 characters in Symbian", Abort);
- QEXPECT_FAIL("longfile absolutepath", "Maximum total filepath cannot exceed 256 characters in Symbian", Abort);
#endif
QVERIFY(file.open(QFile::WriteOnly | QFile::Text));
#ifdef Q_OS_UNIX
#ifdef Q_OS_WINCE
QEXPECT_FAIL("simple", "WinCE only stores date of access data, not the time", Continue);
#endif
-#ifdef Q_OS_SYMBIAN
- QEXPECT_FAIL("simple", "Symbian implementation of stat doesn't return read time right", Abort);
-#endif
QVERIFY(fileInfo.lastRead() > beforeRead);
QVERIFY(fileInfo.lastModified() > beforeWrite);
QVERIFY(fileInfo.lastModified() < beforeRead);
QTest::newRow("C:/path/to/hidden-directory") << QDir::currentPath() + QString::fromLatin1("/hidden-directory") << true;
QTest::newRow("C:/path/to/hidden-directory/.") << QDir::currentPath() + QString::fromLatin1("/hidden-directory/.") << true;
#endif
-#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN)
+#if defined(Q_OS_UNIX)
QVERIFY(QDir("./.hidden-directory").exists() || QDir().mkdir("./.hidden-directory"));
QTest::newRow("/path/to/.hidden-directory") << QDir::currentPath() + QString("/.hidden-directory") << true;
QTest::newRow("/path/to/.hidden-directory/.") << QDir::currentPath() + QString("/.hidden-directory/.") << true;
#if defined(Q_OS_MAC)
// /bin has the hidden attribute on Mac OS X
QTest::newRow("/bin/") << QString::fromLatin1("/bin/") << true;
-#elif !defined(Q_OS_WIN) && !defined(Q_OS_SYMBIAN)
+#elif !defined(Q_OS_WIN)
QTest::newRow("/bin/") << QString::fromLatin1("/bin/") << false;
#endif
QTest::newRow("mac_private_etc") << QString::fromLatin1("/private/etc") << false;
QTest::newRow("mac_Applications") << QString::fromLatin1("/Applications") << false;
#endif
-
-#ifdef Q_OS_SYMBIAN
- // No guaranteed hidden file knows to exist in Symbian filesystem, so make one.
- QString hiddenFileName("hidden.txt");
- QString notHiddenFileName("nothidden.txt");
- QTest::newRow("hidden file") << hiddenFileName << true;
- QTest::newRow("non-hidden file") << notHiddenFileName << false;
-
- {
- QFile file(hiddenFileName);
- QVERIFY(file.open(QIODevice::WriteOnly));
- QTextStream t(&file);
- t << "foobar";
-
- QFile file2(notHiddenFileName);
- QVERIFY(file2.open(QIODevice::WriteOnly));
- QTextStream t2(&file2);
- t2 << "foobar";
- }
-
- RFs rfs;
- TInt err = rfs.Connect();
- QCOMPARE(err, KErrNone);
- HBufC* symFile = qt_QString2HBufC(hiddenFileName);
- err = rfs.SetAtt(*symFile, KEntryAttHidden, 0);
- rfs.Close();
- delete symFile;
- QCOMPARE(err, KErrNone);
-#endif
}
void tst_QFileInfo::isHidden()
QVERIFY(fi.exists());
QVERIFY(!fi.isWritable());
#endif
-#if defined (Q_OS_UNIX) && !defined (Q_OS_SYMBIAN)
+#if defined (Q_OS_UNIX)
if (::getuid() == 0)
QVERIFY(QFileInfo("/etc/passwd").isWritable());
else
void tst_QFileInfo::isExecutable()
{
-#ifdef Q_OS_SYMBIAN
- QString appPath = "c:/sys/bin/tst_qfileinfo.exe";
-#else
QString appPath = QCoreApplication::applicationDirPath();
appPath += "/tst_qfileinfo";
-# if defined(Q_OS_WIN)
+#if defined(Q_OS_WIN)
appPath += ".exe";
-# endif
#endif
QFileInfo fi(appPath);
QCOMPARE(fi.isExecutable(), true);
QVERIFY(!info1.caching());
}
-#if !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN)
+#if !defined(Q_OS_WINCE)
#if defined (Q_OS_WIN)
BOOL IsUserAdmin()
{
void tst_QFileInfo::group()
{
QString expected;
-#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN)
+#if defined(Q_OS_UNIX)
struct group *gr;
gid_t gid = getegid();
gr = getgrgid(gid);
#include <QtCore/private/qfilesystementry_p.h>
-#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
+#if defined(Q_OS_WIN)
# define WIN_STUFF
#endif
if (inotify_init() != -1)
do_force_engines << "inotify";
#endif
-#elif defined(Q_OS_WIN) || defined(Q_OS_DARWIN) || defined(Q_OS_FREEBSD) || defined(Q_OS_SYMBIAN)
+#elif defined(Q_OS_WIN) || defined(Q_OS_DARWIN) || defined(Q_OS_FREEBSD)
// we have native engines for win32, macosx and freebsd
do_force_engines << "native";
#endif
//Note that if there are several changes during a short period of time, some
//of the changes might not emit this signal. However, the last change in the
//sequence of changes will always generate this signal.
- //Symbian behaves as documented (and can't be filtered), but the other platforms don't
- //so test should not assert this
QVERIFY(dirChangedSpy.count() < 2);
if (backend == "dnotify")
timer.start(3000);
eventLoop.exec();
QCOMPARE(fileChangedSpy.count(), 0);
- // polling watcher has generated separate events for content and time change
- // on Symbian emulator, so allow possibility of 2 events
- QVERIFY(dirChangedSpy.count() == 1 || dirChangedSpy.count() == 2);
+ QCOMPARE(dirChangedSpy.count(), 1);
QVERIFY(QDir().rmdir("testDir"));
}
DEPLOYMENT += addFiles
DEFINES += SRCDIR=\\\"\\\"
!wince50standard-x86-msvc2005: DEFINES += WINCE_EMULATOR_TEST=1
-} else:symbian {
- # SRCDIR defined in code in symbian
- addFiles.files = tst_qiodevice.cpp
- addFiles.path = .
- DEPLOYMENT += addFiles
- TARGET.CAPABILITY = NetworkServices
} else {
DEFINES += SRCDIR=\\\"$$PWD/\\\"
}
//TESTED_CLASS=
//TESTED_FILES=
-#ifdef Q_OS_SYMBIAN
-#define SRCDIR ""
-#endif
-
class tst_QIODevice : public QObject
{
Q_OBJECT
tst_QIODevice::tst_QIODevice()
{
- Q_SET_DEFAULT_IAP
}
tst_QIODevice::~tst_QIODevice()
testGuiProcess \
testDetached \
fileWriterProcess \
- testSetWorkingDirectory
-
-!symbian: {
-SUBDIRS +=testProcessSpacesArgs/onespace.pro \
+ testSetWorkingDirectory \
+ testProcessSpacesArgs/onespace.pro \
testProcessSpacesArgs/twospaces.pro \
testSoftExit
-}
win32:!wince*:SUBDIRS+=testProcessEchoGui
SUBDIRS += test
-
-
QT = core
-
-!symbian: {
- QT += network
-}
+QT += network
embedded: QT += gui
addFile_testSoftExit \
addFile_testSpaceInName
}
-
-symbian: {
- binDep.files = \
- fileWriterProcess.exe \
- testDetached.exe \
- testExitCodes.exe \
- testProcessCrash.exe \
- testProcessEcho.exe \
- testProcessNormal.exe \
- testProcessOutput.exe \
- nospace.exe \
- testSpaceInName.exe
- binDep.path = \\sys\\bin
-
- DEPLOYMENT += binDep
-}
CONFIG -= app_bundle
INSTALLS =
DESTDIR = ./
-
-symbian: {
-TARGET.EPOCSTACKSIZE =0x14000
-}
int main()
{
-#if defined(__SYMBIAN32__)
- // Printing to stdout messes up the out.txt, so open a file and print there.
- FILE* file = fopen("c:\\logs\\qprocess_output_test.txt","w+");
- for (int i=0; i<200; i++) {
- fprintf(file, "%d -this is a number\n", i);
- fflush(file);
- }
- fclose(file);
-#else
-# if defined(_WIN32_WCE)
+#if defined(_WIN32_WCE)
for (int i=0; i<240; i++) {
-# else //fprintf Output is very slow on Windows CE/Symbian
+#else //fprintf Output is very slow on Windows CE
for (int i=0; i<10240; i++) {
-# endif
+#endif
fprintf(stdout, "%d -this is a number\n", i);
fflush(stderr);
}
-#endif
return 0;
}
int main(int argc, char ** argv)
{
-#if defined(__SYMBIAN32__) || defined(WINCE) || defined(_WIN32_WCE)
-# if defined(__SYMBIAN32__)
- // Printing to stdout messes up the out.txt, so open a file and print there.
- FILE* file = fopen("c:\\logs\\qprocess_args_test.txt","w+");
-# else
+#if defined(WINCE) || defined(_WIN32_WCE)
// No pipes on this "OS"
FILE* file = fopen("\\temp\\qprocess_args_test.txt","w+");
-# endif
for (int i = 0; i < argc; ++i) {
if (i)
fprintf(file, "|");
#include <QtCore/QRegExp>
#include <QtCore/QDebug>
#include <QtCore/QMetaType>
-#if !defined(Q_OS_SYMBIAN)
// Network test unnecessary?
#include <QtNetwork/QHostInfo>
-#endif
#include <stdlib.h>
#ifdef QT_NO_PROCESS
void waitForBytesWrittenInABytesWrittenSlot();
void spaceArgsTest_data();
void spaceArgsTest();
-#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
+#if defined(Q_OS_WIN)
void nativeArguments();
#endif
void exitCodeTest();
void tst_QProcess::init()
{
-#ifdef Q_OS_SYMBIAN
- QString dirStr = QString::fromLatin1("c:\\logs");
- QDir dir;
- if (!dir.exists(dirStr))
- dir.mkpath(dirStr);
-#endif
}
void tst_QProcess::cleanup()
// Note: This actually seems incorrect, it will only exit the while loop when finishing fails
while (process->waitForFinished(5000))
{ }
-#elif defined(Q_OS_SYMBIAN)
- QVERIFY(process->waitForFinished(5000));
#else
while (process->waitForReadyRead(5000))
{ }
#ifdef Q_OS_WINCE
QSKIP("Reading and writing to a process is not supported on Qt/CE", SkipAll);
#endif
-#if defined(Q_OS_SYMBIAN)
- QSKIP("Reading and writing to a process is not supported on Qt/Symbian", SkipAll);
-#endif
QFETCH(QByteArray, input);
#ifdef Q_OS_WINCE
QSKIP("Reading and writing to a process is not supported on Qt/CE", SkipAll);
#endif
-#if defined(Q_OS_SYMBIAN)
- QSKIP("Reading and writing to a process is not supported on Qt/Symbian", SkipAll);
-#endif
process = new QProcess;
connect(process, SIGNAL(readyRead()), this, SLOT(exitLoopSlot()));
#ifdef Q_OS_WINCE
QSKIP("Reading and writing to a process is not supported on Qt/CE", SkipAll);
#endif
-#if defined(Q_OS_SYMBIAN)
- QSKIP("Reading and writing to a process is not supported on Qt/Symbian", SkipAll);
-#endif
QProcess process;
#ifdef Q_OS_MAC
#ifdef Q_OS_WINCE
QSKIP("Reading and writing to a process is not supported on Qt/CE", SkipAll);
#endif
-#if defined(Q_OS_SYMBIAN)
- QSKIP("Reading and writing to a process is not supported on Qt/Symbian", SkipAll);
-#endif
QProcess process;
#if defined(Q_OS_WINCE)
QSKIP("Batch files are not supported on Windows CE", SkipAll);
#endif
-#if defined(Q_OS_SYMBIAN)
- QSKIP("Batch files are not supported on Symbian", SkipAll);
-#endif
QFETCH(QString, batFile);
QFETCH(QByteArray, output);
#ifdef Q_OS_WINCE
QSKIP("Reading and writing to a process is not supported on Qt/CE", SkipAll);
#endif
-#if defined(Q_OS_SYMBIAN)
- QSKIP("Reading and writing to a process is not supported on Qt/Symbian", SkipAll);
-#endif
process = new QProcess;
#ifdef Q_OS_MAC
#ifdef Q_OS_WINCE
QSKIP("Reading and writing to a process is not supported on Qt/CE", SkipAll);
#endif
-#if defined(Q_OS_SYMBIAN)
- QSKIP("Reading and writing to a process is not supported on Qt/Symbian", SkipAll);
-#endif
process = new QProcess;
#ifdef Q_OS_MAC
process.start("testProcessOutput/testProcessOutput");
#endif
-#if !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN)
+#if !defined(Q_OS_WINCE)
QVERIFY(process.waitForFinished(5000));
#else
QVERIFY(process.waitForFinished(30000));
#endif
QCOMPARE(process.exitStatus(), QProcess::NormalExit);
-#if defined(Q_OS_SYMBIAN)
- // Symbian test outputs to a file, so check that
- FILE* file = fopen("c:\\logs\\qprocess_output_test.txt","r");
- int retval = 0;
- int count = 0;
- while((int)(retval = fgetc(file) )!= EOF)
- if (retval == '\n')
- count++;
- fclose(file);
- QCOMPARE(count, 200);
-#else
-# if defined (Q_OS_WINCE)
+#if defined (Q_OS_WINCE)
QEXPECT_FAIL("", "Reading and writing to a process is not supported on Qt/CE", Continue);
-# endif
+#endif
QString output = process.readAll();
QCOMPARE(output.count("\n"), 10*1024);
-#endif
process.start("blurdybloop");
QVERIFY(!process.waitForFinished());
#ifdef Q_OS_WINCE
QSKIP("Reading and writing to a process is not supported on Qt/CE", SkipAll);
#endif
-#if defined(Q_OS_SYMBIAN)
- QSKIP("Reading and writing to a process is not supported on Qt/Symbian", SkipAll);
-#endif
QProcess process;
#ifdef Q_OS_WINCE
QSKIP("Reading and writing to a process is not supported on Qt/CE", SkipAll);
#endif
-#if defined(Q_OS_SYMBIAN)
- QSKIP("Reading and writing to a process is not supported on Qt/Symbian", SkipAll);
-#endif
// The purpose of this test is to detect whether restarting a
// process in the finished() connected slot causes a deadlock
#ifdef Q_OS_WINCE
QSKIP("Reading and writing to a process is not supported on Qt/CE", SkipAll);
#endif
-#if defined(Q_OS_SYMBIAN)
- QSKIP("Reading and writing to a process is not supported on Qt/Symbian", SkipAll);
-#endif
QProcess more;
more.start("testProcessEOF/testProcessEOF");
#ifdef Q_OS_WINCE
QSKIP("Reading and writing to a process is not supported on Qt/CE", SkipAll);
#endif
-#if defined(Q_OS_SYMBIAN)
- QSKIP("Reading and writing to a process is not supported on Qt/Symbian", SkipAll);
-#endif
for (int i = 0; i < 10; ++i) {
QProcess::ProcessChannel channel1 = QProcess::StandardOutput;
#ifdef Q_OS_WINCE
QSKIP("Reading and writing to a process is not supported on Qt/CE", SkipAll);
#endif
-#if defined(Q_OS_SYMBIAN)
- QSKIP("Reading and writing to a process is not supported on Qt/Symbian", SkipAll);
-#endif
QProcess proc;
QVERIFY(!proc.isOpen());
#ifdef Q_OS_WINCE
QSKIP("Reading and writing to a process is not supported on Qt/CE", SkipAll);
#endif
-#if defined(Q_OS_SYMBIAN)
- QSKIP("Reading and writing to a process is not supported on Qt/Symbian", SkipAll);
-#endif
QProcess proc;
connect(&proc, SIGNAL(readyRead()), this, SLOT(exitLoopSlot()));
//-----------------------------------------------------------------------------
void tst_QProcess::hardExit()
{
-#if defined(Q_OS_SYMBIAN)
- QSKIP("Killing started processes is not supported on Qt/Symbian due platform security", SkipAll);
-#endif
QProcess proc;
#if defined(Q_OS_MAC)
//-----------------------------------------------------------------------------
void tst_QProcess::softExit()
{
-#if defined(Q_OS_SYMBIAN)
- QSKIP("Terminating started processes is not supported on Qt/Symbian due platform security", SkipAll);
-#endif
QProcess proc;
proc.start("testSoftExit/testSoftExit");
#ifdef Q_OS_WINCE
QSKIP("Reading and writing to a process is not supported on Qt/CE", SkipAll);
#endif
-#if defined(Q_OS_SYMBIAN)
- QSKIP("Reading and writing to a process is not supported on Qt/Symbian", SkipAll);
-#endif
QFETCH(QString, appName);
#ifdef Q_OS_WINCE
QSKIP("Reading and writing to a process is not supported on Qt/CE", SkipAll);
#endif
-#if defined(Q_OS_SYMBIAN)
- QSKIP("Reading and writing to a process is not supported on Qt/Symbian", SkipAll);
-#endif
QProcess process;
process.setReadChannelMode(QProcess::MergedChannels);
#ifdef Q_OS_WINCE
QSKIP("Reading and writing to a process is not supported on Qt/CE", SkipAll);
#endif
-#if defined(Q_OS_SYMBIAN)
- QSKIP("Reading and writing to a process is not supported on Qt/Symbian", SkipAll);
-#endif
QProcess process;
process.setReadChannelMode(QProcess::ForwardedChannels);
#ifdef Q_OS_WINCE
QSKIP("Reading and writing to a process is not supported on Qt/CE", SkipAll);
#endif
-#if defined(Q_OS_SYMBIAN)
- QSKIP("Reading and writing to a process is not supported on Qt/Symbian", SkipAll);
-#endif
QProcess process;
return exitCode;
}
-#if defined(Q_OS_SYMBIAN)
- int serial;
-#endif
-
protected:
inline void run()
{
#ifdef Q_OS_MAC
process.start("testProcessEcho/testProcessEcho.app");
-#elif defined(Q_OS_SYMBIAN) && defined(Q_CC_NOKIAX86)
- // WINSCW builds in Symbian do not allow multiple processes to load Qt libraries,
- // so use just a simple process instead of testDetached.
- process.start("testProcessNormal");
-#elif defined(Q_OS_SYMBIAN)
- // testDetached used because it does something, but doesn't take too long.
- QFile infoFile(QString("c:\\logs\\detinfo%1").arg(serial));
- QStringList args;
- args << infoFile.fileName();
- process.start("testDetached", args);
#else
process.start("testProcessEcho/testProcessEcho");
#endif
-#if !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN)
+#if !defined(Q_OS_WINCE)
QCOMPARE(process.write("abc\0", 4), qint64(4));
#endif
exitCode = exec();
//-----------------------------------------------------------------------------
void tst_QProcess::processesInMultipleThreads()
{
-#if defined(Q_OS_SYMBIAN)
- int serialCounter = 0;
-#endif
-
for (int i = 0; i < 10; ++i) {
TestThread thread1;
TestThread thread2;
TestThread thread3;
-#if defined(Q_OS_SYMBIAN)
- thread1.serial = serialCounter++;
- thread2.serial = serialCounter++;
- thread3.serial = serialCounter++;
-#endif
thread1.start();
thread2.start();
thread3.start();
#ifdef Q_OS_MAC
process->start("testProcessEcho/testProcessEcho.app");
-#elif defined(Q_OS_SYMBIAN)
- process->start("testProcessOutput");
#else
process->start("testProcessEcho/testProcessEcho");
#endif
-#if defined(Q_OS_SYMBIAN)
- QVERIFY(process->waitForStarted(50));
- QVERIFY(!process->waitForFinished(1));
-#else
QVERIFY(process->waitForStarted(5000));
QVERIFY(!process->waitForFinished(1));
process->write("", 1);
-#endif
QVERIFY(process->waitForFinished());
#ifdef Q_OS_WINCE
QSKIP("Reading and writing to a process is not supported on Qt/CE", SkipAll);
#endif
-#if defined(Q_OS_SYMBIAN)
- QSKIP("Reading and writing to a process is not supported on Qt/Symbian", SkipAll);
-#endif
process = new QProcess(this);
connect(process, SIGNAL(readyRead()), this, SLOT(waitForReadyReadInAReadyReadSlotSlot()));
#ifdef Q_OS_WINCE
QSKIP("Reading and writing to a process is not supported on Qt/CE", SkipAll);
#endif
-#if defined(Q_OS_SYMBIAN)
- QSKIP("Reading and writing to a process is not supported on Qt/Symbian", SkipAll);
-#endif
bytesAvailable = process->bytesAvailable();
process->write("bar", 4);
#ifdef Q_OS_WINCE
QSKIP("Reading and writing to a process is not supported on Qt/CE", SkipAll);
#endif
-#if defined(Q_OS_SYMBIAN)
- QSKIP("Reading and writing to a process is not supported on Qt/Symbian", SkipAll);
-#endif
process = new QProcess(this);
connect(process, SIGNAL(bytesWritten(qint64)), this, SLOT(waitForBytesWrittenInABytesWrittenSlotSlot()));
#ifdef Q_OS_WINCE
QSKIP("Reading and writing to a process is not supported on Qt/CE", SkipAll);
#endif
-#if defined(Q_OS_SYMBIAN)
- QSKIP("Reading and writing to a process is not supported on Qt/Symbian", SkipAll);
-#endif
process->write("b");
QVERIFY(process->waitForBytesWritten(5000));
QStringList programs;
programs << QString::fromLatin1("testProcessSpacesArgs/nospace")
-#if defined(Q_OS_SYMBIAN)
- ; // Symbian toolchain doesn't like exes with spaces in the name
-#else
<< QString::fromLatin1("testProcessSpacesArgs/one space")
<< QString::fromLatin1("testProcessSpacesArgs/two space s");
-#endif
process = new QProcess(this);
QString program = programs.at(i);
process->start(program, args);
-#if !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN)
+#if !defined(Q_OS_WINCE)
QVERIFY(process->waitForStarted(5000));
QVERIFY(process->waitForFinished(5000));
#else
QVERIFY(process->waitForFinished(10000));
#endif
-#if defined(Q_OS_SYMBIAN)
- // Symbian test outputs to a file, so check that
- FILE* file = fopen("c:\\logs\\qprocess_args_test.txt","r");
- QVERIFY(file);
- char buf[256];
- fgets(buf, 256, file);
- fclose(file);
- QStringList actual = QString::fromLatin1(buf).split("|");
-#elif !defined(Q_OS_WINCE)
+#if !defined(Q_OS_WINCE)
QStringList actual = QString::fromLatin1(process->readAll()).split("|");
#endif
#if !defined(Q_OS_WINCE)
QVERIFY(process->waitForStarted(5000));
QVERIFY(process->waitForFinished(5000));
-#if defined(Q_OS_SYMBIAN)
- // Symbian test outputs to a file, so check that
- file = fopen("c:\\logs\\qprocess_args_test.txt","r");
- QVERIFY(file);
- fgets(buf, 256, file);
- fclose(file);
- actual = QString::fromLatin1(buf).split("|");
-#elif !defined(Q_OS_WINCE)
+#if !defined(Q_OS_WINCE)
actual = QString::fromLatin1(process->readAll()).split("|");
#endif
#if !defined(Q_OS_WINCE)
process = 0;
}
-#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
+#if defined(Q_OS_WIN)
//-----------------------------------------------------------------------------
void tst_QProcess::nativeArguments()
proc.start(QString::fromLatin1("testProcessSpacesArgs/nospace"), QStringList());
-#if !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN)
+#if !defined(Q_OS_WINCE)
QVERIFY(proc.waitForStarted(5000));
QVERIFY(proc.waitForFinished(5000));
#else
QVERIFY(proc.waitForFinished(10000));
#endif
-#if defined(Q_OS_SYMBIAN) || defined(Q_OS_WINCE)
- // Symbian test outputs to a file, so check that
-# ifdef Q_OS_SYMBIAN
- FILE* file = fopen("c:\\logs\\qprocess_args_test.txt","r");
-# else
+#if defined(Q_OS_WINCE)
+ // WinCE test outputs to a file, so check that
FILE* file = fopen("\\temp\\qprocess_args_test.txt","r");
-# endif
QVERIFY(file);
char buf[256];
fgets(buf, 256, file);
//-----------------------------------------------------------------------------
void tst_QProcess::exitCodeTest()
{
-#if defined(Q_OS_SYMBIAN)
- // Kernel will run out of process handles on some hw, as there is some
- // delay before they are recycled, so limit the amount of processes.
- for (int i = 0; i < 50; ++i) {
-#else
for (int i = 0; i < 255; ++i) {
-#endif
QProcess process;
process.start("testExitCodes/testExitCodes " + QString::number(i));
QVERIFY(process.waitForFinished(5000));
#ifdef Q_OS_WINCE
QSKIP("Reading and writing to a process is not supported on Qt/CE", SkipAll);
#endif
-#if defined(Q_OS_SYMBIAN)
- QSKIP("Reading and writing to a process is not supported on Qt/Symbian", SkipAll);
-#endif
QFile file("removeFile.txt");
QVERIFY(file.open(QFile::WriteOnly));
void tst_QProcess::setEnvironment()
{
-#if defined (Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
+#if defined (Q_OS_WINCE)
QSKIP("OS doesn't support environment variables", SkipAll);
#endif
void tst_QProcess::setProcessEnvironment()
{
-#if defined (Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
+#if defined (Q_OS_WINCE)
QSKIP("OS doesn't support environment variables", SkipAll);
#endif
//-----------------------------------------------------------------------------
void tst_QProcess::systemEnvironment()
{
-#if defined (Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
+#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());
#ifdef Q_OS_WINCE
QSKIP("Reading and writing to a process is not supported on Qt/CE", SkipAll);
#endif
-#if defined(Q_OS_SYMBIAN)
- QSKIP("Reading and writing to a process is not supported on Qt/Symbian", SkipAll);
-#endif
QProcess process;
process.start("test Space In Name/testSpaceInName", QStringList());
QVERIFY(process.waitForStarted());
//-----------------------------------------------------------------------------
void tst_QProcess::lockupsInStartDetached()
{
-#if !defined(Q_OS_SYMBIAN)
// Check that QProcess doesn't cause a lock up at this program's
// exit if a thread was started and we tried to run a program that
// doesn't exist. Before Qt 4.2, this used to lock up on Unix due
QHostInfo::lookupHost(QString("something.invalid"), 0, 0);
QProcess::execute("yjhbrty");
QProcess::startDetached("yjhbrty");
-#endif
}
//-----------------------------------------------------------------------------
#ifdef Q_OS_WINCE
QSKIP("Reading and writing to a process is not supported on Qt/CE", SkipAll);
#endif
-#if defined(Q_OS_SYMBIAN)
- QSKIP("Reading and writing to a process is not supported on Qt/Symbian", SkipAll);
-#endif
QProcess process;
#ifdef Q_OS_WINCE
QSKIP("Reading and writing to a process is not supported on Qt/CE", SkipAll);
#endif
-#if defined(Q_OS_SYMBIAN)
- QSKIP("Reading and writing to a process is not supported on Qt/Symbian", SkipAll);
-#endif
static const char data[] = "A bunch\1of\2data\3\4\5\6\7...";
QProcess process;
#ifdef Q_OS_WINCE
QSKIP("Reading and writing to a process is not supported on Qt/CE", SkipAll);
#endif
-#if defined(Q_OS_SYMBIAN)
- QSKIP("Reading and writing to a process is not supported on Qt/Symbian", SkipAll);
-#endif
static const char data[] = "Original data. ";
static const char testdata[] = "Test data.";
#ifdef Q_OS_WINCE
QSKIP("Reading and writing to a process is not supported on Qt/CE", SkipAll);
#endif
-#if defined(Q_OS_SYMBIAN)
- QSKIP("Reading and writing to a process is not supported on Qt/Symbian", SkipAll);
-#endif
QProcess source;
QProcess sink;
#ifdef Q_OS_WINCE
QSKIP("Reading and writing to a process is not supported on Qt/CE", SkipAll);
#endif
-#if defined(Q_OS_SYMBIAN)
- QSKIP("Reading and writing to a process is not supported on Qt/Symbian", SkipAll);
-#endif
QString stdinStr;
for (int i = 0; i < 5000; ++i)
//-----------------------------------------------------------------------------
void tst_QProcess::detachedWorkingDirectoryAndPid()
{
-#if defined(Q_OS_SYMBIAN) && defined(Q_CC_NOKIAX86)
- // WINSCW builds in Symbian do not allow multiple processes to load Qt libraries,
- // so this test must be skipped.
- QSKIP("Multiple processes loading Qt are not allowed in Qt/Symbian emulator.", SkipAll);
-#endif
qint64 pid;
#ifdef Q_OS_WINCE
QTest::qSleep(1000);
#endif
-#if defined(Q_OS_SYMBIAN)
- // Symbian has no working directory support, so use logs dir as a shared directory
- QFile infoFile(QLatin1String("c:\\logs\\detachedinfo.txt"));
-#else
QFile infoFile(QDir::currentPath() + QLatin1String("/detachedinfo.txt"));
-#endif
infoFile.remove();
QString workingDir = QDir::currentPath() + "/testDetached";
-#ifndef Q_OS_SYMBIAN
QVERIFY(QFile::exists(workingDir));
-#endif
QStringList args;
args << infoFile.fileName();
qint64 actualPid = processIdString.toLongLong(&ok);
QVERIFY(ok);
-#if defined(Q_OS_SYMBIAN)
- QEXPECT_FAIL("", "Working directory is not supported on Qt/symbian", Continue);
-#endif
QCOMPARE(actualWorkingDir, workingDir);
QCOMPARE(actualPid, pid);
}
#ifdef Q_OS_WINCE
QSKIP("Reading and writing to a process is not supported on Qt/CE", SkipAll);
#endif
-#if defined(Q_OS_SYMBIAN)
- QSKIP("Reading and writing to a process is not supported on Qt/Symbian", SkipAll);
-#endif
const char data[] = "ABCD";
QProcess process;
#ifdef Q_OS_WINCE
QSKIP("Windows CE does not support working directory logic", SkipAll);
#endif
-#if defined(Q_OS_SYMBIAN)
- QSKIP("Symbian does not support working directory logic", SkipAll);
-#endif
process = new QProcess;
process->setWorkingDirectory("test");
#ifdef Q_OS_MAC
#else
process.start("testProcessOutput/testProcessOutput");
#endif
-#if !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN)
+#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));
-#if defined(Q_OS_SYMBIAN)
- // Symbian test outputs to a file, so check that
- FILE* file = fopen("c:\\logs\\qprocess_output_test.txt","r");
- QVERIFY(file);
- char buf[30];
- fgets(buf, 30, file);
- QCOMPARE(QString::fromLatin1(buf),
- QString("0 -this is a number\n"));
- fclose(file);
-#endif
}
}
SOURCES += tst_qresourceengine.cpp
RESOURCES += testqrc/test.qrc
-symbian-sbsv2 {
- runtime_resource.target = $$PWD/runtime_resource.rcc
-} else {
- runtime_resource.target = runtime_resource.rcc
-}
+runtime_resource.target = runtime_resource.rcc
runtime_resource.depends = $$PWD/testqrc/test.qrc
runtime_resource.commands = $$QMAKE_RCC -root /runtime_resource/ -binary $${runtime_resource.depends} -o $${runtime_resource.target}
QMAKE_EXTRA_TARGETS = runtime_resource
PRE_TARGETDEPS += $${runtime_resource.target}
QT = core
-wince*|symbian:{
+wince* {
deploy.files += runtime_resource.rcc parentdir.txt
test.files = testqrc/*
test.path = testqrc
testsub2.files = testqrc/test/test/*
testsub2.path = testqrc/test/test
DEPLOYMENT += deploy test alias other search1 search2 sub testsub testsub2
- !symbian:DEFINES += SRCDIR=\\\"\\\"
+ DEFINES += SRCDIR=\\\"\\\"
} else {
DEFINES += SRCDIR=\\\"$$PWD/\\\"
}
#include <QtTest/QtTest>
#include <QtCore>
-#ifdef Q_OS_SYMBIAN
-#define SRCDIR "."
-#endif
-
class tst_QResourceEngine: public QObject
{
Q_OBJECT
#include <QtGui/QKeySequence>
#include "../../../../shared/util.h"
-#if !defined(Q_OS_SYMBIAN)
-# include <cctype>
-#endif
+#include <cctype>
#if defined(Q_OS_WIN) && defined(Q_CC_GNU)
// need for unlink on mingw
#include <io.h>
void setPath();
void setDefaultFormat();
void dontCreateNeedlessPaths();
-#if !defined(Q_OS_WIN) && !defined(Q_OS_SYMBIAN)
+#if !defined(Q_OS_WIN)
void dontReorderIniKeysNeedlessly();
#endif
#if defined(Q_OS_WIN)
Q_DECLARE_METATYPE(QSettings::Format)
-#if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
+#if defined(Q_OS_WINCE)
static void removePath(const QString& _path)
{
QString path = _path;
QSettings(QSettings::SystemScope, "software.org").clear();
QSettings(QSettings::UserScope, "other.software.org").clear();
QSettings(QSettings::SystemScope, "other.software.org").clear();
-#elif defined(Q_OS_SYMBIAN)
- removePath(settingsPath());
#endif
-#if !defined(Q_OS_WIN) && !defined(Q_OS_SYMBIAN)
+#if !defined(Q_OS_WIN)
system(QString("chmod -R u+rw %1 2> /dev/null").arg(settingsPath()).toLatin1());
system(QString("rm -fr %1 2> /dev/null").arg(settingsPath()).toLatin1());
#endif
*/
QSettings settings5(format, QSettings::UserScope, "SoftWare.ORG", "killerApp");
if (format == QSettings::NativeFormat) {
-#if defined(Q_OS_WIN) || defined(Q_OS_DARWIN) || defined(Q_OS_SYMBIAN)
+#if defined(Q_OS_WIN) || defined(Q_OS_DARWIN)
QCOMPARE(settings5.value("key 1").toString(), QString("gurgle"));
#else
QVERIFY(!settings5.contains("key 1"));
#endif
} else {
-#if defined(Q_OS_WIN) || defined(Q_OS_DARWIN) || defined(Q_OS_SYMBIAN)
+#if defined(Q_OS_WIN) || defined(Q_OS_DARWIN)
QCOMPARE(settings5.value("key 1").toString(), QString("gurgle"));
#else
QVERIFY(!settings5.contains("key 1"));
#ifdef QT_BUILD_INTERNAL
#ifdef Q_OS_WIN
QSKIP("Windows doesn't support most file modes, including read-only directories, so this test is moot.", SkipAll);
-#elif defined(Q_OS_SYMBIAN)
- QSKIP("Symbian/Open C doesn't support execute or write only file modes, or directory permissions, so this test is mostly moot.", SkipAll);
#elif defined(Q_OS_UNIX)
if (::getuid() == 0)
QSKIP("Running this test as root doesn't work, since file perms do not bother him", SkipAll);
// Now "some other app" will change other.software.org.ini
QString userConfDir = settingsPath("__user__") + QDir::separator();
-#if !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN)
+#if !defined(Q_OS_WINCE)
unlink((userConfDir + "other.software.org.ini").toLatin1());
rename((userConfDir + "software.org.ini").toLatin1(),
(userConfDir + "other.software.org.ini").toLatin1());
QVERIFY(!fileInfo.dir().exists());
}
-#if !defined(Q_OS_WIN) && !defined(Q_OS_SYMBIAN)
+#if !defined(Q_OS_WIN)
void tst_QSettings::dontReorderIniKeysNeedlessly()
{
#ifdef QT_QSETTINGS_ALWAYS_CASE_SENSITIVE_AND_FORGET_ORIGINAL_KEY_ORDER
SOURCES += tst_qtemporaryfile.cpp
QT = core
-
-symbian {
- testData.files = tst_qtemporaryfile.cpp
- testData.path = .
- DEPLOYMENT += testData
-}else {
- DEFINES += SRCDIR=\\\"$$PWD/\\\"
-}
+DEFINES += SRCDIR=\\\"$$PWD/\\\"
CONFIG += parallel_test
# include <unistd.h> // close(2)
#endif
-#ifdef Q_OS_SYMBIAN
-#define SRCDIR ""
-#endif
-
//TESTED_CLASS=
//TESTED_FILES=
QVERIFY(QFile::exists(fileName));
// Get path to the temp file, without the file name.
QString absoluteFilePath = QFileInfo(fileName).absolutePath();
-#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
+#if defined(Q_OS_WIN)
absoluteFilePath = absoluteFilePath.toLower();
absoluteTempPath = absoluteTempPath.toLower();
#endif
void tst_QTemporaryFile::stressTest()
{
-#if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
+#if defined(Q_OS_WINCE)
// 200 is still ok, first colision happens after ~30
const int iterations = 200;
#else
TEMPLATE = subdirs
-SUBDIRS = test
-!symbian: SUBDIRS += stdinProcess readAllStdinProcess readLineStdinProcess
-
-
-
+SUBDIRS = test stdinProcess readAllStdinProcess readLineStdinProcess
QT = core network
-
-wince*|symbian: {
- addFiles.files = ../rfc3261.txt ../shift-jis.txt ../task113817.txt ../qtextstream.qrc ../tst_qtextstream.cpp
- addFiles.path = .
- res.files = ../resources
- res.path = .
- DEPLOYMENT += addFiles
-}
-
-wince*: {
+wince* {
+ addFiles.files = ../rfc3261.txt ../shift-jis.txt ../task113817.txt ../qtextstream.qrc ../tst_qtextstream.cpp
+ addFiles.path = .
+ res.files = ../resources
+ res.path = .
+ DEPLOYMENT += addFiles
DEFINES += SRCDIR=\\\"\\\"
-}else:symbian {
- # Symbian can't define SRCDIR meaningfully here
- qt_not_deployed {
- codecs_plugins.files = qcncodecs.dll qjpcodecs.dll qtwcodecs.dll qkrcodecs.dll
- codecs_plugins.path = $$QT_PLUGINS_BASE_DIR/codecs
- DEPLOYMENT += codecs_plugins
- }
-}else {
+} else {
DEFINES += SRCDIR=\\\"$$PWD/../\\\"
}
-
-
//TESTED_CLASS=
//TESTED_FILES=
-#ifdef Q_OS_SYMBIAN
-#define SRCDIR ""
-#endif
-
class tst_QTextStream : public QObject
{
Q_OBJECT
tst_QTextStream::tst_QTextStream()
{
- Q_SET_DEFAULT_IAP
}
tst_QTextStream::~tst_QTextStream()
#endif
QTcpSocket socket;
socket.connectToHost(QtNetworkSettings::serverName(), 143);
-#if defined(Q_OS_SYMBIAN)
- // This number is determined in an arbitrary way; whatever it takes
- // to make the test pass.
- QVERIFY(socket.waitForReadyRead(30000));
-#else
QVERIFY(socket.waitForReadyRead(5000));
-#endif
QTextStream stream2(&socket);
while (!stream2.readLine().isNull()) {}
// ------------------------------------------------------------------------------
void tst_QTextStream::readStdin()
{
-#if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
- QSKIP("Qt/CE and Symbian have no stdin/out support for processes", SkipAll);
+#if defined(Q_OS_WINCE)
+ QSKIP("Qt/CE has no stdin/out support for processes", SkipAll);
#endif
QProcess stdinProcess;
stdinProcess.start("stdinProcess/stdinProcess");
// ------------------------------------------------------------------------------
void tst_QTextStream::readAllFromStdin()
{
-#if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
- QSKIP("Qt/CE and Symbian have no stdin/out support for processes", SkipAll);
+#if defined(Q_OS_WINCE)
+ QSKIP("Qt/CE has no stdin/out support for processes", SkipAll);
#endif
QProcess stdinProcess;
stdinProcess.start("readAllStdinProcess/readAllStdinProcess", QIODevice::ReadWrite | QIODevice::Text);
// ------------------------------------------------------------------------------
void tst_QTextStream::readLineFromStdin()
{
-#if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
- QSKIP("Qt/CE and Symbian have no stdin/out support for processes", SkipAll);
+#if defined(Q_OS_WINCE)
+ QSKIP("Qt/CE has no stdin/out support for processes", SkipAll);
#endif
QProcess stdinProcess;
stdinProcess.start("readLineStdinProcess/readLineStdinProcess", QIODevice::ReadWrite | QIODevice::Text);
// ------------------------------------------------------------------------------
// like QTEST_APPLESS_MAIN, but initialising the locale on Unix
-#if defined (Q_OS_UNIX) && !defined (Q_OS_SYMBIAN)
+#if defined (Q_OS_UNIX)
QT_BEGIN_NAMESPACE
extern bool qt_locale_initialized;
QT_END_NAMESPACE
int main(int argc, char *argv[])
{
-#if defined (Q_OS_UNIX) && !defined (Q_OS_SYMBIAN)
+#if defined (Q_OS_UNIX)
::setlocale(LC_ALL, "");
qt_locale_initialized = true;
#endif
load(qttest_p4)
SOURCES += tst_qurl.cpp
QT = core core-private
-symbian: TARGET.CAPABILITY = NetworkServices
CONFIG += parallel_test
QT += network
win32:!wince*:LIBS += -luser32
-
-symbian:TARGET.CAPABILITY += NetworkServices
#include <QTcpServer>
#include <QTcpSocket>
-#ifdef Q_OS_SYMBIAN
-#include <e32base.h>
-#include <unistd.h>
-#endif
-
#include "../../../../shared/util.h"
//TESTED_CLASS=
void cleanup();
private slots:
// This test *must* run first. See the definition for why.
- void onlySymbianActiveScheduler();
- void symbianNestedActiveSchedulerLoop_data();
- void symbianNestedActiveSchedulerLoop();
void processEvents();
void exec();
void throwInExec();
void tst_QEventLoop::cleanup()
{ }
-#ifdef Q_OS_SYMBIAN
-class OnlySymbianActiveScheduler_helper : public QObject
-{
- Q_OBJECT
-
-public:
- OnlySymbianActiveScheduler_helper(int fd, QTimer *zeroTimer)
- : fd(fd),
- timerCount(0),
- zeroTimer(zeroTimer),
- zeroTimerCount(0),
- notifierCount(0)
- {
- }
- ~OnlySymbianActiveScheduler_helper() {}
-
-public slots:
- void timerSlot()
- {
- // Let all the events occur twice so we know they reactivated after
- // each occurrence.
- if (++timerCount >= 2) {
- // This will hopefully run last, so stop the active scheduler.
- CActiveScheduler::Stop();
- }
- }
- void zeroTimerSlot()
- {
- if (++zeroTimerCount >= 2) {
- zeroTimer->stop();
- }
- }
- void notifierSlot()
- {
- if (++notifierCount >= 2) {
- char dummy;
- ::read(fd, &dummy, 1);
- }
- }
-
-private:
- int fd;
- int timerCount;
- QTimer *zeroTimer;
- int zeroTimerCount;
- int notifierCount;
-};
-#endif
-
-void tst_QEventLoop::onlySymbianActiveScheduler() {
-#ifndef Q_OS_SYMBIAN
- QSKIP("This is a Symbian-only test.", SkipAll);
-#else
- // In here we try to use timers and sockets exclusively using the Symbian
- // active scheduler and no processEvents().
- // This test should therefore be run first, so that we can verify that
- // the first occurrence of processEvents does not do any initialization that
- // we depend on.
-
- // Open up a pipe so we can test socket notifiers.
- int pipeEnds[2];
- if (::pipe(pipeEnds) != 0) {
- QFAIL("Could not open pipe");
- }
- QSocketNotifier notifier(pipeEnds[0], QSocketNotifier::Read);
- QSignalSpy notifierSpy(¬ifier, SIGNAL(activated(int)));
- char dummy = 1;
- ::write(pipeEnds[1], &dummy, 1);
-
- QTimer zeroTimer;
- QSignalSpy zeroTimerSpy(&zeroTimer, SIGNAL(timeout()));
- zeroTimer.setInterval(0);
- zeroTimer.start();
-
- QTimer timer;
- QSignalSpy timerSpy(&timer, SIGNAL(timeout()));
- timer.setInterval(2000); // Generous timeout or this test will fail if there is high load
- timer.start();
-
- OnlySymbianActiveScheduler_helper helper(pipeEnds[0], &zeroTimer);
- connect(¬ifier, SIGNAL(activated(int)), &helper, SLOT(notifierSlot()));
- connect(&zeroTimer, SIGNAL(timeout()), &helper, SLOT(zeroTimerSlot()));
- connect(&timer, SIGNAL(timeout()), &helper, SLOT(timerSlot()));
-
- CActiveScheduler::Start();
-
- ::close(pipeEnds[1]);
- ::close(pipeEnds[0]);
-
- QCOMPARE(notifierSpy.count(), 2);
- QCOMPARE(zeroTimerSpy.count(), 2);
- QCOMPARE(timerSpy.count(), 2);
-#endif
-}
-
void tst_QEventLoop::processEvents()
{
QSignalSpy spy1(QAbstractEventDispatcher::instance(), SIGNAL(aboutToBlock()));
killTimer(timerId);
}
-#if defined(Q_OS_SYMBIAN) && defined(Q_CC_NOKIAX86)
-// Symbian needs bit longer timeout for emulator, as emulator startup causes additional delay
-# define EXEC_TIMEOUT 1000
-#else
-# define EXEC_TIMEOUT 100
-#endif
-
+#define EXEC_TIMEOUT 100
void tst_QEventLoop::exec()
{
{
#if defined(QT_NO_EXCEPTIONS) || defined(NO_EVENTLOOP_EXCEPTIONS)
QSKIP("Exceptions are disabled", SkipAll);
-#elif defined(Q_OS_WINCE_WM) || defined(Q_OS_SYMBIAN)
+#elif defined(Q_OS_WINCE_WM)
// Windows Mobile cannot handle cross library exceptions
// qobject.cpp will try to rethrow the exception after handling
// which causes gwes.exe to crash
-
- // Symbian doesn't propagate exceptions from eventloop, but converts them to
- // CActiveScheduler errors instead -> this test will hang.
QSKIP("This platform doesn't support propagating exceptions through the event loop", SkipAll);
#elif defined(Q_OS_LINUX)
// C++ exceptions can't be passed through glib callbacks. Skip the test if
// normal process events will send timers
eventLoop.processEvents(QEventLoop::X11ExcludeTimers);
-#if !defined(Q_OS_UNIX) || defined(Q_OS_SYMBIAN)
+#if !defined(Q_OS_UNIX)
QEXPECT_FAIL("", "X11ExcludeTimers only works on UN*X", Continue);
#endif
QCOMPARE(timerReceiver.gotTimerEvent, -1);
timerReceiver.gotTimerEvent = -1;
}
-#ifdef Q_OS_SYMBIAN
-class DummyActiveObject : public CActive
-{
-public:
- DummyActiveObject(int levels);
- ~DummyActiveObject();
-
- void Start();
-
-protected:
- void DoCancel();
- void RunL();
-
-public:
- bool succeeded;
-
-private:
- RTimer m_rTimer;
- int remainingLevels;
-};
-
-class ActiveSchedulerLoop : public QObject
-{
-public:
- ActiveSchedulerLoop(int levels) : succeeded(false), timerId(-1), remainingLevels(levels) {}
- ~ActiveSchedulerLoop() {}
-
- void timerEvent(QTimerEvent *e);
-
-public:
- bool succeeded;
- int timerId;
- int remainingLevels;
-};
-
-DummyActiveObject::DummyActiveObject(int levels)
- : CActive(CActive::EPriorityStandard),
- succeeded(false),
- remainingLevels(levels)
-{
- m_rTimer.CreateLocal();
-}
-
-DummyActiveObject::~DummyActiveObject()
-{
- Cancel();
- m_rTimer.Close();
-}
-
-void DummyActiveObject::DoCancel()
-{
- m_rTimer.Cancel();
-}
-
-void DummyActiveObject::RunL()
-{
- if (remainingLevels - 1 <= 0) {
- ActiveSchedulerLoop loop(remainingLevels - 1);
- loop.timerId = loop.startTimer(0);
- QCoreApplication::processEvents();
-
- succeeded = loop.succeeded;
- } else {
- succeeded = true;
- }
- CActiveScheduler::Stop();
-}
-
-void DummyActiveObject::Start()
-{
- m_rTimer.After(iStatus, 100000); // 100 ms
- SetActive();
-}
-
-void ActiveSchedulerLoop::timerEvent(QTimerEvent *e)
-{
- Q_UNUSED(e);
- DummyActiveObject *dummy = new(ELeave) DummyActiveObject(remainingLevels);
- CActiveScheduler::Add(dummy);
-
- dummy->Start();
-
- CActiveScheduler::Start();
-
- succeeded = dummy->succeeded;
-
- delete dummy;
-
- killTimer(timerId);
-}
-
-// We cannot trap panics when the test case fails, so run it in a different thread instead.
-class ActiveSchedulerThread : public QThread
-{
-public:
- ActiveSchedulerThread(QEventLoop::ProcessEventsFlag flags);
- ~ActiveSchedulerThread();
-
-protected:
- void run();
-
-public:
- volatile bool succeeded;
-
-private:
- QEventLoop::ProcessEventsFlag m_flags;
-};
-
-ActiveSchedulerThread::ActiveSchedulerThread(QEventLoop::ProcessEventsFlag flags)
- : succeeded(false),
- m_flags(flags)
-{
-}
-
-ActiveSchedulerThread::~ActiveSchedulerThread()
-{
-}
-
-void ActiveSchedulerThread::run()
-{
- ActiveSchedulerLoop loop(2);
- loop.timerId = loop.startTimer(0);
- // It may panic in here if the active scheduler and the Qt loop don't go together.
- QCoreApplication::processEvents(m_flags);
-
- succeeded = loop.succeeded;
-}
-#endif // ifdef Q_OS_SYMBIAN
-
-void tst_QEventLoop::symbianNestedActiveSchedulerLoop_data()
-{
- QTest::addColumn<int>("processEventFlags");
-
- QTest::newRow("AllEvents") << (int)QEventLoop::AllEvents;
- QTest::newRow("WaitForMoreEvents") << (int)QEventLoop::WaitForMoreEvents;
-}
-
-/*
- Before you start fiddling with this test, you should have a good understanding of how
- Symbian active objects work. What the test does is to try to screw up the semaphore count
- in the active scheduler to cause stray signals, by running the Qt event loop and the
- active scheduler inside each other. Naturally, its attempts to do this should be futile!
-*/
-void tst_QEventLoop::symbianNestedActiveSchedulerLoop()
-{
-#ifndef Q_OS_SYMBIAN
- QSKIP("This is a Symbian only test.", SkipAll);
-#else
- QFETCH(int, processEventFlags);
-
- ActiveSchedulerThread thread((QEventLoop::ProcessEventsFlag)processEventFlags);
- thread.start();
- thread.wait(2000);
-
- QVERIFY(thread.succeeded);
-#endif
-}
-
Q_DECLARE_METATYPE(QThread*)
namespace DeliverInDefinedOrder_QTBUG19637 {
# plugFiles.path = sqldrivers
# DEPLOYMENT += plugFiles
#}
-
-symbian {
- TARGET.EPOCHEAPSIZE="0x100000 0x1000000" # // Min 1Mb, max 16Mb
- qt_not_deployed {
- contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
- sqlite.path = /sys/bin
- sqlite.files = sqlite3.dll
- DEPLOYMENT += sqlite
- }
- }
-}
void tst_QObject::threadSignalEmissionCrash()
{
-#if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
+#if defined(Q_OS_WINCE)
int loopCount = 100;
#else
int loopCount = 1000;
connect(object, SIGNAL(theSignal()), &thread, SLOT(quit()), Qt::DirectConnection);
-#if defined(Q_OS_SYMBIAN)
- // Child timer will be registered after parent timer in the new
- // thread, and 10ms is less than symbian timer resolution, so
- // child->timerEventThread compare after thread.wait() will
- // usually fail unless timers are farther apart.
- child->startTimer(100);
- object->startTimer(150);
-#else
child->startTimer(90);
object->startTimer(100);
-#endif
QCOMPARE(object->thread(), currentThread);
QCOMPARE(child->thread(), currentThread);
void tst_QObject::recursiveSignalEmission()
{
-#if defined(Q_OS_SYMBIAN) && defined(Q_CC_NOKIAX86)
- QSKIP("Emulator builds in Symbian do not support launching processes linking to Qt", SkipAll);
-#elif defined(QT_NO_PROCESS)
+#if defined(QT_NO_PROCESS)
QSKIP("Test requires QProcess", SkipAll);
#else
QProcess proc;
addFiles.path = .
DEPLOYMENT += addFiles
}
-symbian: {
- addFiles.files = signalbug.exe
- addFiles.path = \\sys\\bin
- DEPLOYMENT += addFiles
-}
include(../platformsocketengine/platformsocketengine.pri)
-symbian: TARGET.CAPABILITY = NetworkServices
-
CONFIG += insignificant_test # QTBUG-21204
#include <QtCore/QSocketNotifier>
#include <QtNetwork/QTcpServer>
#include <QtNetwork/QTcpSocket>
-#ifdef Q_OS_SYMBIAN
-#include <private/qsymbiansocketengine_p.h>
-#define NATIVESOCKETENGINE QSymbianSocketEngine
-#else
#include <private/qnativesocketengine_p.h>
#define NATIVESOCKETENGINE QNativeSocketEngine
-#endif
#ifdef Q_OS_UNIX
#include <private/qnet_unix_p.h>
#include <sys/select.h>
void tst_QSocketNotifier::unexpectedDisconnection()
{
-#ifdef Q_OS_SYMBIAN
- QSKIP("Symbian socket engine pseudo descriptors can't be used for QSocketNotifier", SkipAll);
-#else
/*
Given two sockets and two QSocketNotifiers registered on each
their socket. If both sockets receive data, and the first slot
writeEnd1->close();
writeEnd2->close();
server.close();
-#endif
}
class MixingWithTimersHelper : public QObject
void QTBUG13633_dontBlockEvents();
void postedEventsShouldNotStarveTimers();
-#ifdef Q_OS_SYMBIAN
- void handleLeaks();
-#endif
};
class TimerHelper : public QObject
QCOMPARE(helper.count, 1);
}
-#if defined(Q_OS_SYMBIAN)
-// Increase wait as emulator startup can cause unexpected delays, and
-// on hardware there are sometimes spikes right after process startup.
-#define TIMEOUT_TIMEOUT 2000
-#else
#define TIMEOUT_TIMEOUT 200
-#endif
void tst_QTimer::timeout()
{
QVERIFY(pointer.isNull());
}
-#if defined(Q_OS_SYMBIAN) && defined(Q_CC_NOKIAX86)
-// Increase wait as emulator startup can cause unexpected delays
-#define MOVETOTHREAD_TIMEOUT 200
-#define MOVETOTHREAD_WAIT 5000
-#else
#define MOVETOTHREAD_TIMEOUT 200
#define MOVETOTHREAD_WAIT 300
-#endif
void tst_QTimer::moveToThread()
{
{
QTimer timer;
timer.setSingleShot(true);
- timer.start(1000 * 60 * 60); //set timer for 1 hour (which would overflow Symbian RTimer)
+ timer.start(1000 * 60 * 60); //set timer for 1 hour
QCoreApplication::processEvents();
QVERIFY(timer.isActive()); //if the timer completes immediately with an error, then this will fail
timer.stop();
QVERIFY(timerHelper.count > 5);
}
-#ifdef Q_OS_SYMBIAN
-void tst_QTimer::handleLeaks()
-{
- const int timercount = 5;
- int processhandles_start;
- int threadhandles_start;
- RThread().HandleCount(processhandles_start, threadhandles_start);
- {
- TimerHelper timerHelper;
- QList<QTimer*> timers;
- for (int i=0;i<timercount;i++) {
- QTimer* timer = new QTimer;
- timers.append(timer);
- connect(timer, SIGNAL(timeout()), &timerHelper, SLOT(timeout()));
- timer->setSingleShot(true);
- timer->start(i); //test both zero and normal timeouts
- }
- int processhandles_mid;
- int threadhandles_mid;
- RThread().HandleCount(processhandles_mid, threadhandles_mid);
- qDebug() << threadhandles_mid - threadhandles_start << "new thread owned handles";
- QTest::qWait(100);
- QCOMPARE(timerHelper.count, timercount);
- qDeleteAll(timers);
- }
- int processhandles_end;
- int threadhandles_end;
- RThread().HandleCount(processhandles_end, threadhandles_end);
- QCOMPARE(threadhandles_end, threadhandles_start); //RTimer::CreateLocal creates a thread owned handle
- //Can not verify process handles because QObject::connect may create up to 2 mutexes
- //from a QMutexPool (4 process owned handles with open C imp.)
- //QCOMPARE(processhandles_end, processhandles_start);
-}
-#endif
-
QTEST_MAIN(tst_QTimer)
#include "tst_qtimer.moc"
wince* {
DEFINES += SRCDIR=\\\"\\\"
-} else:!symbian {
+} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
//TESTED_CLASS=
//TESTED_FILES=
-#ifdef Q_OS_SYMBIAN
-// In Symbian OS test data is located in applications private dir
-// And underlying Open C have application private dir in default search path
-#define SRCDIR ""
-#endif
-
-
#define EXISTING_SHARE "existing"
class tst_QSystemLock : public QObject
#define tr(x) QT_TRANSLATE_NOOP(QLatin1String("QSystemLock"), (x))
-#if defined(Q_OS_SYMBIAN)
-int createUnixKeyFile(const QString &fileName)
-{
- if (QFile::exists(fileName))
- return 0;
-
- int fd = open(QFile::encodeName(fileName).constData(),
- O_EXCL | O_CREAT | O_RDWR, 0640);
- if (-1 == fd) {
- if (errno == EEXIST)
- return 0;
- return -1;
- } else {
- close(fd);
- }
- return 1;
-}
-#endif
-
QSystemLockPrivate::QSystemLockPrivate() :
semaphore(-1), lockCount(0),
error(QSystemLock::NoError), unix_key(-1), createdFile(false), createdSemaphore(false)
}
// Create the file needed for ftok
-#if defined(Q_OS_SYMBIAN)
- int built = createUnixKeyFile(fileName);
-#else
int built = QSharedMemoryPrivate::createUnixKeyFile(fileName);
-#endif
if (-1 == built)
return -1;
createdFile = (1 == built);
addFiles.path = .
DEPLOYMENT += addFiles
DEFINES += SRCDIR=\\\".\\\"
-}else:symbian{
-requires(contains(QT_CONFIG,script))
-QT += gui script
-addFiles.files = ../../lackey/scripts
-addFiles.path = /data/qsharedmemorytemp/lackey
-addBin.files = lackey.exe
-addBin.path = /sys/bin
-DEPLOYMENT += addFiles addBin
} else {
DEFINES += SRCDIR=\\\"$$PWD/../\\\"
}
#define EXISTING_SHARE "existing"
#define EXISTING_SIZE 1024
-#ifdef Q_OS_SYMBIAN
-#define SRCDIR "c:/data/qsharedmemorytemp/lackey/"
-#define LACKEYDIR SRCDIR "lackey"
-#elif defined(Q_OS_WINCE)
+#if defined(Q_OS_WINCE)
#define LACKEYDIR SRCDIR
#else
#define LACKEYDIR "../lackey"
#ifdef Q_OS_WIN
QSKIP("This test opens a crash dialog on Windows", SkipSingle);
#endif
-#if defined (Q_OS_SYMBIAN)
- QSKIP("Readonly shared memory is not supported in symbian", SkipAll);
-#endif
QString program = LACKEYDIR "/lackey";
QStringList arguments;
rememberKey("readonly_segfault");
char *get = (char*)consumer.data();
// On Windows CE you always have ReadWrite access. Thus
// ViewMapOfFile returns the same pointer
- // On Symbian, the address will always be same, as
- // write protection of chunks is not currently supported by Symbian
-#if !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN)
+#if !defined(Q_OS_WINCE)
QVERIFY(put != get);
#endif
for (int i = 0; i < size; ++i) {
QVERIFY(producer.isAttached());
char *memory = (char*)producer.data();
memory[1] = '0';
-#if defined(Q_OS_SYMBIAN)
- // Sleep a while to ensure that consumers start properly
- QTest::qSleep(1000);
-#endif
QTime timer;
timer.start();
int i = 0;
#endif
Producer p;
-#if defined(Q_OS_SYMBIAN)
- enum
- {
- /**
- * The maximum stack size.
- */
- SymbianStackSize = 0x14000
- };
- p.setStackSize(SymbianStackSize);
-#endif
if (producerIsThread)
p.start();
QList<Consumer*> consumers;
for (int i = 0; i < threads; ++i) {
consumers.append(new Consumer());
-#if defined(Q_OS_SYMBIAN)
- consumers.last()->setStackSize(SymbianStackSize);
-#endif
consumers.last()->start();
}
*/
void tst_QSharedMemory::simpleProcessProducerConsumer()
{
-#if defined (Q_OS_SYMBIAN) && defined(Q_CC_NOKIAX86)
- QSKIP("Cannot launch multiple Qt processes in Symbian emulator", SkipAll);
-#endif
QFETCH(int, processes);
rememberKey("market");
lackey.path = .
DEPLOYMENT += lackey
}
-
-symbian: {
-requires(contains(QT_CONFIG,script))
-# this test calls lackey, which then again depends on QtScript.
-# let's add it here so that it gets deployed easily
-QT += script
-
-lackey.files = ../lackey/lackey.exe
-lackey.path = /sys/bin
-DEPLOYMENT += lackey
-
-# PowerMgmt capability needed to kill lackey process
-TARGET.CAPABILITY = PowerMgmt
-}
-
void tst_QSystemSemaphore::basicProcesses()
{
-#if defined (Q_OS_SYMBIAN) && defined(Q_CC_NOKIAX86)
- QSKIP("Cannot launch multiple Qt processes in Symbian emulator", SkipAll);
-#endif
QSystemSemaphore sem("store", 0, QSystemSemaphore::Create);
QStringList acquireArguments = QStringList() << acquire_js();
void tst_QSystemSemaphore::processes()
{
-#if defined (Q_OS_SYMBIAN) && defined(Q_CC_NOKIAX86)
- QSKIP("Cannot launch multiple Qt processes in Symbian emulator", SkipAll);
-#endif
QSystemSemaphore sem("store", 1, QSystemSemaphore::Create);
QFETCH(int, processes);
void tst_QSystemSemaphore::undo()
{
-#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
+#if defined(Q_OS_WIN)
QSKIP("This test only checks a unix behavior", SkipSingle);
#endif
void tst_QSystemSemaphore::initialValue()
{
-#if defined (Q_OS_SYMBIAN) && defined(Q_CC_NOKIAX86)
- QSKIP("Cannot launch multiple Qt processes in Symbian emulator", SkipAll);
-#endif
QSystemSemaphore sem("store", 1, QSystemSemaphore::Create);
QStringList acquireArguments = QStringList() << acquire_js();
SOURCES += tst_qtranslator.cpp
RESOURCES += qtranslator.qrc
-wince*|symbian: {
+wince* {
addFiles.files = hellotr_la.qm msgfmt_from_po.qm
addFiles.path = .
DEPLOYMENT += addFiles
#no special install rule for the library used by test
INSTALLS =
-
-symbian: TARGET.CAPABILITY=ALL -TCB
-
#include <qglobal.h>
-#if defined(Q_CC_MSVC) || defined(Q_CC_MSVC_NET) || defined(Q_CC_BOR) || defined(Q_OS_SYMBIAN)
+#if defined(Q_CC_MSVC) || defined(Q_CC_MSVC_NET) || defined(Q_CC_BOR)
#define LIB_EXPORT __declspec(dllexport)
#else
#define LIB_EXPORT
# Force a copy of the library to have an extension that is non-standard.
# We want to test if we can load a shared library with *any* filename...
-!symbian {
- win32 {
- # vcproj and Makefile generators refer to target differently
- contains(TEMPLATE,vc.*) {
- src = $(TargetPath)
- } else {
- src = $(DESTDIR_TARGET)
- }
- files = mylib.dl2 system.trolltech.test.mylib.dll
+win32 {
+ # vcproj and Makefile generators refer to target differently
+ contains(TEMPLATE,vc.*) {
+ src = $(TargetPath)
} else {
- src = $(DESTDIR)$(TARGET)
- files = libmylib.so2 system.trolltech.test.mylib.so
+ src = $(DESTDIR_TARGET)
}
- for(file, files) {
- QMAKE_POST_LINK += $$QMAKE_COPY $$src ..$$QMAKE_DIR_SEP$$file &&
- CLEAN_FILES += ../$$file
- }
- QMAKE_POST_LINK = $$member(QMAKE_POST_LINK, 0, -2)
-}
-
-symbian-abld: {
- TARGET.CAPABILITY=ALL -TCB
- FIXEDROOT = $$replace(EPOCROOT,/,\\)
- QMAKE_POST_LINK = \
- copy /Y $${FIXEDROOT}epoc32\\release\\$(PLATFORM)\\$(CFG)\\mylib.dll $${FIXEDROOT}epoc32\\release\\$(PLATFORM)\\$(CFG)\\mylib.dl2 && \
- copy /Y $${FIXEDROOT}epoc32\\release\\$(PLATFORM)\\$(CFG)\\mylib.dll $${FIXEDROOT}epoc32\\release\\$(PLATFORM)\\$(CFG)\\system.trolltech.test.mylib.dll && \
- IF NOT "$(PLATFORM)==WINSCW" copy /Y $${FIXEDROOT}epoc32\\release\\$(PLATFORM)\\$(CFG)\\mylib.dll ..\\tst\\mylib.dl2
+ files = mylib.dl2 system.trolltech.test.mylib.dll
+} else {
+ src = $(DESTDIR)$(TARGET)
+ files = libmylib.so2 system.trolltech.test.mylib.so
}
-
-symbian-sbsv2: {
- TARGET.CAPABILITY=ALL -TCB
- QMAKE_POST_LINK = \
- $(GNUCP) $(EPOCROOT)epoc32/release/$(PLATFORM_PATH)/$(CFG_PATH)/mylib.dll $(EPOCROOT)epoc32/release/$(PLATFORM_PATH)/$(CFG_PATH)/mylib.dl2 && \
- $(GNUCP) $(EPOCROOT)epoc32/release/$(PLATFORM_PATH)/$(CFG_PATH)/mylib.dll $(EPOCROOT)epoc32/release/$(PLATFORM_PATH)/$(CFG_PATH)/system.trolltech.test.mylib.dll && \
- if test $(PLATFORM) != WINSCW;then $(GNUCP) $(EPOCROOT)epoc32/release/$(PLATFORM_PATH)/$(CFG_PATH)/mylib.dll $${PWD}/../tst/mylib.dl2; fi
+for(file, files) {
+ QMAKE_POST_LINK += $$QMAKE_COPY $$src ..$$QMAKE_DIR_SEP$$file &&
+ CLEAN_FILES += ../$$file
}
+QMAKE_POST_LINK = $$member(QMAKE_POST_LINK, 0, -2)
#no special install rule for the library used by test
INSTALLS =
#include <qglobal.h>
-#if defined(Q_CC_MSVC) || defined(Q_CC_MSVC_NET) || defined(Q_CC_BOR)|| defined(Q_OS_SYMBIAN)
+#if defined(Q_CC_MSVC) || defined(Q_CC_MSVC_NET) || defined(Q_CC_BOR)
#define LIB_EXPORT __declspec(dllexport)
#else
#define LIB_EXPORT
TEMPLATE = subdirs
CONFIG += ordered
-symbian: {
-# Can't build two versions of lib with same name in symbian, so just build one
-SUBDIRS = lib2 \
- tst
-} else {
SUBDIRS = lib \
lib2 \
tst
-}
TARGET = tst_qlibrary
# no special install rule for subdir
addFiles.path = .
DEPLOYMENT += addFiles
DEFINES += SRCDIR=\\\"\\\"
-}else:symbian {
- binDep.files = \
- mylib.dll \
- system.trolltech.test.mylib.dll
- binDep.path = /sys/bin
-#mylib.dl2 nonstandard binary deployment will cause warning in emulator,
-#but it can be safely ignored.
- custBinDep.files = mylib.dl2
- custBinDep.path = /sys/bin
-
- DEPLOYMENT += binDep custBinDep
} else {
DEFINES += SRCDIR=\\\"$$PWD/../\\\"
}
# define SUFFIX ".a"
# define PREFIX "lib"
-#elif defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
+#elif defined(Q_OS_WIN)
# undef dll_VALID
# define dll_VALID true
# undef DLL_VALID
static QString sys_qualifiedLibraryName(const QString &fileName)
{
-#if defined(Q_OS_SYMBIAN)
- return PREFIX + fileName + SUFFIX;
-#else
QString currDir = QDir::currentPath();
return currDir + "/" + PREFIX + fileName + SUFFIX;
-#endif
}
//TESTED_CLASS=
QFETCH( int, loadversion );
QFETCH( int, resultversion );
-#if !defined(Q_OS_AIX) && !defined(Q_OS_WIN) && !defined(Q_OS_SYMBIAN)
+#if !defined(Q_OS_AIX) && !defined(Q_OS_WIN)
QString currDir = QDir::currentPath();
QLibrary library( currDir + QLatin1Char('/') + lib, loadversion );
bool ok = library.load();
QTest::addColumn<QString>("lib");
QTest::addColumn<bool>("result");
-#if defined(Q_OS_SYMBIAN)
- QString currDir;
-#else
QString currDir = QDir::currentPath();
-#endif
+
QTest::newRow( "ok00" ) << currDir + "/mylib" << true;
QTest::newRow( "notexist" ) << currDir + "/nolib" << false;
QTest::newRow( "badlibrary" ) << currDir + "/qlibrary.pro" << false;
QTest::newRow("ok (libmylib ver. 1)") << currDir + "/libmylib" <<true;
#endif
-# if defined(Q_OS_WIN32) || defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
+# if defined(Q_OS_WIN32) || defined(Q_OS_WINCE)
QTest::newRow( "ok01 (with suffix)" ) << currDir + "/mylib.dll" << true;
QTest::newRow( "ok02 (with non-standard suffix)" ) << currDir + "/mylib.dl2" << true;
QTest::newRow( "ok03 (with many dots)" ) << currDir + "/system.trolltech.test.mylib.dll" << true;
QTest::addColumn<QString>("lib");
QTest::addColumn<bool>("result");
-#if defined(Q_OS_SYMBIAN)
- QString currDir;
-#else
QString currDir = QDir::currentPath();
-#endif
QTest::newRow( "mylib" ) << currDir + "/mylib" << true;
#ifdef Q_WS_MAC
void tst_QLibrary::unload_after_implicit_load()
{
-#if defined(Q_OS_SYMBIAN)
- QSKIP("SYMBIAN does not support symbols on non-STDDLL libraries.", SkipAll);
-#endif
-
QLibrary library( "./mylib" );
QFunctionPointer p = library.resolve("mylibversion");
QVERIFY(p); // Check if it was loaded
QVERIFY(library.isLoaded());
QVERIFY(library.unload());
QCOMPARE(library.isLoaded(), false);
-
}
void tst_QLibrary::resolve_data()
QTest::addColumn<QString>("symbol");
QTest::addColumn<bool>("goodPointer");
-#if defined(Q_OS_SYMBIAN)
- QString currDir;
-#else
QString currDir = QDir::currentPath();
-#endif
QTest::newRow( "ok00" ) << currDir + "/mylib" << QString("mylibversion") << true;
QTest::newRow( "bad00" ) << currDir + "/mylib" << QString("nosym") << false;
void tst_QLibrary::resolve()
{
-#if defined(Q_OS_SYMBIAN)
- QSKIP("SYMBIAN does not support symbols on non-STDDLL libraries.", SkipAll);
-#endif
-
typedef int (*testFunc)();
QFETCH( QString, lib );
QFETCH( QString, symbol );
QTest::newRow("good (libmylib.so.1.0.0)") << QString("libmylib.so.1.0.0") << true;
QTest::newRow("bad (libmylib.1.0.0.foo)") << QString("libmylib.1.0.0.foo") << false;
-#elif defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
+#elif defined(Q_OS_WIN)
QTest::newRow("good (with many dots)" ) << "/system.trolltech.test.mylib.dll" << true;
#endif
}
QTest::addColumn<bool>("success");
QTest::addColumn<QString>("errorString");
-#if defined(Q_OS_SYMBIAN)
- QString currDir;
-#else
QString currDir = QDir::currentPath();
QString srcDir = SRCDIR;
if (srcDir.isEmpty())
srcDir = currDir;
-#endif
QTest::newRow("bad load()") << (int)Load << QString("nosuchlib") << false << QString("Cannot load library nosuchlib: .*");
QTest::newRow("call errorString() on QLibrary with no d-pointer (crashtest)") << (int)(Load | DontSetFileName) << QString() << false << QString("Unknown error");
QTest::newRow("bad load() with .dll suffix") << (int)Load << QString("nosuchlib.dll") << false << QString("Cannot load library nosuchlib.dll: The specified module could not be found.");
// QTest::newRow("bad unload") << (int)Unload << QString("nosuchlib.dll") << false << QString("QLibrary::unload_sys: Cannot unload nosuchlib.dll (The specified module could not be found.)");
#elif defined Q_OS_MAC
-#elif defined Q_OS_SYMBIAN
- QTest::newRow("load invalid file") << (int)Load << "tst_qlibrary.exe" << false << QString("Cannot load library.*");
#else
QTest::newRow("load invalid file") << (int)Load << srcDir + "/library_path/invalid.so" << false << QString("Cannot load library.*");
#endif
QFETCH(bool, success);
QFETCH(QString, errorString);
-#if defined(Q_OS_SYMBIAN)
- if ( success )
- {
- QSKIP("SYMBIAN does not support symbols on non-STDDLL libraries.", SkipSingle );
- }
-#endif
-
QLibrary lib;
if (!(operation & DontSetFileName)) {
lib.setFileName(fileName);
}
#endif
-#if defined(Q_OS_SYMBIAN)
- QString currDir;
-#else
QString currDir = QDir::currentPath();
-#endif
lh |= QLibrary::ResolveAllSymbolsHint;
-# if defined(Q_OS_WIN32) || defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
+# if defined(Q_OS_WIN32) || defined(Q_OS_WINCE)
QTest::newRow( "ok01 (with suffix)" ) << currDir + "/mylib.dll" << int(lh) << true;
QTest::newRow( "ok02 (with non-standard suffix)" ) << currDir + "/mylib.dl2" << int(lh) << true;
QTest::newRow( "ok03 (with many dots)" ) << currDir + "/system.trolltech.test.mylib.dll" << int(lh) << true;
}
QVERIFY(ok);
-#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
+#if defined(Q_OS_WIN)
QCOMPARE(lib.fileName().toLower(), expectedFilename.toLower());
#else
QCOMPARE(lib.fileName(), expectedFilename);
void tst_QLibrary::multipleInstancesForOneLibrary()
{
-#if defined(Q_OS_SYMBIAN)
- QString lib = "/mylib";
-#else
QString lib = QDir::currentPath() + "/mylib";
-#endif
{
QLibrary lib1(lib);
SOURCES = main.cpp
QT = core
DESTDIR = ../plugins
-
-symbian: {
- TARGET.EPOCALLOWDLLDATA=1
- TARGET.CAPABILITY=ALL -TCB
-}
SOURCES = main.cpp
QT = core
DESTDIR = ../plugins
-
-symbian: {
- TARGET.EPOCALLOWDLLDATA=1
- TARGET.CAPABILITY=ALL -TCB
-}
plugins.path = plugins
DEPLOYMENT += plugins
}
-
-symbian: {
- rpDep.files = releaseplugin.dll debugplugin.dll
- rpDep.path = plugins
- DEPLOYMENT += rpDep dpDep
-}
#no special install rule for the library used by test
INSTALLS =
-
-symbian: {
- TARGET.CAPABILITY=ALL -TCB
-}
-
SUBDIRS = lib \
theplugin \
tst
-!win32: !macx-*: !symbian: SUBDIRS += almostplugin
+!win32: !macx-*: SUBDIRS += almostplugin
TARGET = tst_qpluginloader
# no special install rule for subdir
SOURCES = theplugin.cpp
TARGET = $$qtLibraryTarget(theplugin)
DESTDIR = ../bin
-
-symbian: {
- TARGET.EPOCALLOWDLLDATA=1
- TARGET.CAPABILITY=ALL -TCB
-}
DEPLOYMENT += addFiles
}
-symbian: {
- libDep.files = tst_qpluginloaderlib.dll
- libDep.path = /sys/bin
- pluginDep.files = theplugin.dll
- pluginDep.path = bin
-
- DEPLOYMENT += libDep pluginDep
-}
-
DEFINES += SRCDIR=\\\"$$PWD/../\\\"
mac*:CONFIG+=insignificant_test
# endif
# define PREFIX ""
-#elif defined(Q_OS_SYMBIAN)
-# undef dll_VALID
-# define dll_VALID true
-# define SUFFIX ".dll"
-# define PREFIX ""
-
#else // all other Unix
# undef so_VALID
# define so_VALID true
void errorString();
void loadHints();
void deleteinstanceOnUnload();
- void checkingStubsFromDifferentDrives();
void loadDebugObj();
void loadCorruptElf();
void loadGarbage();
QVERIFY(loader.errorString() != unknown);
}
-#if !defined Q_OS_WIN && !defined Q_OS_MAC && !defined Q_OS_HPUX && !defined Q_OS_SYMBIAN
+#if !defined Q_OS_WIN && !defined Q_OS_MAC && !defined Q_OS_HPUX
{
QPluginLoader loader( sys_qualifiedLibraryName("almostplugin")); //a plugin with unresolved symbols
loader.setLoadHints(QLibrary::ResolveAllSymbolsHint);
}
}
-void tst_QPluginLoader::checkingStubsFromDifferentDrives()
-{
-#if defined(Q_OS_SYMBIAN)
-
- // This test needs C-drive + some additional drive (driveForStubs)
-
- const QString driveForStubs("E:/");// != "C:/"
- const QString stubDir("system/temp/stubtest/");
- const QString stubName("dummyStub.qtplugin");
- const QString fullStubFileName(stubDir + stubName);
- QDir dir(driveForStubs);
- bool test1(false); bool test2(false);
-
- // initial clean up
- QFile::remove(driveForStubs + fullStubFileName);
- dir.rmdir(driveForStubs + stubDir);
-
- // create a stub dir and do stub drive check
- if (!dir.mkpath(stubDir))
- QSKIP("Required drive not available for this test", SkipSingle);
-
- {// test without stub, should not be found
- QPluginLoader loader("C:/" + fullStubFileName);
- test1 = !loader.fileName().length();
- }
-
- // create a stub to defined drive
- QFile tempFile(driveForStubs + fullStubFileName);
- tempFile.open(QIODevice::ReadWrite);
- QFileInfo fileInfo(tempFile);
-
- {// now should be found even tried to find from C:
- QPluginLoader loader("C:/" + fullStubFileName);
- test2 = (loader.fileName() == fileInfo.absoluteFilePath());
- }
-
- // clean up
- tempFile.close();
- if (!QFile::remove(driveForStubs + fullStubFileName))
- QWARN("Could not remove stub file");
- if (!dir.rmdir(driveForStubs + stubDir))
- QWARN("Could not remove stub directory");
-
- // test after cleanup
- QVERIFY(test1);
- QVERIFY(test2);
-
-#endif//Q_OS_SYMBIAN
-}
-
void tst_QPluginLoader::loadDebugObj()
{
#if defined (__ELF__)
void tst_QPluginLoader::loadGarbage()
{
-#if defined (Q_OS_UNIX) && !defined(Q_OS_SYMBIAN)
+#if defined (Q_OS_UNIX)
for (int i=0; i<5; i++) {
QPluginLoader lib(QString(SRCDIR "elftest/garbage%1.so").arg(i));
QCOMPARE(lib.load(), false);
DEPLOYMENT += addFile_processUniqueness
}
-
-symbian {
- binDep.files = testProcessUniqueness.exe
- binDep.path = \\sys\\bin
-
- DEPLOYMENT += binDep
-}
load(qttest_p4)
SOURCES += tst_qthread.cpp
QT = core
-symbian:LIBS += -llibpthread
CONFIG += parallel_test
typedef void (*FunctionPointer)(void *);
void noop(void*) { }
-#ifdef Q_OS_SYMBIAN
-typedef RThread ThreadHandle;
-#elif defined Q_OS_UNIX
+#if defined Q_OS_UNIX
typedef pthread_t ThreadHandle;
#elif defined Q_OS_WIN
typedef HANDLE ThreadHandle;
protected:
static void *runUnix(void *data);
static unsigned WIN_FIX_STDCALL runWin(void *data);
- static int runSymbian(void *data);
FunctionPointer functionPointer;
void *data;
{
this->functionPointer = functionPointer;
this->data = data;
-#ifdef Q_OS_SYMBIAN
- qt_symbian_throwIfError(nativeThreadHandle.Create(KNullDesC(), NativeThreadWrapper::runSymbian, 1024, &User::Allocator(), this));
- nativeThreadHandle.Resume();
-#elif defined Q_OS_UNIX
+#if defined Q_OS_UNIX
const int state = pthread_create(&nativeThreadHandle, 0, NativeThreadWrapper::runUnix, this);
Q_UNUSED(state);
#elif defined(Q_OS_WINCE)
void NativeThreadWrapper::join()
{
-#ifdef Q_OS_SYMBIAN
- TRequestStatus stat;
- nativeThreadHandle.Logon(stat);
- User::WaitForRequest(stat);
- nativeThreadHandle.Close();
-#elif defined Q_OS_UNIX
+#if defined Q_OS_UNIX
pthread_join(nativeThreadHandle, 0);
#elif defined Q_OS_WIN
WaitForSingleObject(nativeThreadHandle, INFINITE);
return 0;
}
-int NativeThreadWrapper::runSymbian(void *data)
-{
- runUnix(data);
- return 0;
-}
-
void NativeThreadWrapper::stop()
{
QMutexLocker lock(&mutex);
// need to test lots of threads, so that we exceed MAXIMUM_WAIT_OBJECTS in qt_adopted_thread_watcher()
const int numThreads = 200;
# endif
-#elif defined(Q_OS_SYMBIAN)
- // stress the monitoring thread's add function
- const int numThreads = 100;
#else
const int numThreads = 5;
#endif
void tst_QThreadOnce::multipleThreads()
{
-#if defined(Q_OS_WINCE) || defined(Q_OS_VXWORKS) || defined(Q_OS_SYMBIAN)
+#if defined(Q_OS_WINCE) || defined(Q_OS_VXWORKS)
const int NumberOfThreads = 20;
#else
const int NumberOfThreads = 100;
load(qttest_p4)
SOURCES += tst_qthreadstorage.cpp
QT = core
-symbian:LIBS += -llibpthread
#include <qthread.h>
#include <qwaitcondition.h>
-#if defined(Q_OS_SYMBIAN)
-// Symbian Open C has a bug that causes very short waits to fail sometimes
-#define COND_WAIT_TIME 50
-#else
#define COND_WAIT_TIME 1
-#endif
-
//TESTED_CLASS=
//TESTED_FILES=
thread[x].readWriteLock.lockForRead();
thread[x].start();
// wait for thread to start
-#if defined(Q_OS_SYMBIAN) && defined(Q_CC_WINSCW)
- // Symbian emulator startup simultaneously with this thread causes additional delay
- QVERIFY(thread[x].cond.wait(&thread[x].readWriteLock, 10000));
-#else
QVERIFY(thread[x].cond.wait(&thread[x].readWriteLock, 1000));
-#endif
thread[x].readWriteLock.unlock();
}
QT = core core-private
-wince*|symbian {
+wince* {
addFile.files = rfc3252.txt
addFile.path = .
DEPLOYMENT += addFile
wince* {
DEFINES += SRCDIR=\\\"./\\\"
-} else:symbian {
- TARGET.EPOCHEAPSIZE="0x100 0x800000"
} else {
DEFINES += SRCDIR=\\\"$$PWD/\\\"
}
//TESTED_CLASS=
//TESTED_FILES=
-#if defined(Q_OS_SYMBIAN)
-#define SRCDIR ""
-#endif
-
class tst_QByteArray : public QObject
{
Q_OBJECT
QT = core core-private
-wince*|symbian: {
-deploy.files += NormalizationTest.txt
-DEPLOYMENT += deploy
+wince*: {
+ deploy.files += NormalizationTest.txt
+ DEPLOYMENT += deploy
}
-symbian: {
- DEFINES += SRCDIR=""
-} else {
- DEFINES += SRCDIR=\\\"$$PWD/\\\"
-}
+DEFINES += SRCDIR=\\\"$$PWD/\\\"
+
CONFIG += parallel_test
SOURCES += tst_qcryptographichash.cpp
QT = core
-symbian: {
-TARGET.EPOCSTACKSIZE =0x5000
-TARGET.EPOCHEAPSIZE="0x100000 0x1000000" # // Min 1Mb, max 16Mb
-}
CONFIG += parallel_test
SOURCES += tst_qelapsedtimer.cpp
wince* {
DEFINES += SRCDIR=\\\"\\\"
-} else:symbian {
- # do not define SRCDIR at all
- TARGET.EPOCHEAPSIZE = 0x100000 0x3000000
} else {
DEFINES += SRCDIR=\\\"$$PWD/\\\"
}
SOURCES += tst_qhash.cpp
QT = core
-symbian: {
-TARGET.EPOCSTACKSIZE =0x5000
-TARGET.EPOCHEAPSIZE="0x100000 0x1000000" # // Min 1Mb, max 16Mb
-}
CONFIG += parallel_test
// this test should be incredibly slow if rehash() is quadratic
for (int j = 0; j < 5; ++j) {
QHash<int, int> testHash;
-#if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN) // mobiles do not have infinite mem...
+#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)
load(qttest_p4)
QT -= gui
SOURCES += tst_qline.cpp
-unix:!mac:!symbian:!vxworks:LIBS+=-lm
-
+unix:!mac:!vxworks:LIBS+=-lm
CONFIG += parallel_test
addFiles.path = "\\Program Files\\tst_qlocale"
DEPLOYMENT += addFiles
}
-
-symbian:contains(S60_VERSION,3.2) {
- # This test case compilation crashes on 3.2 for gcce if paging is on
- MMP_RULES -= PAGED
- custom_paged_rule = "$${LITERAL_HASH}ifndef GCCE"\
- "PAGED" \
- "$${LITERAL_HASH}endif"
- MMP_RULES += custom_paged_rule
-}
-
-symbian: INCLUDEPATH *= $$MW_LAYER_SYSTEMINCLUDE # Needed for e32svr.h in S^3 envs
# include <stdlib.h>
#endif
-#if defined(Q_OS_SYMBIAN)
-# include <e32std.h>
-# include <private/qcore_symbian_p.h>
-#endif
-
Q_DECLARE_METATYPE(qlonglong)
Q_DECLARE_METATYPE(QDate)
Q_DECLARE_METATYPE(QLocale::FormatType)
void queryDateTime();
void queryMeasureSystem_data();
void queryMeasureSystem();
-#if defined(Q_OS_SYMBIAN)
- void symbianSystemLocale();
-#endif
void ampm();
void currency();
void tst_QLocale::emptyCtor()
{
-#if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
- QSKIP("Uses unsupported Windows CE / Symbian QProcess functionality (std streams, env)", SkipAll);
+#if defined(Q_OS_WINCE)
+ QSKIP("Uses unsupported Windows CE QProcess functionality (std streams, env)", SkipAll);
#endif
#if defined(QT_NO_PROCESS)
QSKIP("Qt was compiled with QT_NO_PROCESS", SkipAll);
// Theoretically, we could include HPUX in this test, but its setenv implementation
// stinks. It's called putenv, and it requires you to keep the variable you pass
// to it around forever.
-#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC) && !defined(Q_OS_SYMBIAN)
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
QFETCH(QString, lcAllLocale);
QFETCH(QString, lcMeasurementLocale);
QFETCH(QString, langLocale);
qputenv("LC_MEASUREMENT", oldLcMeasurement.toLocal8Bit());
qputenv("LANG", oldLang.toLocal8Bit());
#else
- QSKIP("Test doesn't work on Mac, Windows or Symbian", SkipAll);
+ QSKIP("Test doesn't work on Mac or Windows", SkipAll);
#endif
}
// Theoretically, we could include HPUX in this test, but its setenv implementation
// stinks. It's called putenv, and it requires you to keep the variable you pass
// to it around forever.
-#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC) && !defined(Q_OS_SYMBIAN)
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
QFETCH(QString, lcAllLocale);
QFETCH(QString, lcMeasurementLocale);
QFETCH(QString, langLocale);
qputenv("LC_MEASUREMENT", oldLcMeasurement.toLocal8Bit());
qputenv("LANG", oldLang.toLocal8Bit());
#else
- QSKIP("Test doesn't work on Mac, Windows or Symbian", SkipAll);
+ QSKIP("Test doesn't work on Mac or Windows", SkipAll);
#endif
}
#endif // QT_NO_SYSTEMLOCALE
QCOMPARE(ru.standaloneMonthName(1, QLocale::NarrowFormat), QString::fromUtf8("\320\257"));
}
-#if defined(Q_OS_SYMBIAN)
-void tst_QLocale::symbianSystemLocale()
-{
-# if defined(__SERIES60_31__)
- QSKIP("S60 3.1 doesn't support system format properly", SkipAll);
-# else
- // Simple test to verify that Symbian system locale works at all
- const QSystemLocale locale;
- TExtendedLocale s60Locale;
- s60Locale.LoadSystemSettings();
-
- TTime s60Date(_L("20090117:")); // Symbian offsets day and month from zero
- QDate date(2009,2,18);
-
- TPtrC s60DateFormat = s60Locale.GetShortDateFormatSpec();
- QString dateFormat = locale.query(QSystemLocale::DateFormatShort, QVariant()).toString();
-
- TBuf<50> s60FormattedDate;
- TRAPD(err, s60Date.FormatL(s60FormattedDate, s60DateFormat));
- QVERIFY(err == KErrNone);
- QString s60FinalResult = qt_TDesC2QString(s60FormattedDate);
- QString finalResult = date.toString(dateFormat);
-
- QCOMPARE(finalResult, s60FinalResult);
-# endif
-}
-#endif
-
void tst_QLocale::currency()
{
const QLocale c(QLocale::C);
{
// this test should take an extreme amount of time if QRegExp is broken
QRegExp original(email);
-#if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
+#if defined(Q_OS_WINCE)
for (int i = 0; i < 100; ++i) {
#else
for (int i = 0; i < 100000; ++i) {
str += "abbbdekcz";
int x;
-#if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
+#if defined(Q_OS_WINCE)
for (int j = 0; j < 100; ++j) {
#else
for (int j = 0; j < 10000; ++j) {
SOURCES += tst_qset.cpp
QT = core
-symbian: {
-TARGET.EPOCSTACKSIZE =0x5000
-TARGET.EPOCHEAPSIZE="0x100000 0x1000000" # // Min 1Mb, max 16Mb
-}
CONFIG += parallel_test
#include <QtCore/QDateTime>
#include <QtCore/QDebug>
-#ifdef Q_OS_SYMBIAN
-#define DEFAULT_MAKESPEC "X:/STLsupport/mkspecs/symbian-abld/"
-#endif
-
#ifndef DEFAULT_MAKESPEC
# error DEFAULT_MAKESPEC not defined
#endif
SOURCES += $$PWD/externaltests.cpp
HEADERS += $$PWD/externaltests.h
cleanedQMAKESPEC = $$replace(QMAKESPEC, \\\\, /)
-!symbian:DEFINES += DEFAULT_MAKESPEC=\\\"$$cleanedQMAKESPEC\\\"
+DEFINES += DEFAULT_MAKESPEC=\\\"$$cleanedQMAKESPEC\\\"
embedded:DEFINES += QTEST_NO_RTTI QTEST_CROSS_COMPILED
wince*:DEFINES += QTEST_CROSS_COMPILED QTEST_NO_RTTI
-symbian: DEFINES += QTEST_CROSS_COMPILED
wrapper.h
QT = core
-!symbian:DEFINES += SRCDIR=\\\"$$PWD/\\\"
+DEFINES += SRCDIR=\\\"$$PWD/\\\"
include(externaltests.pri)
CONFIG += parallel_test
}
QT_END_NAMESPACE
-#ifdef Q_OS_SYMBIAN
-#define SRCDIR "."
-#endif
-
class tst_QSharedPointer: public QObject
{
Q_OBJECT
load(qttest_p4)
SOURCES += tst_qstring.cpp
-symbian:LIBS += -llibm
-
QT = core
DEFINES += QT_NO_CAST_TO_ASCII
void tst_QString::localeAwareCompare()
{
-#ifdef Q_OS_SYMBIAN
- QSKIP("QTBUG-16921: There is no way to set up the system locale, so this test is not reliable in Symbian.");
-#else
#ifdef Q_OS_WIN
# ifndef Q_OS_WINCE
QSKIP("On others than Win CE, we cannot set the system or user locale.", SkipAll);
if (!locale.isEmpty())
setlocale(LC_ALL, "");
#endif
-#endif // Q_OS_SYMBIAN
}
void tst_QString::split_data()
QT = core
HEADERS +=
SOURCES += tst_qtextboundaryfinder.cpp
-!symbian:*:DEFINES += SRCDIR=\\\"$$PWD\\\"
+DEFINES += SRCDIR=\\\"$$PWD\\\"
-wince*|symbian:{
+wince* {
addFiles.files = data
addFiles.path = .
DEPLOYMENT += addFiles
//TESTED_CLASS=
//TESTED_FILES=gui/text/qtextlayout.h corelib/tools/qtextboundaryfinder.cpp
-#ifdef Q_OS_SYMBIAN
-#define SRCDIR "$$PWD"
-#endif
class tst_QTextBoundaryFinder : public QObject
{
QT = core xml network
-
-wince*|symbian: {
- addFiles.files = data XML-Test-Suite
- addFiles.path = .
- DEPLOYMENT += addFiles
- wince*:DEFINES += SRCDIR=\\\"\\\"
+wince* {
+ addFiles.files = data XML-Test-Suite
+ addFiles.path = .
+ DEPLOYMENT += addFiles
+ wince*:DEFINES += SRCDIR=\\\"\\\"
} else {
DEFINES += SRCDIR=\\\"$$PWD/\\\"
}
//TESTED_CLASS=QXmlStreamReader QXmlStreamWriter
//TESTED_FILES=corelib/xml/stream/qxmlutils.cpp corelib/xml/stream/qxmlstream.cpp corelib/xml/stream/qxmlstream_p.h
-#ifdef Q_OS_SYMBIAN
-#define SRCDIR ""
-#endif
-
Q_DECLARE_METATYPE(QXmlStreamReader::ReadElementTextBehaviour)
static const char *const catalogFile = SRCDIR "XML-Test-Suite/xmlconf/finalCatalog.xml";
}
// here, we should have received on non-throwing event and one throwing one
QCOMPARE(obj.throwEventCount, 3);
-#ifndef __SYMBIAN32__
- // symbian event loops will have absorbed the exceptions
QCOMPARE(obj.noThrowEventCount, 1);
-#endif
// spin the event loop again
qApp->processEvents();
**
****************************************************************************/
-#ifndef Q_OS_SYMBIAN
#include <malloc.h>
-#endif
#include <limits.h>
#include <stdio.h>
#include <exception>
-#if !defined(Q_OS_WIN) && !defined(Q_OS_SYMBIAN)
+#if !defined(Q_OS_WIN)
# include "3rdparty/memcheck.h"
#endif
} crtDebugRegistrator;
-#elif defined(Q_OS_SYMBIAN)
-
-struct QAllocFailAllocator : public RAllocator
-{
- QAllocFailAllocator() : allocator(User::Allocator())
- {
- User::SwitchAllocator(this);
- }
-
- ~QAllocFailAllocator()
- {
- User::SwitchAllocator(&allocator);
- }
-
- RAllocator& allocator;
-
- // from MAllocator
- TAny* Alloc(TInt aSize)
- {
- ++mallocCount;
- if (mallocFailActive && --mallocFailIndex < 0)
- return 0; // simulate OOM
- return allocator.Alloc(aSize);
- }
-
- void Free(TAny* aPtr)
- {
- allocator.Free(aPtr);
- }
-
- TAny* ReAlloc(TAny* aPtr, TInt aSize, TInt aMode)
- {
- ++mallocCount;
- if (mallocFailActive && --mallocFailIndex < 0)
- return 0; // simulate OOM
- return allocator.ReAlloc(aPtr, aSize, aMode);
- }
-
- TInt AllocLen(const TAny* aCell) const
- {
- return allocator.AllocLen(aCell);
- }
-
- TInt Compress()
- {
- return allocator.Compress();
- }
-
- void Reset()
- {
- allocator.Reset();
- }
-
- TInt AllocSize(TInt& aTotalAllocSize) const
- {
- return allocator.AllocSize(aTotalAllocSize);
- }
-
- TInt Available(TInt& aBiggestBlock) const
- {
- return allocator.Available(aBiggestBlock);
- }
-
- TInt DebugFunction(TInt aFunc, TAny* a1, TAny* a2)
- {
- return allocator.DebugFunction(aFunc, a1, a2);
- }
-
- TInt Extension_(TUint aExtensionId, TAny*& a0, TAny* a1)
- {
- return ((MAllocator&)allocator).Extension_(aExtensionId, a0, a1);
- }
-};
-
-QAllocFailAllocator symbianTestAllocator;
-
#endif
struct AllocFailer
}
};
-#ifndef Q_OS_SYMBIAN
-
static void *new_helper(std::size_t size)
{
void *ptr = malloc(size);
# pragma warning(pop)
#endif
-#endif
-
// ignore placement new and placement delete - those don't allocate.
// this test only works with
// * GLIBC
// * MSVC - only debug builds (we need the crtdbg.h helpers)
-// * SYMBIAN
-#if (defined(QT_NO_EXCEPTIONS) || (!defined(__GLIBC__) && !defined(Q_CC_MSVC) && !defined(Q_OS_SYMBIAN))) && !defined(Q_MOC_RUN)
+#if (defined(QT_NO_EXCEPTIONS) || (!defined(__GLIBC__) && !defined(Q_CC_MSVC))) && !defined(Q_MOC_RUN)
QTEST_NOOP_MAIN
#else
#include "oomsimulator.h"
-#if !defined(Q_OS_SYMBIAN)
#include "3rdparty/memcheck.h"
-#endif
class tst_ExceptionSafety_Objects: public QObject
{
free(buf);
QVERIFY(!buf2);
-#ifdef Q_OS_SYMBIAN
- // temporary workaround for INC138398
- std::new_handler nh_func = std::set_new_handler(0);
- (void) std::set_new_handler(nh_func);
-#endif
-
ObjectCreator<SelfTestObject> *selfTest = new ObjectCreator<SelfTestObject>;
doOOMTest(*selfTest, 0);
delete selfTest;
};
void tst_ExceptionSafety_Objects::widgets_data()
{
-#ifdef Q_OS_SYMBIAN
- // Initialise the S60 rasteriser, which crashes if started while out of memory
- QImage image(20, 20, QImage::Format_RGB32);
- QPainter p(&image);
- p.drawText(0, 15, "foo");
-#endif
-
QTest::addColumn<AbstractTester *>("widgetCreator");
#undef NEWROW
qtipc \
qtoolbar \
-symbian:SUBDIRS -= \
- qsystemtrayicon \
-
}
addPlugins.path = imageformats
DEPLOYMENT += addFiles addPlugins
-} else:symbian {
- addFiles.files = icons
- addFiles.path = .
- DEPLOYMENT += addFiles
- qt_not_deployed {
- addPlugins.files = qico.dll
- addPlugins.path = imageformats
- DEPLOYMENT += addPlugins
- }
- TARGET.UID3 = 0xE0340004
- DEFINES += SYMBIAN_SRCDIR_UID=$$lower($$replace(TARGET.UID3,"0x",""))
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
#include <QtGui>
#include <QtCore>
-#if defined(Q_OS_SYMBIAN)
-# define STRINGIFY(x) #x
-# define TOSTRING(x) STRINGIFY(x)
-# define SRCDIR "C:/Private/" TOSTRING(SYMBIAN_SRCDIR_UID) "/"
-#endif
-
class tst_QIcoImageFormat : public QObject
{
Q_OBJECT
DEPLOYMENT_PLUGIN += qsvg
DEFINES += SRCDIR=\\\".\\\"
-} else:symbian {
- QT += xml svg
- addFiles.files = *.png tst_qicon.cpp *.svg *.svgz
- addFiles.path = .
- DEPLOYMENT += addFiles
- qt_not_deployed {
- plugins.files = qsvgicon.dll
- plugins.path = iconengines
- DEPLOYMENT += plugins
- }
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
#include <QtTest/QtTest>
#include <QImageReader>
#include <qicon.h>
-
-#if defined(Q_OS_SYMBIAN)
-#define SRCDIR "."
-#endif
#include <qiconengine.h>
Q_DECLARE_METATYPE(QSize)
addImages.path = images
DEPLOYMENT += addImages
DEFINES += SRCDIR=\\\".\\\"
-} else:symbian {
- TARGET.EPOCHEAPSIZE = 0x200000 0x800000
- addImages.files = images/*
- addImages.path = images
- DEPLOYMENT += addImages
- qt_not_deployed {
- imagePlugins.files = qjpeg.dll qgif.dll qmng.dll qtiff.dll qico.dll
- imagePlugins.path = imageformats
- DEPLOYMENT += imagePlugins
- }
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
//TESTED_CLASS=
//TESTED_FILES=
-#if defined(Q_OS_SYMBIAN)
-# define SRCDIR ""
-#endif
Q_DECLARE_METATYPE(QImage::Format)
Q_DECLARE_METATYPE(Qt::GlobalColor)
{
QTest::addColumn<QString>("testFormat");
QTest::addColumn<QString>("testFile");
- #ifdef Q_OS_SYMBIAN
- const QString prefix = QLatin1String(SRCDIR) + "images/";
- #else
const QString prefix = QLatin1String(SRCDIR) + "/images/";
- #endif
// add a new line here when a file is added
QTest::newRow("ICO") << "ICO" << prefix + "image.ico";
{
#if defined(Q_OS_WINCE)
int bigValue = 2000;
-#elif defined(Q_OS_SYMBIAN)
- int bigValue = 2000;
#else
int bigValue = 200000;
#endif
MOC_DIR=tmp
QT += widgets widgets-private core-private gui-private network
RESOURCES += qimagereader.qrc
-!symbian:DEFINES += SRCDIR=\\\"$$PWD\\\"
+DEFINES += SRCDIR=\\\"$$PWD\\\"
win32-msvc:QMAKE_CXXFLAGS -= -Zm200
win32-msvc:QMAKE_CXXFLAGS += -Zm800
DEPLOYMENT += images imagePlugins
DEFINES += SRCDIR=\\\".\\\"
}
-
-symbian: {
- images.files = images
- images.path = .
-
- DEPLOYMENT += images
-
- qt_not_deployed {
- imagePlugins.files = qjpeg.dll qgif.dll qmng.dll
- imagePlugins.path = imageformats
-
- DEPLOYMENT += imagePlugins
- }
-}
#include "../../../platformquirks.h"
-#if defined(Q_OS_SYMBIAN)
-# define SRCDIR "."
-#endif
-
typedef QMap<QString, QString> QStringMap;
typedef QList<int> QIntList;
Q_DECLARE_METATYPE(QImage)
QCOMPARE(image1, expectedImage);
}
-#if defined (Q_OS_SYMBIAN) && defined (__WINS__)
- //the emulator hangs in socket write (this is a test bug, it assumes the TCP stack can accept a whole image to its buffers)
- if(imageData.size() > 16384)
- QSKIP("image larger than socket buffer (test needs to be rewritten)", SkipSingle);
-#endif
Server server(imageData);
QEventLoop loop;
connect(&server, SIGNAL(ready()), &loop, SLOT(quit()));
addFiles.path = images
DEPLOYMENT += addFiles
DEFINES += SRCDIR=\\\".\\\"
-} else:symbian {
- addFiles.files = images\\*.*
- addFiles.path = images
- DEPLOYMENT += addFiles
- qt_not_deployed {
- imagePlugins.files = qjpeg.dll qtiff.dll
- imagePlugins.path = imageformats
- DEPLOYMENT += imagePlugins
- }
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
#include <QPainter>
#include <QSet>
-#if defined(Q_OS_SYMBIAN)
-# define SRCDIR ""
-#endif
typedef QMap<QString, QString> QStringMap;
typedef QList<int> QIntList;
Q_DECLARE_METATYPE(QImage)
void saveToTemporaryFile();
};
-#ifdef Q_OS_SYMBIAN
-static const QLatin1String prefix(SRCDIR "images/");
-#else
+
static const QLatin1String prefix(SRCDIR "/images/");
-#endif
+
static void initializePadding(QImage *image)
{
int effectiveBytesPerLine = (image->width() * image->depth() + 7) / 8;
#if defined QTEST_HAVE_TIFF
void tst_QImageWriter::largeTiff()
{
-#if !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN)
+#if !defined(Q_OS_WINCE)
QImage img(4096, 2048, QImage::Format_ARGB32);
QPainter p(&img);
QCOMPARE(img, img2);
#else
- QWARN("not tested on Symbian/WinCE");
+ QWARN("not tested on WinCE");
#endif
}
#endif
RESOURCES += resources.qrc
-symbian: {
- addFiles.files = animations\\*
- addFiles.path = animations
- DEPLOYMENT += addFiles
-
- qt_not_deployed {
- imagePlugins.files = qjpeg.dll qgif.dll qmng.dll
- imagePlugins.path = imageformats
- DEPLOYMENT += imagePlugins
- }
-}
QT += core-private gui-private widgets widgets-private
SOURCES += tst_qpixmap.cpp
-wince*|symbian: {
-
+wince* {
task31722_0.files = convertFromImage/task31722_0/*.png
task31722_0.path = convertFromImage/task31722_0
loadFromData.path = loadFromData
DEPLOYMENT += task31722_0 task31722_1 icons loadFromData
-}
-
-wince*: {
DEFINES += SRCDIR=\\\".\\\"
DEPLOYMENT_PLUGIN += qico
-} else:symbian {
- LIBS += -lfbscli.dll -lbitgdi.dll -lgdi.dll
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
win32:LIBS += -lgdi32 -luser32
#include <qscreen_qws.h>
#endif
-#ifdef Q_OS_SYMBIAN
-#include <e32std.h>
-#include <fbs.h>
-#include <gdi.h>
-#include <bitdev.h>
-#if !defined(QT_NO_OPENVG)
-#include <QtOpenVG/qvg.h>
-#include <QtOpenVG/private/qpixmapdata_vg_p.h>
-#endif
-#endif
-
#ifdef Q_WS_X11
#include <QX11Info>
#endif
//TESTED_CLASS=
//TESTED_FILES=
-#if defined(Q_OS_SYMBIAN)
-# define SRCDIR ""
-#endif
+
Q_DECLARE_METATYPE(QImage::Format)
class tst_QPixmap : public QObject
void fromWinHICON();
#endif
-#if defined(Q_OS_SYMBIAN)
- void fromSymbianCFbsBitmap_data();
- void fromSymbianCFbsBitmap();
- void toSymbianCFbsBitmap_data();
- void toSymbianCFbsBitmap();
-#endif
-
void onlyNullPixmapsOutsideGuiThread();
void refUnref();
void loadAsBitmapOrPixmap();
-#if defined(Q_OS_SYMBIAN) && !defined(QT_NO_OPENVG)
- void vgImageReadBack();
-#endif
void scaled_QTBUG19157();
};
{
QTest::addColumn<QImage>("img1");
QTest::addColumn<QImage>("img2");
-#ifdef Q_OS_SYMBIAN
- const QString prefix = QLatin1String(SRCDIR) + "convertFromImage";
-#else
const QString prefix = QLatin1String(SRCDIR) + "/convertFromImage";
-#endif
+
{
QImage img1;
QImage img2;
#endif // Q_WS_WIN
-#if defined(Q_OS_SYMBIAN)
-Q_DECLARE_METATYPE(TDisplayMode)
-
-void tst_QPixmap::fromSymbianCFbsBitmap_data()
-{
- QTest::addColumn<TDisplayMode>("format");
- QTest::addColumn<int>("width");
- QTest::addColumn<int>("height");
- QTest::addColumn<QColor>("color");
-
- const int smallWidth = 20;
- const int smallHeight = 20;
- const int largeWidth = 240;
- const int largeHeight = 320;
- const int notAlignedWidth = 250;
- const int notAlignedHeight = 250;
-
- // Indexed Color Formats - Disabled since images seem to be blank -> no palette?
-// QTest::newRow("EGray2 small") << EGray2 << smallWidth << smallHeight << QColor(Qt::black);
-// QTest::newRow("EGray2 big") << EGray2 << largeWidth << largeHeight << QColor(Qt::black);
-// QTest::newRow("EGray256 small") << EGray256 << smallWidth << smallHeight << QColor(Qt::blue);
-// QTest::newRow("EGray256 big") << EGray256 << largeWidth << largeHeight << QColor(Qt::blue);
-// QTest::newRow("EColor256 small") << EColor256 << smallWidth << smallHeight << QColor(Qt::red);
-// QTest::newRow("EColor256 big") << EColor256 << largeWidth << largeHeight << QColor(Qt::red);
-
- // Direct Color Formats
- QTest::newRow("EColor4K small") << EColor4K << smallWidth << smallHeight << QColor(Qt::red);
- QTest::newRow("EColor4K big") << EColor4K << largeWidth << largeHeight << QColor(Qt::red);
- QTest::newRow("EColor4K not aligned") << EColor4K << notAlignedWidth << notAlignedHeight << QColor(Qt::red);
- QTest::newRow("EColor64K small") << EColor64K << smallWidth << smallHeight << QColor(Qt::green);
- QTest::newRow("EColor64K big") << EColor64K << largeWidth << largeHeight << QColor(Qt::green);
- QTest::newRow("EColor64K not aligned") << EColor64K << notAlignedWidth << notAlignedHeight << QColor(Qt::green);
- QTest::newRow("EColor16M small") << EColor16M << smallWidth << smallHeight << QColor(Qt::yellow);
- QTest::newRow("EColor16M big") << EColor16M << largeWidth << largeHeight << QColor(Qt::yellow);
- QTest::newRow("EColor16M not aligned") << EColor16M << notAlignedWidth << notAlignedHeight << QColor(Qt::yellow);
- QTest::newRow("EColor16MU small") << EColor16MU << smallWidth << smallHeight << QColor(Qt::red);
- QTest::newRow("EColor16MU big") << EColor16MU << largeWidth << largeHeight << QColor(Qt::red);
- QTest::newRow("EColor16MU not aligned") << EColor16MU << notAlignedWidth << notAlignedHeight << QColor(Qt::red);
- QTest::newRow("EColor16MA small opaque") << EColor16MA << smallWidth << smallHeight << QColor(255, 255, 0);
- QTest::newRow("EColor16MA big opaque") << EColor16MA << largeWidth << largeHeight << QColor(255, 255, 0);
- QTest::newRow("EColor16MA not aligned opaque") << EColor16MA << notAlignedWidth << notAlignedHeight << QColor(255, 255, 0);
-
- // Semi-transparent Colors - Disabled for now, since the QCOMPARE fails, but visually confirmed to work
-// QTest::newRow("EColor16MA small semi") << EColor16MA << smallWidth << smallHeight << QColor(255, 255, 0, 127);
-// QTest::newRow("EColor16MA big semi") << EColor16MA << largeWidth << largeHeight << QColor(255, 255, 0, 127);
-// QTest::newRow("EColor16MA small trans") << EColor16MA << smallWidth << smallHeight << QColor(255, 255, 0, 0);
-// QTest::newRow("EColor16MA big trans") << EColor16MA << largeWidth << largeHeight << QColor(255, 255, 0, 0);
-
-#if !defined(__SERIES60_31__)
- QTest::newRow("EColor16MAP small") << EColor16MAP << smallWidth << smallHeight << QColor(Qt::red);
- QTest::newRow("EColor16MAP big") << EColor16MAP << largeWidth << largeHeight << QColor(Qt::red);
-#endif
-}
-
-void tst_QPixmap::fromSymbianCFbsBitmap()
-{
- QFETCH(TDisplayMode, format);
- QFETCH(int, width);
- QFETCH(int, height);
- QFETCH(QColor, color);
- int expectedDepth = TDisplayModeUtils::NumDisplayModeBitsPerPixel(format);
-
- CFbsBitmap *nativeBitmap = 0;
- CFbsBitmapDevice *bitmapDevice = 0;
- CBitmapContext *bitmapContext = 0;
-
- nativeBitmap = new (ELeave) CFbsBitmap();
- TInt err = nativeBitmap->Create(TSize(width, height), format);
- CleanupStack::PushL(nativeBitmap);
- QVERIFY(err == KErrNone);
- bitmapDevice = CFbsBitmapDevice::NewL(nativeBitmap);
- CleanupStack::PushL(bitmapDevice);
-
- err = bitmapDevice->CreateBitmapContext(bitmapContext);
- CleanupStack::PushL(bitmapContext);
- QVERIFY(err == KErrNone);
- TRgb symbianColor = TRgb(color.red(), color.green(), color.blue(), color.alpha());
- bitmapContext->SetBrushColor(symbianColor);
- bitmapContext->Clear();
-
- __UHEAP_MARK;
- { // Test the null case
- CFbsBitmap *bitmap = 0;
- QPixmap pixmap = QPixmap::fromSymbianCFbsBitmap(bitmap);
- QVERIFY(pixmap.isNull());
- }
- __UHEAP_MARKEND;
-
- __UHEAP_MARK;
- { // Test the normal case
- QPixmap pixmap = QPixmap::fromSymbianCFbsBitmap(nativeBitmap);
-// QCOMPARE(pixmap.depth(), expectedDepth); // Depth is not preserved now
- QCOMPARE(pixmap.width(), width);
- QCOMPARE(pixmap.height(), height);
- QImage image = pixmap.toImage();
-
- QColor actualColor(image.pixel(1, 1));
- QCOMPARE(actualColor, color);
-
- QImage shouldBe(pixmap.width(), pixmap.height(), image.format());
- if (image.format() == QImage::Format_RGB16)
- shouldBe.fill(qrgb565(color.rgba()).rawValue());
- else
- shouldBe.fill(color.rgba());
- QCOMPARE(image, shouldBe);
- }
- __UHEAP_MARKEND;
-
- CleanupStack::PopAndDestroy(3);
-}
-
-void tst_QPixmap::toSymbianCFbsBitmap_data()
-{
- QTest::addColumn<int>("red");
- QTest::addColumn<int>("green");
- QTest::addColumn<int>("blue");
-
- QTest::newRow("red") << 255 << 0 << 0;
- QTest::newRow("green") << 0 << 255 << 0;
- QTest::newRow("blue") << 0 << 0 << 255;
-}
-
-void tst_QPixmap::toSymbianCFbsBitmap()
-{
- QFETCH(int, red);
- QFETCH(int, green);
- QFETCH(int, blue);
-
- QPixmap pm(100, 100);
- pm.fill(QColor(red, green, blue));
-
- CFbsBitmap *bitmap = pm.toSymbianCFbsBitmap();
-
- QVERIFY(bitmap != 0);
-
- // Verify size
- QCOMPARE(100, (int) bitmap->SizeInPixels().iWidth);
- QCOMPARE(100, (int) bitmap->SizeInPixels().iHeight);
-
- // Verify pixel color
- TRgb pixel;
- bitmap->GetPixel(pixel, TPoint(0,0));
- QCOMPARE((int)pixel.Red(), red);
- QCOMPARE((int)pixel.Green(), green);
- QCOMPARE((int)pixel.Blue(), blue);
-
- // Clean up
- delete bitmap;
-}
-#endif
-
void tst_QPixmap::onlyNullPixmapsOutsideGuiThread()
{
#ifdef Q_WS_QPA
}
};
Thread thread;
-#if defined(Q_OS_SYMBIAN)
- thread.setStackSize(0x10000);
-#endif
thread.start();
-#if defined(Q_OS_SYMBIAN)
- QVERIFY(thread.wait(10000));
-#else
thread.wait();
-#endif
-
#endif // !defined(Q_WS_WIN) && !defined(Q_WS_MAC)
}
void tst_QPixmap::loadFromDataImage_data()
{
QTest::addColumn<QString>("imagePath");
-#ifdef Q_OS_SYMBIAN
- const QString prefix = QLatin1String(SRCDIR) + "loadFromData";
-#else
+
const QString prefix = QLatin1String(SRCDIR) + "/loadFromData";
-#endif
+
QTest::newRow("designer_argb32.png") << prefix + "/designer_argb32.png";
// When no extension is provided we try all extensions that has been registered by image providers
QTest::newRow("designer_argb32") << prefix + "/designer_argb32.png";
void tst_QPixmap::fromImageReader_data()
{
QTest::addColumn<QString>("imagePath");
-#ifdef Q_OS_SYMBIAN
- const QString prefix = QLatin1String(SRCDIR) + "loadFromData";
-#else
+
const QString prefix = QLatin1String(SRCDIR) + "/loadFromData";
-#endif
+
QTest::newRow("designer_argb32.png") << prefix + "/designer_argb32.png";
QTest::newRow("designer_indexed8_no_alpha.png") << prefix + "/designer_indexed8_no_alpha.png";
QTest::newRow("designer_indexed8_with_alpha.png") << prefix + "/designer_indexed8_with_alpha.png";
void tst_QPixmap::fromImageReaderAnimatedGif()
{
QFETCH(QString, imagePath);
-#ifdef Q_OS_SYMBIAN
- const QString prefix = QLatin1String(SRCDIR) + "loadFromData";
-#else
+
const QString prefix = QLatin1String(SRCDIR) + "/loadFromData";
-#endif
const QString path = prefix + imagePath;
QImageReader referenceReader(path);
QVERIFY(first != second);
}
-#if defined(Q_OS_SYMBIAN) && !defined(QT_NO_OPENVG)
-Q_OPENVG_EXPORT VGImage qPixmapToVGImage(const QPixmap& pixmap);
-class FriendlyVGPlatformPixmap : public QVGPlatformPixmap
-{
-public:
- FriendlyVGPlatformPixmap(PixelType type) : QVGPlatformPixmap(type) { }
- bool sourceIsNull() { return source.isNull(); }
- friend QPixmap pixmapFromVGImage(VGImage image);
-};
-QPixmap pixmapFromVGImage(VGImage image)
-{
- if (image != VG_INVALID_HANDLE) {
- int w = vgGetParameteri(image, VG_IMAGE_WIDTH);
- int h = vgGetParameteri(image, VG_IMAGE_HEIGHT);
- FriendlyVGPlatformPixmap *pd = new FriendlyVGPlatformPixmap(QPlatformPixmap::PixmapType);
- pd->resize(w, h);
- pd->vgImage = image;
- pd->recreate = false;
- pd->prevSize = QSize(pd->w, pd->h);
- return QPixmap(pd);
- }
- return QPixmap();
-}
-class Content : public QWidget
-{
-public:
- void paintEvent(QPaintEvent *) {
- QPainter painter(this);
- QColor testPixel(qRgb(200, 150, 100));
- if (pm.isNull()) { // first phase: create a VGImage
- painter.beginNativePainting();
- vgimage = vgCreateImage(VG_sARGB_8888_PRE, w, h, VG_IMAGE_QUALITY_FASTER);
- QImage img(20, 10, QImage::Format_ARGB32_Premultiplied);
- img.fill(qRgb(0, 0, 0));
- QPainter p(&img);
- p.fillRect(0, 0, img.width(), img.height(), testPixel);
- p.end();
- vgImageSubData(vgimage, img.bits(), img.bytesPerLine(), VG_sARGB_8888_PRE, 0, 0, img.width(), img.height());
- // Now the area 0,0 20x10 (in OpenVG coords) is filled with some color.
- painter.endNativePainting();
- } else { // second phase: check if readback works
- painter.drawPixmap(0, 0, pm);
- // Drawing should not cause readback, this is important for performance;
- noreadback_ok = static_cast<FriendlyVGPlatformPixmap *>(pm.handle())->sourceIsNull();
- // However toImage() requires readback.
- QImage img = pm.toImage();
- readback_ok = img.width() == pm.width();
- readback_ok &= img.height() == pm.height();
- readback_ok &= !static_cast<FriendlyVGPlatformPixmap *>(pm.handle())->sourceIsNull();
- uint pix = img.pixel(1, 1);
- content_ok = qRed(pix) == testPixel.red();
- content_ok &= qGreen(pix) == testPixel.green();
- content_ok &= qBlue(pix) == testPixel.blue();
- pix = img.pixel(img.width() - 1, img.height() - 1);
- content_ok &= qRed(pix) == 0;
- content_ok &= qGreen(pix) == 0;
- content_ok &= qBlue(pix) == 0;
- }
- }
- int w;
- int h;
- VGImage vgimage;
- QPixmap pm;
- bool noreadback_ok;
- bool readback_ok;
- bool content_ok;
-};
-void tst_QPixmap::vgImageReadBack()
-{
- QPixmap tmp(10, 20);
- if (tmp.handle()->classId() == QPlatformPixmap::OpenVGClass) {
- Content c;
- c.w = 50;
- c.h = 60;
- c.vgimage = VG_INVALID_HANDLE;
- c.noreadback_ok = c.readback_ok = c.content_ok = false;
- c.showFullScreen();
- QTest::qWaitForWindowShown(&c);
- QVERIFY(c.vgimage != VG_INVALID_HANDLE);
- QPixmap pm = pixmapFromVGImage(c.vgimage);
- QVERIFY(!pm.isNull());
- QCOMPARE(pm.width(), c.w);
- QCOMPARE(pm.height(), c.h);
- QVERIFY(qPixmapToVGImage(pm) == c.vgimage);
- QVERIFY(static_cast<FriendlyVGPlatformPixmap *>(pm.handle())->sourceIsNull());
- c.pm = pm;
- // Make sure the second phase in paintEvent is executed too.
- c.hide();
- c.showFullScreen();
- QTest::qWaitForWindowShown(&c);
- QVERIFY(c.noreadback_ok);
- QVERIFY(c.readback_ok);
- QVERIFY(c.content_ok);
- } else {
- QSKIP("Not using openvg graphicssystem", SkipSingle);
- }
-}
-#endif // Symbian & OpenVG
-
void tst_QPixmap::scaled_QTBUG19157()
{
QPixmap foo(5000, 1);
QT += gui-private widgets
SOURCES += tst_qvolatileimage.cpp
-
-symbian {
- TARGET.EPOCHEAPSIZE = 0x200000 0x800000
- LIBS += -lfbscli
-}
#include <QtGui/qpainter.h>
#include <QtGui/qpaintengine.h>
#include <QtGui/private/qvolatileimage_p.h>
-#ifdef Q_OS_SYMBIAN
-#include <fbs.h>
-#endif
class tst_QVolatileImage : public QObject
{
void ensureFormat();
void dataAccess();
void sharing();
- void paint();
void fill();
void copy();
- void bitmap();
};
void tst_QVolatileImage::create()
QCOMPARE(img.hasAlphaChannel(), img.imageRef().hasAlphaChannel());
QCOMPARE(img.hasAlphaChannel(), img.toImage().hasAlphaChannel());
QCOMPARE(img.depth(), 32);
-
-#ifdef Q_OS_SYMBIAN
- CFbsBitmap *bmp = new CFbsBitmap;
- QVERIFY(bmp->Create(TSize(100, 50), EColor16MAP) == KErrNone);
- QVolatileImage bmpimg(bmp);
- QVERIFY(!bmpimg.isNull());
- QCOMPARE(bmpimg.width(), 100);
- QCOMPARE(bmpimg.height(), 50);
- // Verify that we only did handle duplication, not pixel data copying.
- QCOMPARE(bmpimg.constBits(), (const uchar *) bmp->DataAddress());
- delete bmp;
- // Check if content is still valid.
- QImage copyimg = bmpimg.toImage();
- QCOMPARE(copyimg.format(), QImage::Format_ARGB32_Premultiplied);
-#endif
}
void tst_QVolatileImage::ensureFormat()
QVERIFY(img.imageRef() != source);
QVERIFY(img.toImage() != source);
QVERIFY(img.format() == QImage::Format_RGB32);
-
-#ifdef Q_OS_SYMBIAN
- CFbsBitmap *bmp = new CFbsBitmap;
- QVERIFY(bmp->Create(TSize(100, 50), EColor16MAP) == KErrNone);
- QVolatileImage bmpimg(bmp);
- QVERIFY(bmpimg.ensureFormat(QImage::Format_ARGB32_Premultiplied)); // no-op
- QCOMPARE(bmpimg.constBits(), (const uchar *) bmp->DataAddress());
-
- // A different format should cause data copying.
- QVERIFY(bmpimg.ensureFormat(QImage::Format_RGB32));
- QVERIFY(bmpimg.constBits() != (const uchar *) bmp->DataAddress());
- const uchar *prevBits = bmpimg.constBits();
-
- QVERIFY(bmpimg.ensureFormat(QImage::Format_RGB16));
- QVERIFY(bmpimg.constBits() != (const uchar *) bmp->DataAddress());
- QVERIFY(bmpimg.constBits() != prevBits);
- prevBits = bmpimg.constBits();
-
- QVERIFY(bmpimg.ensureFormat(QImage::Format_MonoLSB));
- QVERIFY(bmpimg.constBits() != (const uchar *) bmp->DataAddress());
- QVERIFY(bmpimg.constBits() != prevBits);
-
- delete bmp;
-#endif
}
void tst_QVolatileImage::dataAccess()
// toImage() should return a copy of the internal QImage.
// imageRef() is a reference to the internal QImage.
QVERIFY(img1.imageRef().constBits() != img1.toImage().constBits());
-
-#ifdef Q_OS_SYMBIAN
- CFbsBitmap *bmp = new CFbsBitmap;
- QVERIFY(bmp->Create(TSize(100, 50), EColor16MAP) == KErrNone);
- QVolatileImage bmpimg(bmp);
- QVolatileImage bmpimg2;
- bmpimg2 = bmpimg;
- QCOMPARE(bmpimg.constBits(), (const uchar *) bmp->DataAddress());
- QCOMPARE(bmpimg2.constBits(), (const uchar *) bmp->DataAddress());
- // Now force a detach, which should copy the pixel data under-the-hood.
- bmpimg.imageRef();
- QVERIFY(bmpimg.constBits() != (const uchar *) bmp->DataAddress());
- QCOMPARE(bmpimg2.constBits(), (const uchar *) bmp->DataAddress());
- delete bmp;
-#endif
}
bool fuzzyCompareImages(const QImage &image1, const QImage &image2, int tolerance)
return true;
}
-void tst_QVolatileImage::paint()
-{
-#ifdef Q_OS_SYMBIAN
- QVolatileImage img(100, 100, QImage::Format_ARGB32);
- img.beginDataAccess();
- img.imageRef().fill(QColor(Qt::green).rgba());
- QPainter p(&img.imageRef());
- p.drawRect(10, 10, 50, 50);
- p.end();
- img.endDataAccess();
- QImage imgA = img.toImage();
-
- // The following assumes that on openvg the pixmapdata is backed by QVolatileImage)
- // (and that openvg is in use)
- // It should pass with any engine nonetheless.
- // See if painting into the underlying QImage succeeds.
- QPixmap pm(100, 100);
- if (pm.paintEngine()->type() == QPaintEngine::Raster) {
- pm.fill(Qt::green);
- QPainter pmp(&pm);
- pmp.drawRect(10, 10, 50, 50);
- pmp.end();
- QImage imgB = pm.toImage();
- QVERIFY(fuzzyCompareImages(imgA, imgB, 0));
- // Exercise the accelerated QVolatileImagePaintEngine::drawPixmap() a bit.
- QPixmap targetPm(pm.size());
- targetPm.fill(Qt::black);
- pmp.begin(&targetPm);
- pmp.drawPixmap(QPointF(0, 0), pm);
- pmp.end();
- imgB = targetPm.toImage();
- QVERIFY(fuzzyCompareImages(imgA, imgB, 0));
- // Now the overload taking rects.
- targetPm.fill(Qt::black);
- pmp.begin(&targetPm);
- QRectF rect(QPointF(0, 0), pm.size());
- pmp.drawPixmap(rect, pm, rect);
- pmp.end();
- imgB = targetPm.toImage();
- QVERIFY(fuzzyCompareImages(imgA, imgB, 0));
- } else {
- QSKIP("Pixmaps not painted via raster, skipping paint test", SkipSingle);
- }
-#endif
-}
-
void tst_QVolatileImage::fill()
{
QVolatileImage img(100, 100, QImage::Format_ARGB32_Premultiplied);
img.fill(col.rgba());
QVERIFY(img.imageRef().pixel(1, 1) == col.rgba());
QVERIFY(img.toImage().pixel(1, 1) == col.rgba());
-
-#ifdef Q_OS_SYMBIAN
- CFbsBitmap *bmp = static_cast<CFbsBitmap *>(img.duplicateNativeImage());
- QVERIFY(bmp);
- TRgb pix;
- bmp->GetPixel(pix, TPoint(1, 1));
- QCOMPARE(pix.Red(), col.red());
- QCOMPARE(pix.Green(), col.green());
- QCOMPARE(pix.Blue(), col.blue());
- delete bmp;
-#endif
}
void tst_QVolatileImage::copy()
QVERIFY(fuzzyCompareImages(imgA, imgB, 0));
}
-void tst_QVolatileImage::bitmap()
-{
-#ifdef Q_OS_SYMBIAN
- CFbsBitmap *bmp = new CFbsBitmap;
- QVERIFY(bmp->Create(TSize(100, 50), EColor64K) == KErrNone);
- QVolatileImage bmpimg(bmp);
- CFbsBitmap *dupbmp = static_cast<CFbsBitmap *>(bmpimg.duplicateNativeImage());
- QVERIFY(dupbmp);
- QVERIFY(dupbmp != bmp);
- QCOMPARE(dupbmp->DataAddress(), bmp->DataAddress());
- delete dupbmp;
- delete bmp;
- bmpimg.beginDataAccess();
- qMemSet(bmpimg.bits(), 0, bmpimg.byteCount());
- qMemSet(bmpimg.bits(), 1, bmpimg.bytesPerLine() * bmpimg.height());
- bmpimg.endDataAccess();
-
- // Test bgr->rgb conversion in case of EColor16M.
- bmp = new CFbsBitmap;
- QVERIFY(bmp->Create(TSize(101, 89), EColor16M) == KErrNone);
- bmp->BeginDataAccess();
- TUint32 *addr = bmp->DataAddress();
- uint rgb = QColor(10, 20, 30).rgb();
- qMemCopy(bmp->DataAddress(), &rgb, 3);
- bmp->EndDataAccess();
- TRgb symrgb;
- bmp->GetPixel(symrgb, TPoint(0, 0));
- QVERIFY(symrgb.Red() == 10 && symrgb.Green() == 20 && symrgb.Blue() == 30);
- bmpimg = QVolatileImage(bmp);
- QVERIFY(bmpimg.toImage().pixel(0, 0) == rgb);
- // check if there really was a conversion
- bmp->BeginDataAccess();
- bmpimg.beginDataAccess();
- qMemCopy(&rgb, bmpimg.constBits(), 3);
- uint rgb2 = rgb;
- qMemCopy(&rgb2, bmp->DataAddress(), 3);
- QVERIFY(rgb != rgb2);
- bmpimg.endDataAccess(true);
- bmp->EndDataAccess(true);
- delete bmp;
-
- bmp = new CFbsBitmap;
- QVERIFY(bmp->Create(TSize(101, 89), EGray2) == KErrNone);
- bmpimg = QVolatileImage(bmp); // inverts pixels, but should do it in place
- QCOMPARE(bmpimg.constBits(), (const uchar *) bmp->DataAddress());
- QCOMPARE(bmpimg.format(), QImage::Format_MonoLSB);
- bmpimg.ensureFormat(QImage::Format_ARGB32_Premultiplied);
- QVERIFY(bmpimg.constBits() != (const uchar *) bmp->DataAddress());
- QCOMPARE(bmpimg.format(), QImage::Format_ARGB32_Premultiplied);
- delete bmp;
-
- // The following two formats must be optimal always.
- bmp = new CFbsBitmap;
- QVERIFY(bmp->Create(TSize(101, 89), EColor16MAP) == KErrNone);
- bmpimg = QVolatileImage(bmp);
- QCOMPARE(bmpimg.format(), QImage::Format_ARGB32_Premultiplied);
- QCOMPARE(bmpimg.constBits(), (const uchar *) bmp->DataAddress());
- bmpimg.ensureFormat(QImage::Format_ARGB32_Premultiplied);
- QCOMPARE(bmpimg.constBits(), (const uchar *) bmp->DataAddress());
- delete bmp;
- bmp = new CFbsBitmap;
- QVERIFY(bmp->Create(TSize(101, 89), EColor16MU) == KErrNone);
- bmpimg = QVolatileImage(bmp);
- QCOMPARE(bmpimg.format(), QImage::Format_RGB32);
- QCOMPARE(bmpimg.constBits(), (const uchar *) bmp->DataAddress());
- bmpimg.ensureFormat(QImage::Format_RGB32);
- QCOMPARE(bmpimg.constBits(), (const uchar *) bmp->DataAddress());
- delete bmp;
-
-#else
- QSKIP("CFbsBitmap is only available on Symbian, skipping bitmap test", SkipSingle);
-#endif
-}
-
int main(int argc, char *argv[])
{
QApplication::setGraphicsSystem("openvg");
qshortcut \
qtouchevent \
-symbian {
- SUBDIRS += qsoftkeymanager
-}
}
}
-wince*|symbian: {
+wince* {
copier.files = ../copier/copier.exe
copier.path = copier
paster.files = ../paster/paster.exe
paster.path = paster
- symbian: {
- LIBS += -lbafl -lestor -letext
-
- load(data_caging_paths)
- rsc.files = $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/copier.rsc
- rsc.files += $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/paster.rsc
- rsc.path = $$APP_RESOURCE_DIR
- reg_resource.files = $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/copier_reg.rsc
- reg_resource.files += $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/paster_reg.rsc
- reg_resource.path = $$REG_RESOURCE_IMPORT_DIR
- }
-
DEPLOYMENT += copier paster rsc reg_resource
-}
\ No newline at end of file
+}
#ifdef Q_WS_MAC
#include <Carbon/Carbon.h>
#endif
-#ifdef Q_OS_SYMBIAN
-#include "private/qcore_symbian_p.h"
-#include "txtetext.h"
-#include <baclipb.h>
-#endif
-#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
-#include "txtclipboard.h"
-#endif
//TESTED_CLASS=
//TESTED_FILES=
void testSignals();
void setMimeData();
void clearBeforeSetText();
-#ifdef Q_OS_SYMBIAN
- void pasteCopySymbian();
- void copyPasteSymbian();
-#endif
private:
bool nativeClipboardWorking();
#if defined Q_WS_X11 || defined Q_WS_QWS || defined (Q_WS_QPA)
QSKIP("This test does not make sense on X11 and embedded, copied data disappears from the clipboard when the application exits ", SkipAll);
// ### It's still possible to test copy/paste - just keep the apps running
-#elif defined (Q_OS_SYMBIAN) && defined (Q_CC_NOKIAX86)
- QSKIP("emulator cannot launch multiple processes",SkipAll);
#endif
if (!nativeClipboardWorking())
QSKIP("Native clipboard not working in this setup", SkipAll);
QCOMPARE(QApplication::clipboard()->text(), text);
}
-/*
- Test that text copied from qt application
- can be pasted with symbian clipboard
-*/
-#ifdef Q_OS_SYMBIAN
-// ### This test case only makes sense in symbian
-void tst_QClipboard::pasteCopySymbian()
-{
- if (!nativeClipboardWorking())
- QSKIP("Native clipboard not working in this setup", SkipAll);
- const QString string("Test string symbian.");
- QApplication::clipboard()->setText(string);
-
- const TInt KPlainTextBegin = 0;
- RFs fs = qt_s60GetRFs();
- CClipboard* cb = CClipboard::NewForReadingLC(fs);
-
- CPlainText* text = CPlainText::NewL();
- CleanupStack::PushL(text);
- TInt dataLength = text->PasteFromStoreL(cb->Store(), cb->StreamDictionary(),
- KPlainTextBegin);
- if (dataLength == 0) {
- User::Leave(KErrNotFound);
- }
- HBufC* hBuf = HBufC::NewL(dataLength);
- TPtr buf = hBuf->Des();
- text->Extract(buf, KPlainTextBegin, dataLength);
-
- QString storeString = qt_TDesC2QString(buf);
- CleanupStack::PopAndDestroy(text);
- CleanupStack::PopAndDestroy(cb);
-
- QCOMPARE(string, storeString);
-}
-#endif
-
-/*
- Test that text copied to symbian clipboard
- can be pasted to qt clipboard
-*/
-#ifdef Q_OS_SYMBIAN
-// ### This test case only makes sense in symbian
-void tst_QClipboard::copyPasteSymbian()
-{
- if (!nativeClipboardWorking())
- QSKIP("Native clipboard not working in this setup", SkipAll);
- const QString string("Test string symbian.");
- const TInt KPlainTextBegin = 0;
-
- RFs fs = qt_s60GetRFs();
- CClipboard* cb = CClipboard::NewForWritingLC(fs);
- CStreamStore& store = cb->Store();
- CStreamDictionary& dict = cb->StreamDictionary();
- RStoreWriteStream symbianStream;
- TStreamId symbianStId = symbianStream.CreateLC(cb->Store());
-
- CPlainText* text = CPlainText::NewL();
- CleanupStack::PushL(text);
- TPtrC textPtr(qt_QString2TPtrC(string));
- text->InsertL(KPlainTextBegin, textPtr);
- text->CopyToStoreL(store, dict, KPlainTextBegin, textPtr.Length());
- CleanupStack::PopAndDestroy(text);
- (cb->StreamDictionary()).AssignL(KClipboardUidTypePlainText, symbianStId);
- cb->CommitL();
- CleanupStack::PopAndDestroy(2, cb);
-
- QCOMPARE(QApplication::clipboard()->text(), string);
-}
-#endif
-
QTEST_MAIN(tst_QClipboard)
#include "tst_qclipboard.moc"
TARGET = qfileopeneventexternal
QT += core gui widgets
SOURCES += qfileopeneventexternal.cpp
-symbian: {
- RSS_RULES += "embeddability=KAppEmbeddable;"
- RSS_RULES.datatype_list += "priority = EDataTypePriorityHigh; type = \"application/x-tst_qfileopenevent\";"
- LIBS += -lapparc \
- -leikcore -lefsrv -lcone
-}
TARGET = tst_qfileopenevent
HEADERS +=
SOURCES += tst_qfileopenevent.cpp
-symbian {
- LIBS+=-lefsrv -lapgrfx -lapmime
-}
#include <QtTest/QtTest>
#include <QtGui/qevent.h>
-#ifdef Q_OS_SYMBIAN
-#include <apgcli.h>
-#include "private/qcore_symbian_p.h"
-#endif
-
class tst_qfileopenevent : public QObject
{
Q_OBJECT
void handleLifetime();
void multiOpen();
void sendAndReceive();
- void external_data();
- void external();
private:
-#ifdef Q_OS_SYMBIAN
- RFile createRFile(const TDesC& filename, const TDesC8& content);
-#else
void createFile(const QString &filename, const QByteArray &content);
-#endif
QFileOpenEvent * createFileAndEvent(const QString &filename, const QByteArray &content);
void checkReadAndWrite(QFileOpenEvent& event, const QByteArray& readContent, const QByteArray& writeContent, bool writeOk);
QByteArray readFileContent(QFileOpenEvent& event);
bool appendFileContent(QFileOpenEvent& event, const QByteArray& writeContent);
bool event(QEvent *);
-
-private:
-#ifdef Q_OS_SYMBIAN
- struct AutoRFs : public RFs
- {
- AutoRFs()
- {
- qt_symbian_throwIfError(Connect());
- qt_symbian_throwIfError(ShareProtected());
- }
-
- ~AutoRFs()
- {
- Close();
- }
- };
- AutoRFs fsSession;
-#endif
};
tst_qfileopenevent::~tst_qfileopenevent()
{
}
-#ifdef Q_OS_SYMBIAN
-RFile tst_qfileopenevent::createRFile(const TDesC& filename, const TDesC8& content)
-{
- RFile file;
- qt_symbian_throwIfError(file.Replace(fsSession, filename, EFileWrite));
- qt_symbian_throwIfError(file.Write(content));
- return file;
-}
-#else
void tst_qfileopenevent::createFile(const QString &filename, const QByteArray &content)
{
QFile file(filename);
file.write(content);
file.close();
}
-#endif
QFileOpenEvent * tst_qfileopenevent::createFileAndEvent(const QString &filename, const QByteArray &content)
{
-#ifdef Q_OS_SYMBIAN
- RFile rFile = createRFile(qt_QString2TPtrC(filename), TPtrC8((TText8*)content.constData(), content.size()));
- QScopedPointer<RFile, QScopedPointerRCloser<RFile> > closeRFile(&rFile);
- return new QFileOpenEvent(rFile);
-#else
createFile(filename, content);
return new QFileOpenEvent(filename);
-#endif
}
void tst_qfileopenevent::constructor()
// check that url get/set works
QFileOpenEvent urlTest(QUrl(QLatin1String("file:///urlNameTest")));
QCOMPARE(urlTest.url().toString(), QLatin1String("file:///urlNameTest"));
-
-#ifdef Q_OS_SYMBIAN
- // check that RFile construction works
- RFile rFile = createRFile(_L("testRFile"), _L8("test content"));
- QFileOpenEvent rFileTest(rFile);
- QString targetName(QLatin1String("testRFile"));
- QCOMPARE(rFileTest.file().right(targetName.size()), targetName);
- QCOMPARE(rFileTest.url().toString().right(targetName.size()), targetName);
- rFile.Close();
-#endif
}
QByteArray tst_qfileopenevent::readFileContent(QFileOpenEvent& event)
void tst_qfileopenevent::fileOpen()
{
-#ifdef Q_OS_SYMBIAN
- // create writeable file
- {
- RFile rFile = createRFile(_L("testFileOpen"), _L8("test content"));
- QFileOpenEvent rFileTest(rFile);
- checkReadAndWrite(rFileTest, QByteArray("test content"), QByteArray("+RFileWrite"), true);
- rFile.Close();
- }
-
- // open read-only RFile
- {
- RFile rFile;
- int err = rFile.Open(fsSession, _L("testFileOpen"), EFileRead);
- QFileOpenEvent rFileTest(rFile);
- checkReadAndWrite(rFileTest, QByteArray("test content+RFileWrite"), QByteArray("+RFileRead"), false);
- rFile.Close();
- }
-#else
createFile(QLatin1String("testFileOpen"), QByteArray("test content+RFileWrite"));
-#endif
// filename event
QUrl fileUrl; // need to get the URL during the file test, for use in the URL test
QFile::remove(QLatin1String("testSendAndReceive"));
}
-void tst_qfileopenevent::external_data()
-{
- QTest::addColumn<QString>("filename");
- QTest::addColumn<QByteArray>("targetContent");
- QTest::addColumn<bool>("sendHandle");
-
- QString privateName(QLatin1String("tst_qfileopenevent_external"));
- QString publicName(QLatin1String("C:\\Data\\tst_qfileopenevent_external"));
- QByteArray writeSuccess("original+external");
- QByteArray writeFail("original");
- QTest::newRow("public name") << publicName << writeSuccess << false;
- QTest::newRow("data caged name") << privateName << writeFail << false;
- QTest::newRow("public handle") << publicName << writeSuccess << true;
- QTest::newRow("data caged handle") << privateName << writeSuccess << true;
-}
-
-void tst_qfileopenevent::external()
-{
-#ifndef Q_OS_SYMBIAN
- QSKIP("external app file open test only valid in Symbian", SkipAll);
-#else
-
- QFETCH(QString, filename);
- QFETCH(QByteArray, targetContent);
- QFETCH(bool, sendHandle);
-
- RFile rFile = createRFile(qt_QString2TPtrC(filename), _L8("original"));
-
- // launch app with the file
- RApaLsSession apa;
- QCOMPARE(apa.Connect(), KErrNone);
- TThreadId threadId;
- TDataType type(_L8("application/x-tst_qfileopenevent"));
- if (sendHandle) {
- QCOMPARE(apa.StartDocument(rFile, type, threadId), KErrNone);
- rFile.Close();
- } else {
- TFileName fullName;
- rFile.FullName(fullName);
- rFile.Close();
- QCOMPARE(apa.StartDocument(fullName, type, threadId), KErrNone);
- }
-
- // wait for app exit
- RThread appThread;
- if (appThread.Open(threadId) == KErrNone) {
- TRequestStatus status;
- appThread.Logon(status);
- User::WaitForRequest(status);
- }
-
- // check the contents
- QFile check(filename);
- QCOMPARE(check.open(QFile::ReadOnly), true);
- QCOMPARE(check.readAll(), targetContent);
- bool ok = check.remove();
-
- QFile::remove(filename);
-#endif
-}
-
QTEST_MAIN(tst_qfileopenevent)
#include "tst_qfileopenevent.moc"
QFETCH(QString, compKey);
#ifdef Q_WS_MAC
QSKIP("No need to translate modifiers on Mac OS X", SkipAll);
-#elif defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
- QSKIP("No need to translate modifiers on WinCE or Symbian", SkipAll);
+#elif defined(Q_OS_WINCE)
+ QSKIP("No need to translate modifiers on WinCE", SkipAll);
#endif
qApp->installTranslator(ourTranslator);
QT += widgets widgets-private printsupport
SOURCES += tst_qpainter.cpp
-wince*|symbian: {
+wince* {
addFiles.files = drawEllipse drawLine_rop_bitmap drawPixmap_rop drawPixmap_rop_bitmap task217400.png
addFiles.path = .
DEPLOYMENT += addFiles
-}
-
-wince* {
DEFINES += SRCDIR=\\\".\\\"
-} else:!symbian {
+} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
-
mac*:CONFIG+=insignificant_test
#include <qimage.h>
#include <qthread.h>
#include <limits.h>
-#if !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN)
+#if !defined(Q_OS_WINCE)
#include <qprinter.h>
#include <math.h>
#endif
#include <qlayout.h>
#include <qfontdatabase.h>
-#if defined(Q_OS_SYMBIAN)
-# define SRCDIR "."
-#endif
-
Q_DECLARE_METATYPE(QGradientStops)
Q_DECLARE_METATYPE(QLine)
Q_DECLARE_METATYPE(QRect)
QCOMPARE(pbr, br);
}
#endif
-#if !defined(QT_NO_PRINTER) && !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN)
+#if !defined(QT_NO_PRINTER) && !defined(Q_OS_WINCE)
{
QPrinter printer(QPrinter::HighResolution);
if (printer.printerName().isEmpty()) {
void tst_QPainter::drawPath3()
{
-#if !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN)
+#if !defined(Q_OS_WINCE)
QImage imgA(400, 400, QImage::Format_RGB32);
#else
QImage imgA(100, 100, QImage::Format_RGB32);
}
}
-#if !defined(Q_OS_IRIX) && !defined(Q_OS_AIX) && !defined(Q_CC_MSVC) && !defined(Q_OS_SOLARIS) && !defined(Q_OS_SYMBIAN)
+#if !defined(Q_OS_IRIX) && !defined(Q_OS_AIX) && !defined(Q_CC_MSVC) && !defined(Q_OS_SOLARIS)
#include <fenv.h>
static const QString fpeExceptionString(int exception)
requires(contains(QT_CONFIG,private_tests))
-unix:!mac:!symbian:LIBS+=-lm
+unix:!mac:LIBS+=-lm
QT += widgets
SOURCES += tst_qpolygon.cpp
-unix:!mac:!symbian:LIBS+=-lm
+unix:!mac:LIBS+=-lm
HEADERS +=
SOURCES += tst_qtransform.cpp
-unix:!mac:!symbian:LIBS+=-lm
+unix:!mac:LIBS+=-lm
load(qttest_p4)
SOURCES += tst_qwmatrix.cpp
-unix:!mac:!symbian:LIBS+=-lm
-
+unix:!mac:LIBS+=-lm
QT += xml gui-private
requires(contains(QT_CONFIG,private_tests))
-!symbian: {
- DEFINES += SRCDIR=\\\"$$PWD\\\"
-}
+DEFINES += SRCDIR=\\\"$$PWD\\\"
-wince*|symbian: {
+wince* {
addFiles.files = testdata
addFiles.path = .
timesFont.files = C:/Windows/Fonts/times.ttf
QTest::addColumn<QString>("input");
QTest::addColumn<QString>("output");
-#if !defined(Q_OS_IRIX) && !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN)
+#if !defined(Q_OS_IRIX) && !defined(Q_OS_WINCE)
QDir d(SRCDIR);
#else
QDir d(QDir::current());
load(qttest_p4)
SOURCES += tst_qfontdatabase.cpp
-!symbian:DEFINES += SRCDIR=\\\"$$PWD\\\"
+DEFINES += SRCDIR=\\\"$$PWD\\\"
-wince*|symbian {
+wince* {
additionalFiles.files = FreeMono.ttf
additionalFiles.path = .
DEPLOYMENT += additionalFiles
**
****************************************************************************/
-
#include <QtTest/QtTest>
-
#include <qfontdatabase.h>
#include <qfontinfo.h>
#include <qfontmetrics.h>
-#ifdef Q_OS_SYMBIAN
-#define SRCDIR "."
-#endif
-
//TESTED_CLASS=
//TESTED_FILES=
SOURCES += \
tst_qglyphrun.cpp
-wince*|symbian*: {
+wince* {
DEFINES += SRCDIR=\\\"\\\"
} else {
DEFINES += SRCDIR=\\\"$$PWD/\\\"
INCLUDEPATH += $$QT_SOURCE_TREE/src/3rdparty/harfbuzz/src
-wince*|symbian*: {
+wince* {
DEFINES += SRCDIR=\\\"\\\"
} else {
DEFINES += SRCDIR=\\\"$$PWD/\\\"
SOURCES += tst_qtextlayout.cpp
DEFINES += QT_COMPILES_IN_HARFBUZZ
INCLUDEPATH += $$QT_SOURCE_TREE/src/3rdparty/harfbuzz/src
-
-symbian {
- TARGET.EPOCHEAPSIZE = 100000 20000000
-}
-
QT += core-private gui-private
SOURCES += tst_qtextodfwriter.cpp
-!symbian:DEFINES += SRCDIR=\\\"$$PWD\\\"
-symbian:INCLUDEPATH+=$$[QT_INSTALL_PREFIX]/include/QtGui/private
+DEFINES += SRCDIR=\\\"$$PWD\\\"
** $QT_END_LICENSE$
**
****************************************************************************/
+
#include <QtTest/QtTest>
#include <QTextDocument>
#include <QTextCursor>
#include <QBuffer>
#include <QDebug>
-#ifdef Q_OS_SYMBIAN
-#define SRCDIR "."
-#endif
-
#include <private/qtextodfwriter_p.h>
class tst_QTextOdfWriter : public QObject
QT += gui-private
SOURCES += tst_qzip.cpp
-wince*|symbian: {
+wince* {
addFiles.files = testdata
addFiles.path = .
DEPLOYMENT += addFiles
- !symbian:DEFINES += SRCDIR=\\\".\\\"
+ DEFINES += SRCDIR=\\\".\\\"
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
#include <private/qzipwriter_p.h>
#include <private/qzipreader_p.h>
-#ifdef Q_OS_SYMBIAN
-#define SRCDIR "."
-#endif
-
class tst_QZip : public QObject
{
Q_OBJECT
SOURCES += tst_qdesktopservices.cpp
TARGET = tst_qdesktopservices
-symbian: {
- dummy.files = text\\testfile.txt
- dummy.path = .
-
- text.files = text\\*
- text.path = \\data\\others
-
- image.files = image\\*
- image.path = \\data\\images
-
- audio.files = audio\\*
- audio.path = \\data\\sounds
-
- video.files = video\\*
- video.path = \\data\\videos
-
- install.files = install\\*
- install.path = \\data\\installs
-
- DEPLOYMENT += image audio video install
-
- # These are only needed for manual tests
- #DEPLOYMENT += dummy text
- }
#include <qdebug.h>
#include <qdesktopservices.h>
-//#define RUN_MANUAL_TESTS
//TESTED_CLASS=
//TESTED_FILES=
-class tst_qdesktopservices : public QObject {
- Q_OBJECT
+class tst_qdesktopservices : public QObject
+{
+ Q_OBJECT
public:
tst_qdesktopservices();
void init();
void cleanup();
void openUrl();
-#ifdef Q_OS_SYMBIAN
- // These test are manual ones, you need to check from device that
- // correct system application is started with correct content
- // When you want to run these test, uncomment //#define RUN_MANUAL_TESTS
- void openHttpUrl_data();
- void openHttpUrl();
- void openMailtoUrl_data();
- void openMailtoUrl();
- void openFileUrl_data();
- void openFileUrl();
- void openMultipleFileUrls();
-#endif
void handlers();
void storageLocation_data();
void storageLocation();
void storageLocationDoesNotEndWithSlash_data();
void storageLocationDoesNotEndWithSlash();
-
-protected:
};
tst_qdesktopservices::tst_qdesktopservices()
#endif
}
-#ifdef Q_OS_SYMBIAN
-void tst_qdesktopservices::openHttpUrl_data()
-{
- QTest::addColumn<QUrl>("url");
- QTest::addColumn<bool>("result");
- QTest::newRow("BasicWithHttp") << QUrl("http://www.google.fi") << true;
- QTest::newRow("BasicWithoutHttp") << QUrl("www.nokia.fi") << true;
- QTest::newRow("BasicWithUserAndPw") << QUrl("http://s60prereleases:oslofjord@pepper.troll.no/s60prereleases/patches/") << true;
- QTest::newRow("URL with space") << QUrl("http://www.manataka.org/Contents Page.html") << true;
-
-}
-
-void tst_qdesktopservices::openHttpUrl()
-{
-#ifndef RUN_MANUAL_TESTS
- QSKIP("Test disabled -- only for manual purposes", SkipAll);
-#endif
-
- QFETCH(QUrl, url);
- QFETCH(bool, result);
- QCOMPARE(QDesktopServices::openUrl(url), result);
- QTest::qWait(30000);
-}
-
-void tst_qdesktopservices::openMailtoUrl_data()
-{
- QTest::addColumn<QUrl>("url");
- QTest::addColumn<bool>("result");
-
- // http://en.wikipedia.org/wiki/E-mail_address
- // RFC Valid e-mail addresses
- QTest::newRow("Wiki valid email 1") << QUrl("mailto:abc@example.com") << true;
- QTest::newRow("Wiki valid email 2") << QUrl("mailto:Abc@example.com") << true;
- QTest::newRow("Wiki valid email 3") << QUrl("mailto:aBC@example.com") << true;
- QTest::newRow("Wiki valid email 4") << QUrl("mailto:abc.123@example.com") << true;
- QTest::newRow("Wiki valid email 5") << QUrl("mailto:1234567890@example.com") << true;
- QTest::newRow("Wiki valid email 6") << QUrl("mailto:_______@example.com") << true;
- QTest::newRow("Wiki valid email 7") << QUrl("mailto:abc+mailbox/department=shipping@example.com") << true;
- // S60 email client considers the next URL invalid, even ity should be valid
- QTest::newRow("Wiki valid email 8") << QUrl("mailto:!#$%&'*+-/=?^_`.{|}~@example.com") << true; // all of these characters are allowed
- QTest::newRow("Wiki valid email 9") << QUrl("mailto:\"abc@def\"@example.com") << true; // anything goes inside quotation marks
- QTest::newRow("Wiki valid email 10") << QUrl("mailto:\"Fred \\\"quota\\\" Bloggs\"@example.com") << true; // however, quotes need escaping
-
- // RFC invalid e-mail addresses
- // These return true even though they are invalid, but check that user is notified about invalid URL in mail application
- QTest::newRow("Wiki invalid email 1") << QUrl("mailto:Abc.example.com") << true; // character @ is missing
- QTest::newRow("Wiki invalid email 2") << QUrl("mailto:Abc.@example.com") << true; // character dot(.) is last in local part
- QTest::newRow("Wiki invalid email 3") << QUrl("mailto:Abc..123@example.com") << true; // character dot(.) is double
- QTest::newRow("Wiki invalid email 4") << QUrl("mailto:A@b@c@example.com") << true; // only one @ is allowed outside quotations marks
- QTest::newRow("Wiki invalid email 5") << QUrl("mailto:()[]\\;:,<>@example.com") << true; // none of the characters before the @ is allowed outside quotation marks
-
- QTest::newRow("Basic") << QUrl("mailto:test@nokia.com") << true;
- QTest::newRow("BasicSeveralAddr") << QUrl("mailto:test@nokia.com,test2@nokia.com,test3@nokia.com") << true;
- QTest::newRow("BasicAndSubject") << QUrl("mailto:test@nokia.com?subject=hello nokia") << true;
- QTest::newRow("BasicAndTo") << QUrl("mailto:test@nokia.com?to=test2@nokia.com") << true;
-
- QTest::newRow("BasicAndCc") << QUrl("mailto:test@nokia.com?cc=mycc@address.com") << true;
- QTest::newRow("BasicAndBcc") << QUrl("mailto:test@nokia.com?bcc=mybcc@address.com") << true;
- QTest::newRow("BasicAndBody") << QUrl("mailto:test@nokia.com?body=Test email message body") << true;
-
- // RFC examples, these are actually invalid because there is not host defined
- // Check that user is notified about invalid URL in mail application
- QTest::newRow("RFC2368 Example 1") << QUrl::fromEncoded("mailto:addr1%2C%20addr2") << true;
- QTest::newRow("RFC2368 Example 2") << QUrl::fromEncoded("mailto:?to=addr1%2C%20addr2") << true;
- QTest::newRow("RFC2368 Example 3") << QUrl("mailto:addr1?to=addr2") << true;
-
- QTest::newRow("RFC2368 Example 4") << QUrl("mailto:joe@example.com?cc=bob@example.com&body=hello") << true;
- QTest::newRow("RFC2368 Example 5") << QUrl("mailto:?to=joe@example.com&cc=bob@example.com&body=hello") << true;
- QTest::newRow("RFC2368 Example 6") << QUrl("mailto:foobar@example.com?In-Reply-To=%3c3469A91.D10AF4C@example.com") << true; // OpaqueData
- QTest::newRow("RFC2368 Example 7") << QUrl::fromEncoded("mailto:infobot@example.com?body=send%20current-issue%0D%0Asend%20index") << true;
- QTest::newRow("RFC2368 Example 8") << QUrl::fromEncoded("mailto:infobot@example.com?body=send%20current-issue") << true;
- QTest::newRow("RFC2368 Example 9") << QUrl("mailto:infobot@example.com?subject=current-issue") << true;
- QTest::newRow("RFC2368 Example 10") << QUrl("mailto:chris@example.com") << true;
-
- //QTest::newRow("RFC2368 Example 11 - illegal chars") << QUrl("mailto:joe@example.com?cc=bob@example.com?body=hello") << false;
- QTest::newRow("RFC2368 Example 12") << QUrl::fromEncoded("mailto:gorby%25kremvax@example.com") << true; // encoded reserved chars '%'
- QTest::newRow("RFC2368 Example 13") << QUrl::fromEncoded("mailto:unlikely%3Faddress@example.com?blat=foop") << true; // encoded reserved chars `?'
-}
-
-void tst_qdesktopservices::openMailtoUrl()
-{
-#ifndef RUN_MANUAL_TESTS
- QSKIP("Test disabled -- only for manual purposes", SkipAll);
-#endif
-
- QFETCH(QUrl, url);
- QFETCH(bool, result);
- QCOMPARE(QDesktopServices::openUrl(url), result);
- QTest::qWait(5000);
-}
-
-void tst_qdesktopservices::openFileUrl_data()
-{
- QTest::addColumn<QUrl>("url");
- QTest::addColumn<bool>("result");
-
- // Text files
- QTest::newRow("DOS text file") << QUrl("file:///c:/data/others/dosfile.txt") << true;
- QTest::newRow("No EOF text file") << QUrl("file:///c:/data/others/noendofline.txt") << true;
- QTest::newRow("text file") << QUrl("file:///c:/data/others/testfile.txt") << true;
- QTest::newRow("text file with space") << QUrl("file:///c:/data/others/test file.txt") << true;
-
- // Images
- QTest::newRow("BMP image") << QUrl("file:///c:/data/images/image.bmp") << true;
- QTest::newRow("GIF image") << QUrl("file:///c:/data/images/image.gif") << true;
- QTest::newRow("JPG image") << QUrl("file:///c:/data/images/image.jpg") << true;
- QTest::newRow("PNG image") << QUrl("file:///c:/data/images/image.png") << true;
-
- // Audio
- QTest::newRow("MP4 audio") << QUrl("file:///c:/data/sounds/aac-only.mp4") << true;
- QTest::newRow("3GP audio") << QUrl("file:///c:/data/sounds/audio_3gpp.3gp") << true;
-
- // Video
- QTest::newRow("MP4 video") << QUrl("file:///c:/data/videos/vid-mpeg4-22k.mp4") << true;
-
- // Installs
- QTest::newRow("SISX") << QUrl("file:///c:/data/installs/ErrRd.sisx") << true;
-
- // Errors
- QTest::newRow("File does not exist") << QUrl("file:///c:/thisfileneverexists.txt") << false;
-}
-
-void tst_qdesktopservices::openFileUrl()
-{
-#ifndef RUN_MANUAL_TESTS
- QSKIP("Test disabled -- only for manual purposes", SkipAll);
-#endif
-
- QFETCH(QUrl, url);
- QFETCH(bool, result);
- QCOMPARE(QDesktopServices::openUrl(url), result);
- QTest::qWait(5000);
-}
-
-void tst_qdesktopservices::openMultipleFileUrls()
-{
-#ifndef RUN_MANUAL_TESTS
- QSKIP("Test disabled -- only for manual purposes", SkipAll);
-#endif
-
- QCOMPARE(QDesktopServices::openUrl(QUrl("file:///c:/data/images/image.bmp")), true);
- QCOMPARE(QDesktopServices::openUrl(QUrl("file:///c:/data/images/image.png")), true);
- QCOMPARE(QDesktopServices::openUrl(QUrl("file:///c:/data/others/noendofline.txt")), true);
- QCOMPARE(QDesktopServices::openUrl(QUrl("file:///c:/data/installs/ErrRd.sisx")), true);
-}
-#endif
-
-
class MyUrlHandler : public QObject
{
Q_OBJECT
void tst_qdesktopservices::storageLocation()
{
QFETCH(QDesktopServices::StandardLocation, location);
-#ifdef Q_OS_SYMBIAN
- QString storageLocation = QDesktopServices::storageLocation(location);
- QString displayName = QDesktopServices::displayName(location);
- //qDebug( "displayName: %s", displayName );
-
- storageLocation = storageLocation.toLower();
- displayName = displayName.toLower();
-
- QString drive = QDir::currentPath().left(2).toLower();
- if( drive == "z:" )
- drive = "c:";
-
- switch(location) {
- case QDesktopServices::DesktopLocation:
- QCOMPARE( storageLocation, drive + QString("/data") );
- break;
- case QDesktopServices::DocumentsLocation:
- QCOMPARE( storageLocation, drive + QString("/data") );
- break;
- case QDesktopServices::FontsLocation:
- // Currently point always to ROM
- QCOMPARE( storageLocation, QString("z:/resource/fonts") );
- break;
- case QDesktopServices::ApplicationsLocation:
-#ifdef Q_CC_NOKIAX86
- QCOMPARE( storageLocation, QString("z:/sys/bin") );
-#else
- QCOMPARE( storageLocation, drive + QString("/sys/bin") );
-#endif
- break;
- case QDesktopServices::MusicLocation:
- QCOMPARE( storageLocation, drive + QString("/data/sounds") );
- break;
- case QDesktopServices::MoviesLocation:
- QCOMPARE( storageLocation, drive + QString("/data/videos") );
- break;
- case QDesktopServices::PicturesLocation:
- QCOMPARE( storageLocation, drive + QString("/data/images") );
- break;
- case QDesktopServices::TempLocation:
- QCOMPARE( storageLocation, QDir::tempPath().toLower());
- break;
- case QDesktopServices::HomeLocation:
- QCOMPARE( storageLocation, QDir::homePath().toLower());
- break;
- case QDesktopServices::DataLocation:
- // Just check the folder not the drive
- QCOMPARE( storageLocation.mid(2), QDir::currentPath().mid(2).toLower());
- break;
- default:
- QCOMPARE( storageLocation, QString() );
- break;
- }
-
-#else
QDesktopServices::storageLocation(location);
QDesktopServices::displayName(location);
-#endif
}
-
void tst_qdesktopservices::storageLocationDoesNotEndWithSlash_data()
{
storageLocation_data();
include($$PWD/../../baselineserver/shared/qbaselinetest.pri)
-!symbian:!wince*:DEFINES += SRCDIR=\\\"$$PWD\\\"
+!wince*:DEFINES += SRCDIR=\\\"$$PWD\\\"
linux-g++-maemo:DEFINES += USE_RUNTIME_DIR
CONFIG += insignificant_test # QTBUG-21402
"languages or to 'RTL' in right-to-left languages (such as Hebrew and Arabic) to "
"get proper widget layout.");
TransformTranslator translator;
-#if defined(Q_OS_SYMBIAN) && defined(Q_CC_NOKIAX86)
- // Allow a little extra time or emulator startup delays cause failure
- QTimer::singleShot(5000, &translator, SLOT(install()));
-#else
QTimer::singleShot(500, &translator, SLOT(install()));
-#endif
switch (dialogType) {
case InputDialog:
(void)QInputDialog::getInteger(0, QLatin1String("title"), QLatin1String("label"));
QString fooName = tmpParentDir + "/foo";
QDir dir;
QCOMPARE(dir.mkpath(tmpDir), true);
-#if defined(Q_OS_SYMBIAN)
- // Just create a new file instead of copying exe, because there is no read access to /sys/bin
- {
- QFile fooFile(fooName);
- QVERIFY(fooFile.open(QIODevice::WriteOnly | QIODevice::Text));
- for(int i=0; i<2048; i++) // File needs to be big enough for size to read in KB
- fooFile.write("@");
- }
-#else
QCOMPARE(QFile::copy(QApplication::applicationFilePath(), fooName), true);
-#endif
dlg.setDirectory(tmpParentDir);
#ifdef Q_OS_WINCE
dlg.setFileMode(QFileDialog::ExistingFiles);
dlg.setViewMode(QFileDialog::Detail);
dlg.exec();
-#if defined(Q_OS_SYMBIAN) && defined(Q_CC_NOKIAX86)
- // increase the wait time because of increased delay caused by emulator startup
- QTest::qWait(15000);
-#else
QTest::qWait(3000);
-#endif
QCOMPARE(QFile::remove(fooName), true);
QCOMPARE(dir.rmdir(tmpDir), true);
QCOMPARE(dir.rmdir(tmpParentDir), true);
#include <QtNetwork/QHostInfo>
#endif
-
-#ifdef Q_OS_SYMBIAN
-#include <e32base.h>
-#include <sys/socket.h>
-#include <net/if.h>
-#include <QSharedPointer>
-#include <QHash>
-#endif
-#if defined(Q_OS_SYMBIAN)
-#if defined(Q_CC_NOKIAX86)
-// In emulator we use WINSOCK connectivity by default. Unfortunately winsock
-// does not work very well with UDP sockets. This defines skips some test
-// cases which have known problems.
-
-// NOTE: Prefer to use WINPCAP based connectivity in S60 emulator when running
-// network tests. WINPCAP connectivity uses Symbian OS IP stack,
-// correspondingly as HW does. When using WINPCAP disable this define
-//#define SYMBIAN_WINSOCK_CONNECTIVITY
-#endif // Q_CC_NOKIAX86
-
-// FIXME: any reason we do this for symbian only, and not other platforms?
-class QtNetworkSettingsRecord {
-public:
- QtNetworkSettingsRecord() { }
-
- QtNetworkSettingsRecord(const QString& recName, const QString& recVal)
- : strRecordName(recName), strRecordValue(recVal) { }
-
- QtNetworkSettingsRecord(const QtNetworkSettingsRecord & other)
- : strRecordName(other.strRecordName), strRecordValue(other.strRecordValue) { }
-
- ~QtNetworkSettingsRecord() { }
-
- const QString& recordName() const { return strRecordName; }
- const QString& recordValue() const { return strRecordValue; }
-
-private:
- QString strRecordName;
- QString strRecordValue;
-};
-
-#endif // Q_OS_SYMBIAN
-
class QtNetworkSettings
{
public:
static QString serverLocalName()
{
-#ifdef Q_OS_SYMBIAN
- loadTestSettings();
-
- if(QtNetworkSettings::entries.contains("server.localname")) {
- QtNetworkSettingsRecord* entry = entries["server.localname"];
- return entry->recordValue();
- }
-#endif
return QString("qt-test-server");
}
static QString serverDomainName()
{
-#ifdef Q_OS_SYMBIAN
- loadTestSettings();
-
- if(QtNetworkSettings::entries.contains("server.domainname")) {
- QtNetworkSettingsRecord* entry = entries["server.domainname"];
- return entry->recordValue();
- }
-#endif
return QString("qt-test-net");
}
static QString serverName()
{
-#ifdef Q_OS_SYMBIAN
- loadTestSettings();
-#endif
return serverLocalName() + "." + serverDomainName();
}
static QString winServerName()
#ifdef QT_NETWORK_LIB
static QHostAddress serverIP()
{
-#ifdef Q_OS_SYMBIAN
- loadTestSettings();
-
- if(QtNetworkSettings::entries.contains("server.ip")) {
- QtNetworkSettingsRecord* entry = entries["server.ip"];
- if(serverIp.isNull()) {
- serverIp = entry->recordValue().toAscii();
- }
- return QHostAddress(serverIp.data());
- }
-#endif // Q_OS_SYMBIAN
- return QHostInfo::fromName(serverName()).addresses().first();
+ return QHostInfo::fromName(serverName()).addresses().first();
}
#endif
{
QList<QByteArray> expected;
-#ifdef Q_OS_SYMBIAN
- loadTestSettings();
-
- if(QtNetworkSettings::entries.contains("imap.expectedreply")) {
- QtNetworkSettingsRecord* entry = entries["imap.expectedreply"];
- if(imapExpectedReply.isNull()) {
- imapExpectedReply = entry->recordValue().toAscii();
- imapExpectedReply.append('\r').append('\n');
- }
- expected << imapExpectedReply.data();
- }
-#endif
-
// Mandriva; old test server
expected << QByteArray( "* OK [CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID STARTTLS LOGINDISABLED] " )
.append(QtNetworkSettings::serverName().toAscii())
{
QList<QByteArray> expected;
-#ifdef Q_OS_SYMBIAN
- loadTestSettings();
-
- if(QtNetworkSettings::entries.contains("imap.expectedreplyssl")) {
- QtNetworkSettingsRecord* entry = entries["imap.expectedreplyssl"];
- if(imapExpectedReplySsl.isNull()) {
- imapExpectedReplySsl = entry->recordValue().toAscii();
- imapExpectedReplySsl.append('\r').append('\n');
- }
- expected << imapExpectedReplySsl.data();
- }
-#endif
// Mandriva; old test server
expected << QByteArray( "* OK [CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID AUTH=PLAIN SASL-IR] " )
.append(QtNetworkSettings::serverName().toAscii())
return false;
}
-
-#ifdef Q_OS_SYMBIAN
- static void setDefaultIap()
- {
- loadDefaultIap();
-
- struct ifreq ifReq;
- if(entries.contains("iap.default")) {
- QtNetworkSettingsRecord* entry = entries["iap.default"];
- QByteArray tmp(entry->recordValue().toAscii());
- strcpy( ifReq.ifr_name, tmp.data());
- }
- else // some default value
- strcpy( ifReq.ifr_name, "Lab");
-
- int err = setdefaultif( &ifReq );
- if(err)
- printf("Setting default IAP - '%s' failed: %d\n", ifReq.ifr_name, err);
- else
- printf("'%s' used as an default IAP\n", ifReq.ifr_name);
- }
-#endif
-
-private:
-
-#ifdef Q_OS_SYMBIAN
-
- static QHash<QString, QtNetworkSettingsRecord* > entries;
- static bool bDefaultIapLoaded;
- static bool bTestSettingsLoaded;
- static QString iapFileFullPath;
- static QByteArray serverIp;
- static QByteArray imapExpectedReply;
- static QByteArray imapExpectedReplySsl;
-
- static bool loadDefaultIap() {
- if(bDefaultIapLoaded)
- return true;
-
- QFile iapCfgFile(iapFileFullPath);
-
- bool bFoundDefaultIapTag = false;
-
- if (iapCfgFile.open(QFile::ReadOnly)) {
- QTextStream input(&iapCfgFile);
- QString line;
- do {
- line = input.readLine().trimmed();
- if(line.startsWith(QString("#")))
- continue; // comment found
-
- if(line.contains(QString("[DEFAULT]"))) {
- bFoundDefaultIapTag = true;
- } else if(line.contains(QString("[")) && bFoundDefaultIapTag) {
- break;
- }
-
- if(bFoundDefaultIapTag && line.contains("name")) {
- int position = line.indexOf(QString("="));
- position += QString("=").length();
-
- //create record
- QtNetworkSettingsRecord *entry =
- new QtNetworkSettingsRecord( QString("iap.default"), line.mid(position).trimmed() );
- entries.insert(entry->recordName(), entry);
- break;
- }
- } while (!line.isNull());
- }
-
- return bDefaultIapLoaded = bFoundDefaultIapTag;
- }
-
- static bool loadTestSettings() {
- if(bTestSettingsLoaded)
- return true;
-
- QFile cfgFile(iapFileFullPath);
- bool bFoundTestTag = false;
-
- if (cfgFile.open(QFile::ReadOnly)) {
- QTextStream input(&cfgFile);
- QString line;
- do {
- line = input.readLine().trimmed();
-
- if(line.startsWith(QString("#")) || line.length() == 0)
- continue; // comment or empty line found
-
- if(line.contains(QString("[TEST]"))) {
- bFoundTestTag = true;
- } else if(line.startsWith(QString("[")) && bFoundTestTag) {
- bFoundTestTag = false;
- break; // finished with test tag
- }
-
- if(bFoundTestTag) { // non-empty line
- int position = line.indexOf(QString("="));
-
- if(position <= 0) // not found
- continue;
-
- // found - extract
-
- QString recname = line.mid(0, position - QString("=").length()).trimmed();
- QString recval = line.mid(position + QString("=").length()).trimmed();
-
- //create record
- QtNetworkSettingsRecord *entry = new QtNetworkSettingsRecord(recname, recval);
- entries.insert(entry->recordName(), entry);
- }
- } while (!line.isNull());
- }
-
- return bTestSettingsLoaded = true;
- }
-#endif
-
-
};
-#ifdef Q_OS_SYMBIAN
-QHash<QString, QtNetworkSettingsRecord* > QtNetworkSettings::entries = QHash<QString, QtNetworkSettingsRecord* > ();
-bool QtNetworkSettings::bDefaultIapLoaded = false;
-bool QtNetworkSettings::bTestSettingsLoaded = false;
-QString QtNetworkSettings::iapFileFullPath = QString("C:\\Data\\iap.txt");
-QByteArray QtNetworkSettings::serverIp;
-QByteArray QtNetworkSettings::imapExpectedReply;
-QByteArray QtNetworkSettings::imapExpectedReplySsl;
-#endif
-
-#ifdef Q_OS_SYMBIAN
-#define Q_SET_DEFAULT_IAP QtNetworkSettings::setDefaultIap();
-#else
-#define Q_SET_DEFAULT_IAP
-#endif
#ifdef QT_NETWORK_LIB
class QtNetworkSettingsInitializerCode {
public:
QtNetworkSettingsInitializerCode() {
-#ifdef Q_OS_SYMBIAN
-#ifdef Q_CC_NOKIAX86
- // We have a non-trivial constructor in global static.
- // The QtNetworkSettings::serverName() uses native API which assumes
- // Cleanup-stack to exist. That's why we create it here and install
- // top level TRAP harness.
- CTrapCleanup *cleanupStack = q_check_ptr(CTrapCleanup::New());
- TRAPD(err,
- QHostInfo testServerResult = QHostInfo::fromName(QtNetworkSettings::serverName());
- if (testServerResult.error() != QHostInfo::NoError) {
- qWarning() << "Could not lookup" << QtNetworkSettings::serverName();
- qWarning() << "Please configure the test environment!";
- qWarning() << "See /etc/hosts or network-settings.h";
- qFatal("Exiting");
- }
- )
- delete cleanupStack;
-//#else
- // In Symbian HW there is no sense to run this check since global statics are
- // initialized before QTestLib initializes the output channel for QWarnigns.
- // So if there is problem network setup, also all QtCore etc tests whcih have
- // QtNetwork dependency will crash with panic "0 - Exiciting"
-#endif
-
-#else
QHostInfo testServerResult = QHostInfo::fromName(QtNetworkSettings::serverName());
if (testServerResult.error() != QHostInfo::NoError) {
qWarning() << "Could not lookup" << QtNetworkSettings::serverName();
qWarning() << "See /etc/hosts or network-settings.h";
qFatal("Exiting");
}
-#endif
}
};
QtNetworkSettingsInitializerCode qtNetworkSettingsInitializer;
QT -= gui
SOURCES += tst_qabstractnetworkcache.cpp
-wince*|symbian: {
+wince* {
testFiles.files = tests
testFiles.path = .
DEPLOYMENT += testFiles
}
-symbian: TARGET.CAPABILITY = NetworkServices
-
CONFIG += insignificant_test # QTBUG-20686; note, assumed unstable on all platforms
tst_QAbstractNetworkCache::tst_QAbstractNetworkCache()
{
- Q_SET_DEFAULT_IAP
-
QCoreApplication::setOrganizationName(QLatin1String("Trolltech"));
QCoreApplication::setApplicationName(QLatin1String("autotest_qabstractnetworkcache"));
QCoreApplication::setApplicationVersion(QLatin1String("1.0"));
addFiles.path = .
DEPLOYMENT += addFiles
DEFINES += SRCDIR=\\\"\\\"
-} else:symbian {
- addFiles.files = rfc3252.txt
- addFiles.path = .
- DEPLOYMENT += addFiles
- TARGET.EPOCHEAPSIZE="0x100 0x1000000"
- TARGET.CAPABILITY = NetworkServices
} else {
DEFINES += SRCDIR=\\\"$$PWD/\\\"
}
//TESTED_CLASS=
//TESTED_FILES=
-#ifdef Q_OS_SYMBIAN
-// In Symbian OS test data is located in applications private dir
-// Application private dir is default serach path for files, so SRCDIR can be set to empty
-#define SRCDIR ""
-#endif
-
#ifndef QT_NO_BEARERMANAGEMENT
Q_DECLARE_METATYPE(QNetworkConfiguration)
#endif
QTest::newRow( "get_fluke01" ) << QtNetworkSettings::serverName() << (uint)21 << QString("qtest/bigfile") << QByteArray();
QTest::newRow( "get_fluke02" ) << QtNetworkSettings::serverName() << (uint)21 << QString("qtest/rfc3252") << QByteArray();
- // Qt/CE and Symbian test environment has to less memory for this test
-#if !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN)
+ // Qt/CE test environment has too little memory for this test
+#if !defined(Q_OS_WINCE)
QByteArray bigData( 10*1024*1024, 0 );
#else
QByteArray bigData( 1*1024*1024, 0 );
addFiles.path = .
DEPLOYMENT += addFiles webFiles cgi
DEFINES += SRCDIR=\\\"\\\"
-} else:symbian {
- webFiles.files = webserver/*
- webFiles.path = webserver
- cgi.files = webserver/cgi-bin/*
- cgi.path = webserver/cgi-bin
- addFiles.files = rfc3252.txt trolltech
- addFiles.path = .
- DEPLOYMENT += addFiles webFiles cgi
- TARGET.CAPABILITY = NetworkServices
} else:vxworks*: {
DEFINES += SRCDIR=\\\"\\\"
} else {
//TESTED_CLASS=
//TESTED_FILES=
-#ifdef Q_OS_SYMBIAN
-// In Symbian OS test data is located in applications private dir
-// And underlying Open C have application private dir in default search path
-#define SRCDIR ""
-#endif
-
Q_DECLARE_METATYPE(QHttpResponseHeader)
class tst_QHttp : public QObject
tst_QHttp::tst_QHttp()
{
- Q_SET_DEFAULT_IAP
}
tst_QHttp::~tst_QHttp()
QT = core-private network-private
-symbian: TARGET.CAPABILITY = NetworkServices
-symbian: {
- INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE
-}
-
CONFIG+=insignificant_test # QTBUG-20981, crashes sometimes
tst_QHttpNetworkConnection::tst_QHttpNetworkConnection()
{
- Q_SET_DEFAULT_IAP
}
void tst_QHttpNetworkConnection::initTestCase()
requires(contains(QT_CONFIG,private_tests))
QT = core-private network-private
-symbian: TARGET.CAPABILITY = NetworkServices
load(qttest_p4)
SOURCES += tst_qnetworkaccessmanager.cpp
QT = core network
-
-symbian: TARGET.CAPABILITY = NetworkServices
-
QT -= gui
QT += network
SOURCES += tst_qnetworkcachemetadata.cpp
-
-symbian: TARGET.CAPABILITY = NetworkServices
-
SOURCES += tst_qnetworkcookie.cpp
QT = core network
-symbian: TARGET.CAPABILITY = NetworkServices
SOURCES += tst_qnetworkcookiejar.cpp
QT = core core-private network network-private
-symbian: TARGET.CAPABILITY = NetworkServices
QT -= gui
QT += network
SOURCES += tst_qnetworkdiskcache.cpp
-
-symbian: TARGET.CAPABILITY = NetworkServices
-
QT = core
CONFIG -= app_bundle debug_and_release_target
CONFIG += console
-
-symbian:TARGET.CAPABILITY="ALL -TCB"
requires(contains(QT_CONFIG,private_tests))
!wince*:SUBDIRS += echo
-symbian: TARGET.CAPABILITY = NetworkServices
}
}
-!symbian:DEFINES += SRCDIR=\\\"$$PWD/..\\\"
+DEFINES += SRCDIR=\\\"$$PWD/..\\\"
QT = core-private network-private
RESOURCES += ../qnetworkreply.qrc
-symbian|wince*:{
+wince* {
# For cross compiled targets, reference data files need to be deployed
addFiles.files = ../empty ../rfc3252.txt ../resource ../bigfile ../*.jpg
addFiles.path = .
certFiles.path = .
DEPLOYMENT += certFiles
}
-
-symbian:{
- # Symbian toolchain does not support correct include semantics
- INCLUDEPATH+=..\\..\\..\\..\\include\\QtNetwork\\private
- # bigfile test case requires more heap
- TARGET.EPOCHEAPSIZE="0x100 0x10000000"
- TARGET.CAPABILITY="ALL -TCB"
-}
#include "private/qnetworkaccessmanager_p.h"
-#ifdef Q_OS_SYMBIAN
-#define SRCDIR "."
-#endif
-
#include "../../../network-settings.h"
Q_DECLARE_METATYPE(QSharedPointer<char>)
QTcpSocket *active = new QTcpSocket(this);
active->connectToHost("127.0.0.1", server.serverPort());
-#ifndef Q_OS_SYMBIAN
+
// need more time as working with embedded
// device and testing from emualtor
// things tend to get slower
if (!server.waitForNewConnection(1000))
return false;
-#else
- if (!active->waitForConnected(100))
- return false;
- if (!server.waitForNewConnection(100))
- return false;
-#endif
QTcpSocket *passive = server.nextPendingConnection();
passive->setParent(this);
#endif
qRegisterMetaType<QNetworkReply::NetworkError>();
- Q_SET_DEFAULT_IAP
-
testFileName = QDir::currentPath() + "/testfile";
uniqueExtension = createUniqueExtension();
cookieJar = new MyCookieJar;
<< int(QNetworkReply::ContentOperationNotPermittedError) << 0 << true;
QTest::newRow("file-exist") << QUrl::fromLocalFile(QDir::currentPath() + "/this-file-doesnt-exist.txt").toString()
<< int(QNetworkReply::ContentNotFoundError) << 0 << true;
-#if !defined Q_OS_WIN && !defined(Q_OS_SYMBIAN)
+#if !defined Q_OS_WIN
QTest::newRow("file-is-wronly") << QUrl::fromLocalFile(wronlyFileName).toString()
<< int(QNetworkReply::ContentAccessDenied) << 0 << true;
#endif
void tst_QNetworkReply::ioPutToFileFromProcess()
{
-#if defined(Q_OS_WINCE) || defined (Q_OS_SYMBIAN)
- QSKIP("Currently no stdin/out supported for Windows CE / Symbian OS", SkipAll);
+#if defined(Q_OS_WINCE)
+ QSKIP("Currently no stdin/out supported for Windows CE", SkipAll);
#else
#ifdef Q_OS_WIN
QTest::newRow("empty") << 0;
QTest::newRow("small") << 4;
-#ifndef Q_OS_SYMBIAN
QTest::newRow("big") << 4096;
-#else
- // it can run even with 4096
- // but it takes lot time
- //especially on emulator
- QTest::newRow("big") << 1024;
-#endif
}
void tst_QNetworkReply::downloadProgress()
break;
}
-#ifdef Q_OS_SYMBIAN
- // see in qhttpnetworkconnection.cpp
- // hardcoded defaultChannelCount = 3
- QCOMPARE(pendingConnectionCount, 3);
-#else
QCOMPARE(pendingConnectionCount, 6);
-#endif
}
void tst_QNetworkReply::httpReUsingConnectionSequential_data()
QFETCH(bool, useDownloadBuffer);
// On my Linux Desktop the results are already visible with 128 kB, however we use this to have good results.
-#if defined(Q_OS_SYMBIAN) || defined(Q_WS_WINCE_WM)
+#if defined(Q_WS_WINCE_WM)
// Show some mercy to non-desktop platform/s
enum {UploadSize = 4*1024*1024}; // 4 MB
#else
SOURCES += tst_qnetworkrequest.cpp
QT = core network
-symbian: TARGET.CAPABILITY = NetworkServices
QT = core network
-symbian {
- TARGET.CAPABILITY = NetworkServices NetworkControl ReadUserData
-}
-
maemo6|maemo5 {
CONFIG += link_pkgconfig
*/
#include <QNetworkAccessManager>
-#if defined(Q_OS_UNIX) && !defined(QT_NO_ICD) && !defined (Q_OS_SYMBIAN)
+#if defined(Q_OS_UNIX) && !defined(QT_NO_ICD)
#include <stdio.h>
#include <iapconf.h>
#endif
void isRoamingAvailable();
private:
-#if defined(Q_OS_UNIX) && !defined(QT_NO_ICD) && !defined (Q_OS_SYMBIAN)
+#if defined(Q_OS_UNIX) && !defined(QT_NO_ICD)
Maemo::IAPConf *iapconf;
Maemo::IAPConf *iapconf2;
Maemo::IAPConf *gprsiap;
void tst_QNetworkConfiguration::initTestCase()
{
-#if defined(Q_OS_UNIX) && !defined(QT_NO_ICD) && !defined (Q_OS_SYMBIAN)
+#if defined(Q_OS_UNIX) && !defined(QT_NO_ICD)
iapconf = new Maemo::IAPConf("007");
iapconf->setValue("ipv4_type", "AUTO");
iapconf->setValue("wlan_wepkey1", "connt");
void tst_QNetworkConfiguration::cleanupTestCase()
{
-#if defined(Q_OS_UNIX) && !defined(QT_NO_ICD) && !defined (Q_OS_SYMBIAN)
+#if defined(Q_OS_UNIX) && !defined(QT_NO_ICD)
iapconf->clear();
delete iapconf;
iapconf2->clear();
QT = core network
-symbian {
- TARGET.CAPABILITY = NetworkServices NetworkControl ReadUserData
-}
-
maemo6|maemo5 {
CONFIG += link_pkgconfig
#include <QtNetwork/qnetworkconfiguration.h>
#include <QtNetwork/qnetworkconfigmanager.h>
-#if defined(Q_OS_UNIX) && !defined(QT_NO_ICD) && !defined (Q_OS_SYMBIAN)
+#if defined(Q_OS_UNIX) && !defined(QT_NO_ICD)
#include <stdio.h>
#include <iapconf.h>
#endif
void configurationFromIdentifier();
private:
-#if defined(Q_OS_UNIX) && !defined(QT_NO_ICD) && !defined (Q_OS_SYMBIAN)
+#if defined(Q_OS_UNIX) && !defined(QT_NO_ICD)
Maemo::IAPConf *iapconf;
Maemo::IAPConf *iapconf2;
Maemo::IAPConf *gprsiap;
void tst_QNetworkConfigurationManager::initTestCase()
{
-#if defined(Q_OS_UNIX) && !defined(QT_NO_ICD) && !defined (Q_OS_SYMBIAN)
+#if defined(Q_OS_UNIX) && !defined(QT_NO_ICD)
iapconf = new Maemo::IAPConf("007");
iapconf->setValue("ipv4_type", "AUTO");
iapconf->setValue("wlan_wepkey1", "connt");
void tst_QNetworkConfigurationManager::cleanupTestCase()
{
-#if defined(Q_OS_UNIX) && !defined(QT_NO_ICD) && !defined (Q_OS_SYMBIAN)
+#if defined(Q_OS_UNIX) && !defined(QT_NO_ICD)
iapconf->clear();
delete iapconf;
iapconf2->clear();
win32:CONFIG += console
mac:CONFIG -= app_bundle
-
-symbian {
- # Needed for interprocess communication and opening QNetworkSession
- TARGET.CAPABILITY = NetworkControl NetworkServices
-}
-
return NO_DISCOVERED_CONFIGURATIONS_ERROR;
}
- // Cannot read/write to processes on WinCE or Symbian.
+ // Cannot read/write to processes on WinCE.
// Easiest alternative is to use sockets for IPC.
QLocalSocket oopSocket;
TEMPLATE = subdirs
SUBDIRS = lackey test
-symbian: TARGET.CAPABILITY = NetworkServices
DESTDIR = ..
}
-symbian {
- TARGET.CAPABILITY = NetworkServices NetworkControl ReadUserData PowerMgmt
-}
-
maemo6|maemo5 {
CONFIG += link_pkgconfig
#include <QtNetwork/qnetworkconfigmanager.h>
#include <QtNetwork/qnetworksession.h>
-#if defined(Q_OS_UNIX) && !defined(QT_NO_ICD) && !defined (Q_OS_SYMBIAN)
+#if defined(Q_OS_UNIX) && !defined(QT_NO_ICD)
#include <stdio.h>
#include <iapconf.h>
#endif
void repeatedOpenClose_data();
void repeatedOpenClose();
- void sessionStop_data();
- void sessionStop();
-
- void roamingErrorCodes();
-
void sessionProperties_data();
void sessionProperties();
int inProcessSessionManagementCount;
-#if defined(Q_OS_UNIX) && !defined(QT_NO_ICD) && !defined (Q_OS_SYMBIAN)
+#if defined(Q_OS_UNIX) && !defined(QT_NO_ICD)
Maemo::IAPConf *iapconf;
Maemo::IAPConf *iapconf2;
Maemo::IAPConf *gprsiap;
testsToRun["outOfProcessSession"] = true;
testsToRun["invalidSession"] = true;
testsToRun["repeatedOpenClose"] = true;
- testsToRun["roamingErrorCodes"] = true;
- testsToRun["sessionStop"] = true;
testsToRun["sessionProperties"] = true;
testsToRun["userChoiceSession"] = true;
testsToRun["sessionOpenCloseStop"] = true;
-
-#if defined(Q_OS_UNIX) && !defined(QT_NO_ICD) && !defined (Q_OS_SYMBIAN)
+
+#if defined(Q_OS_UNIX) && !defined(QT_NO_ICD)
iapconf = new Maemo::IAPConf("007");
iapconf->setValue("ipv4_type", "AUTO");
iapconf->setValue("wlan_wepkey1", "connt");
"inProcessSessionManagement()");
}
-#if defined(Q_OS_UNIX) && !defined(QT_NO_ICD) && !defined (Q_OS_SYMBIAN)
+#if defined(Q_OS_UNIX) && !defined(QT_NO_ICD)
iapconf->clear();
delete iapconf;
iapconf2->clear();
qDebug() << "Add the WLAN IAP back (waiting 60 seconds): " << invalidatedConfig.name();
QTest::qWait(60000);
}
-
+
QNetworkConfiguration definedConfig = suitableConfiguration("WLAN",QNetworkConfiguration::InternetAccessPoint);
if (definedConfig.isValid()) {
// 4. Verify that opening a session with defined configuration emits error and enters notavailable-state
updateConfigurations();
definedSession.open();
-#ifdef Q_OS_SYMBIAN
- // On symbian, the connection opening is tried even with defined state.
- qDebug("Waiting for 10 seconds to all signals to propagate.");
- QTest::qWait(10000);
-#endif
updateConfigurations();
QVERIFY(definedConfig.isValid()); // Session remains valid
QVERIFY(sessionError == QNetworkSession::InvalidConfigurationError);
qDebug() << "Turn the WLAN IAP back on (waiting 60 seconds): " << definedConfig.name();
QTest::qWait(60000);
- updateConfigurations();
+ updateConfigurations();
QVERIFY(definedConfig.state() == QNetworkConfiguration::Discovered);
}
-
#endif
}
// QNetworkSession::interface() should return an invalid interface unless
// session is in the connected state.
#ifndef QT_NO_NETWORKINTERFACE
-#if !(defined(Q_OS_SYMBIAN) && defined(__WINS__))
- // On Symbian emulator, the support for data bearers is limited
QCOMPARE(session.state() == QNetworkSession::Connected, session.interface().isValid());
#endif
-#endif
if (!configuration.isValid()) {
QVERIFY(configuration.state() == QNetworkConfiguration::Undefined &&
}
}
-void tst_QNetworkSession::roamingErrorCodes()
-{
- if (!testsToRun["roamingErrorCodes"]) {
- QSKIP("Temporary skip due to value set false (or it is missing) in testsToRun map", SkipAll);
- }
-#ifndef Q_OS_SYMBIAN
- QSKIP("Roaming supported on Symbian.", SkipAll);
-#else
- QNetworkConfiguration wlanIapConfig = suitableConfiguration("WLAN", QNetworkConfiguration::InternetAccessPoint);
- if (!wlanIapConfig.isValid()) {
- QSKIP("No WLAN IAP accessible, skipping test.", SkipAll);
- }
- // Check that opening and closing two sessions on same config work gracefully:
- QNetworkSession iapSession(wlanIapConfig);
- QVERIFY(openSession(&iapSession));
- QNetworkSession adminIapSession(wlanIapConfig);
- QVERIFY(openSession(&adminIapSession));
- QVERIFY(closeSession(&iapSession, false)); // false == not a last session based on the configuration
- QVERIFY(closeSession(&adminIapSession));
-
- // Open configurations again, force close bearer and check that errors are emitted correctly
- // on the other session
- QVERIFY(openSession(&iapSession));
- QVERIFY(openSession(&adminIapSession));
- QSignalSpy errorSpy(&iapSession, SIGNAL(error(QNetworkSession::SessionError)));
- adminIapSession.stop(); // requires NetworkControl capabilities
- QTRY_VERIFY(!errorSpy.isEmpty()); // wait for error signals
- QNetworkSession::SessionError error = qvariant_cast<QNetworkSession::SessionError>(errorSpy.first().at(0));
- QTest::qWait(2000); // Wait for a moment to all platform signals to propagate
- QVERIFY(error == QNetworkSession::SessionAbortedError);
- QVERIFY(iapSession.state() == QNetworkSession::Disconnected);
- QVERIFY(adminIapSession.state() == QNetworkSession::Disconnected);
-#endif // Q_OS_SYMBIAN
-}
-
-
-void tst_QNetworkSession::sessionStop_data() {
- QTest::addColumn<QString>("bearerType");
- QTest::addColumn<QNetworkConfiguration::Type>("configurationType");
-
- QTest::newRow("SNAP") << "bearer_type_not_relevant_with_SNAPs" << QNetworkConfiguration::ServiceNetwork;
- QTest::newRow("WLAN_IAP") << "WLAN" << QNetworkConfiguration::InternetAccessPoint;
- QTest::newRow("Cellular_IAP") << "cellular" << QNetworkConfiguration::InternetAccessPoint;
-}
-
-void tst_QNetworkSession::sessionStop()
-{
- if (!testsToRun["sessionStop"]) {
- QSKIP("Temporary skip due to value set false (or it is missing) in testsToRun map", SkipAll);
- }
-#ifndef Q_OS_SYMBIAN
- QSKIP("Testcase contains mainly Symbian specific checks, because it is only platform to really support interface (IAP-level) Stop.", SkipAll);
-#endif
- QFETCH(QString, bearerType);
- QFETCH(QNetworkConfiguration::Type, configurationType);
-
- int configWaitdelayInMs = 2000;
-
- updateConfigurations();
- printConfigurations();
-
- QNetworkConfiguration config = suitableConfiguration(bearerType, configurationType);
- if (!config.isValid()) {
- QSKIP("No suitable configurations, skipping this round of session stop test.", SkipSingle);
- }
- qDebug() << "Using following configuration to open and stop a session: " << config.name();
-
- QNetworkSession openedSession(config);
- QNetworkSession closedSession(config);
- QNetworkSession innocentSession(config);
- QNetworkConfigurationManager mgr;
-
- QSignalSpy closedSessionOpenedSpy(&closedSession, SIGNAL(opened()));
- QSignalSpy closedSessionClosedSpy(&closedSession, SIGNAL(closed()));
- QSignalSpy closedSessionStateChangedSpy(&closedSession, SIGNAL(stateChanged(QNetworkSession::State)));
- QSignalSpy closedErrorSpy(&closedSession, SIGNAL(error(QNetworkSession::SessionError)));
-
- QSignalSpy openedSessionClosedSpy(&openedSession, SIGNAL(closed()));
- QSignalSpy openedSessionStateChangedSpy(&openedSession, SIGNAL(stateChanged(QNetworkSession::State)));
-
- QSignalSpy innocentSessionClosedSpy(&innocentSession, SIGNAL(closed()));
- QSignalSpy innocentSessionStateChangedSpy(&innocentSession, SIGNAL(stateChanged(QNetworkSession::State)));
- QSignalSpy innocentErrorSpy(&innocentSession, SIGNAL(error(QNetworkSession::SessionError)));
- QNetworkSession::SessionError sessionError;
-
- // 1. Verify that stopping an opened session works (the simplest usecase).
- qDebug("----------1. Verify that stopping an opened session works (the simplest usecase)");
- QSignalSpy configChangeSpy(&mgr, SIGNAL(configurationChanged(QNetworkConfiguration)));
- QVERIFY(openSession(&openedSession));
- qDebug("Waiting for %d ms to get all configurationChange signals from platform.", configWaitdelayInMs);
- // Clear signals caused by opening
- closedSessionOpenedSpy.clear();
- closedSessionClosedSpy.clear();
- closedSessionStateChangedSpy.clear();
- closedErrorSpy.clear();
- openedSessionStateChangedSpy.clear();
- openedSessionClosedSpy.clear();
-
- openedSession.stop();
-
- qDebug("Waiting for %d ms to get all configurationChange signals from platform.", configWaitdelayInMs);
- QTest::qWait(configWaitdelayInMs); // Wait to get all relevant configurationChange() signals
-
- // First to closing, then to disconnected
- QVERIFY(openedSessionStateChangedSpy.count() == 2);
- QVERIFY(!openedSessionClosedSpy.isEmpty());
- QVERIFY(openedSession.state() == QNetworkSession::Disconnected);
- QVERIFY(config.state() != QNetworkConfiguration::Active);
-
- // 2. Verify that stopping a session based on non-connected configuration does nothing
- qDebug("----------2. Verify that stopping a session based on non-connected configuration does nothing");
- QNetworkSession::State closedSessionOriginalState = closedSession.state();
- // Clear all possible signals
- configChangeSpy.clear();
- closedSessionOpenedSpy.clear();
- closedSessionClosedSpy.clear();
- closedSessionStateChangedSpy.clear();
- closedErrorSpy.clear();
-
- closedSession.stop();
- qDebug("Waiting for %d ms to get all configurationChange signals from platform.", configWaitdelayInMs);
- QTest::qWait(configWaitdelayInMs); // Wait to get all relevant configurationChange() signals
-
- QVERIFY(closedSessionOpenedSpy.isEmpty());
- QVERIFY(closedSessionClosedSpy.isEmpty());
- QVERIFY(closedSessionStateChangedSpy.isEmpty());
- QVERIFY(closedErrorSpy.isEmpty());
- QVERIFY(closedSession.state() == closedSessionOriginalState); // State remains
-
- // 3. Check that stopping a opened session affects also other opened session based on the same configuration.
- if (config.type() == QNetworkConfiguration::InternetAccessPoint) {
- qDebug("----------3. Check that stopping a opened session affects also other opened session based on the same configuration.");
-
- QVERIFY(openSession(&openedSession));
- QVERIFY(openSession(&innocentSession));
-
- configChangeSpy.clear();
- innocentSessionClosedSpy.clear();
- innocentSessionStateChangedSpy.clear();
- innocentErrorSpy.clear();
-
- openedSession.stop();
- qDebug("Waiting for %d ms to get all configurationChange signals from platform.", configWaitdelayInMs);
- QTest::qWait(configWaitdelayInMs); // Wait to get all relevant configurationChange() signals
- QTest::qWait(configWaitdelayInMs); // Wait to get all relevant configurationChange() signals
-
- QVERIFY(!innocentSessionClosedSpy.isEmpty());
- QVERIFY(!innocentSessionStateChangedSpy.isEmpty());
- QVERIFY(!innocentErrorSpy.isEmpty());
- QVERIFY(innocentSession.state() == QNetworkSession::Disconnected);
- QVERIFY(openedSession.state() == QNetworkSession::Disconnected);
- sessionError = qvariant_cast<QNetworkSession::SessionError>(innocentErrorSpy.first().at(0));
- QVERIFY(sessionError == QNetworkSession::SessionAbortedError);
-
- innocentSessionClosedSpy.clear();
- innocentSessionStateChangedSpy.clear();
- innocentErrorSpy.clear();
- } else {
- qDebug("----------3. Skip for SNAP configuration.");
- }
- // 4. Check that stopping a non-opened session stops the other session based on the
- // same configuration if configuration is IAP. Stopping closed SNAP session has no impact on other opened SNAP session.
- if (config.type() == QNetworkConfiguration::ServiceNetwork) {
- qDebug("----------4. Skip for SNAP configuration.");
- } else if (config.type() == QNetworkConfiguration::InternetAccessPoint) {
- qDebug("----------4. Check that stopping a non-opened session stops the other session based on the same configuration");
- qDebug("----------4.1 Opening innocent session");
- QVERIFY(openSession(&innocentSession));
- qDebug("Waiting for %d ms after open to make sure all platform indications are propagated", configWaitdelayInMs);
- QTest::qWait(configWaitdelayInMs);
- qDebug("----------4.2 Calling closedSession.stop()");
- closedSession.stop();
- qDebug("Waiting for %d ms to get all configurationChange signals from platform..", configWaitdelayInMs);
- QTest::qWait(configWaitdelayInMs); // Wait to get all relevant configurationChange() signals
-
- QTest::qWait(configWaitdelayInMs);
- QTest::qWait(configWaitdelayInMs);
-
- QVERIFY(!innocentSessionClosedSpy.isEmpty());
- QVERIFY(!innocentSessionStateChangedSpy.isEmpty());
- QVERIFY(!innocentErrorSpy.isEmpty());
- QVERIFY(innocentSession.state() == QNetworkSession::Disconnected);
- QVERIFY(closedSession.state() == QNetworkSession::Disconnected);
- sessionError = qvariant_cast<QNetworkSession::SessionError>(innocentErrorSpy.first().at(0));
- QVERIFY(sessionError == QNetworkSession::SessionAbortedError);
- QVERIFY(config.state() == QNetworkConfiguration::Discovered);
- }
-
- // 5. Sanity check that stopping invalid session does not crash
- qDebug("----------5. Sanity check that stopping invalid session does not crash");
- QNetworkSession invalidSession(QNetworkConfiguration(), 0);
- QVERIFY(invalidSession.state() == QNetworkSession::Invalid);
- invalidSession.stop();
- QVERIFY(invalidSession.state() == QNetworkSession::Invalid);
-}
-
void tst_QNetworkSession::userChoiceSession_data()
{
QTest::addColumn<QNetworkConfiguration>("configuration");
bool expectStateChange = session.state() != QNetworkSession::Connected;
session.open();
-
-#if defined(Q_OS_SYMBIAN)
- // Opening & closing multiple connections in a row sometimes
- // results hanging of connection opening on Symbian devices
- // => If first open fails, wait a moment and try again.
- if (!session.waitForOpened()) {
- qDebug("**** Session open Timeout - Wait 5 seconds and try once again ****");
- session.close();
- QTest::qWait(5000); // Wait a while before trying to open session again
- session.open();
- session.waitForOpened();
- }
-#else
session.waitForOpened();
-#endif
if (session.isOpen())
QVERIFY(!sessionOpenedSpy.isEmpty() || !errorSpy.isEmpty());
QVERIFY(session.state() == QNetworkSession::Connected);
#ifndef QT_NO_NETWORKINTERFACE
-#if !(defined(Q_OS_SYMBIAN) && defined(__WINS__))
- // On Symbian emulator, the support for data bearers is limited
QVERIFY(session.interface().isValid());
#endif
-#endif
-
const QString userChoiceIdentifier =
session.sessionProperty("UserChoiceConfiguration").toString();
bool expectStateChange = previousState != QNetworkSession::Connected;
session.open();
-
-#if defined(Q_OS_SYMBIAN)
- // Opening & closing multiple connections in a row sometimes
- // results hanging of connection opening on Symbian devices
- // => If first open fails, wait a moment and try again.
- if (!session.waitForOpened()) {
- qDebug("**** Session open Timeout - Wait 5 seconds and try once again ****");
- session.close();
- QTest::qWait(5000); // Wait a while before trying to open session again
- session.open();
- session.waitForOpened();
- }
-#else
session.waitForOpened();
-#endif
// Wait until the configuration is uptodate as well, it may be signaled 'connected'
// bit later than the session
QVERIFY(session.state() == QNetworkSession::Connected);
#ifndef QT_NO_NETWORKINTERFACE
-#if !(defined(Q_OS_SYMBIAN) && defined(__WINS__))
- // On Symbian emulator, the support for data bearers is limited
QVERIFY(session.interface().isValid());
#endif
-#endif
} else {
QFAIL("Timeout waiting for session to open.");
}
QVERIFY(session.isOpen());
QVERIFY(session.state() == QNetworkSession::Connected);
#ifndef QT_NO_NETWORKINTERFACE
-#if !(defined(Q_OS_SYMBIAN) && defined(__WINS__))
- // On Symbian emulator, the support for data bearers is limited
QVERIFY(session.interface().isValid());
-#endif
if (errorSpy2.isEmpty()) {
QCOMPARE(session.interface().hardwareAddress(), session2.interface().hardwareAddress());
QCOMPARE(session.interface().index(), session2.interface().index());
if (forceSessionStop && session2.isOpen()) {
// Test forcing the second session to stop the interface.
QNetworkSession::State previousState = session.state();
-#ifdef Q_CC_NOKIAX86
- // For S60 emulator builds: RConnection::Stop does not work on all Emulators
- bool expectStateChange = false;
-#else
bool expectStateChange = previousState != QNetworkSession::Disconnected;
-#endif
session2.stop();
// QNetworkSession::stop() must result either closed() signal
session.stop();
QTRY_VERIFY(session.state() == QNetworkSession::Disconnected);
}
-#ifndef Q_CC_NOKIAX86
if (!roamedSuccessfully)
QVERIFY(!errorSpy.isEmpty());
-#endif
} else {
QTest::qWait(2000); // Wait awhile to get all signals from platform
QNetworkSession::State state =
qvariant_cast<QNetworkSession::State>(stateChangedSpy2.at(stateChangedSpy2.count() - 1).at(0));
- // Symbian version dependant.
QVERIFY(state == QNetworkSession::Disconnected);
}
}
QFAIL("Timeout waiting for session to stop.");
}
-#ifndef Q_CC_NOKIAX86
QVERIFY(!sessionClosedSpy.isEmpty());
-#endif
QVERIFY(!sessionClosedSpy2.isEmpty());
-#ifndef Q_CC_NOKIAX86
QVERIFY(!session.isOpen());
-#endif
QVERIFY(!session2.isOpen());
} else if (session2.isOpen()) {
// Test closing the second session.
session2.close();
QTRY_VERIFY(!sessionClosedSpy2.isEmpty());
-#ifndef Q_CC_NOKIAX86
QVERIFY(stateChangedSpy2.count() == stateChangedCountBeforeClose);
-#endif
QVERIFY(sessionClosedSpy.isEmpty());
QVERIFY(session.state() == QNetworkSession::Connected);
QVERIFY(session2.state() == QNetworkSession::Connected);
#ifndef QT_NO_NETWORKINTERFACE
-#if !(defined(Q_OS_SYMBIAN) && defined(__WINS__))
- // On Symbian emulator, the support for data bearers is limited
QVERIFY(session.interface().isValid());
-#endif
QCOMPARE(session.interface().hardwareAddress(), session2.interface().hardwareAddress());
QCOMPARE(session.interface().index(), session2.interface().index());
#endif
// Test closing the first session.
{
-#ifdef Q_CC_NOKIAX86
- // For S60 emulator builds: RConnection::Close does not actually
- // close network connection on all Emulators
- bool expectStateChange = false;
-#else
bool expectStateChange = session.state() != QNetworkSession::Disconnected &&
manager.capabilities() & QNetworkConfigurationManager::SystemSessionSupport;
-#endif
session.close();
if (!testsToRun["outOfProcessSession"]) {
QSKIP("Temporary skip due to value set false (or it is missing) in testsToRun map", SkipAll);
}
-#if defined(Q_OS_SYMBIAN) && defined(__WINS__)
- QSKIP("Symbian emulator does not support two [QR]PRocesses linking a dll (QtBearer.dll) with global writeable static data.", SkipAll);
-#endif
- updateConfigurations();
- QTest::qWait(2000);
-
+ updateConfigurations();
+ QTest::qWait(2000);
+
QNetworkConfigurationManager manager;
// Create a QNetworkConfigurationManager to detect configuration changes made in Lackey. This
// is actually the essence of this testcase - to check that platform mediates/reflects changes
QList<QNetworkConfiguration> before = manager.allConfigurations(QNetworkConfiguration::Active);
QSignalSpy spy(&manager, SIGNAL(configurationChanged(QNetworkConfiguration)));
- // Cannot read/write to processes on WinCE or Symbian.
+ // Cannot read/write to processes on WinCE.
// Easiest alternative is to use sockets for IPC.
QLocalServer oopServer;
// First remove possible earlier listening address which would cause listen to fail
LIBS += -lws2_32
}
}
-
-symbian: TARGET.CAPABILITY = NetworkServices
} else {
win32:LIBS += -lws2_32
}
-
-symbian: TARGET.CAPABILITY = NetworkServices
-symbian: {
- INCLUDEPATH *= $$MW_LAYER_SYSTEMINCLUDE
-}
tst_QHostInfo::tst_QHostInfo()
{
- Q_SET_DEFAULT_IAP
}
tst_QHostInfo::~tst_QHostInfo()
}
#endif
-#ifdef Q_OS_SYMBIAN
- ipv6Available = true;
- ipv6LookupsAvailable = true;
-#else
ipv6Available = false;
ipv6LookupsAvailable = false;
}
}
#endif
-#endif
// run each testcase with and without test enabled
QTest::addColumn<bool>("cache");
void tst_QHostInfo::threadSafety()
{
const int nattempts = 5;
-#if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
+#if defined(Q_OS_WINCE)
const int runs = 10;
#else
const int runs = 100;
SOURCES += tst_qnetworkaddressentry.cpp
QT = core network
-
-symbian: TARGET.CAPABILITY = NetworkServices
SOURCES += tst_qnetworkinterface.cpp
QT = core network
-
-symbian: TARGET.CAPABILITY = NetworkServices
-
QT = core network
SOURCES += tst_qnetworkproxy.cpp
-
-symbian: TARGET.CAPABILITY = NetworkServices
-
+++ /dev/null
-tst_qnetworkproxyfactory_symbian
QT = core network
SOURCES += tst_qnetworkproxyfactory.cpp
-
-symbian: TARGET.CAPABILITY = NetworkServices ReadUserData
-
MOC_DIR=tmp
QT = core-private network-private
-
-symbian {
- TARGET.CAPABILITY = NetworkServices
- INCLUDEPATH += $$OS_LAYER_SYSTEMINCLUDE
- LIBS += -lesock
-}
**
****************************************************************************/
-
#include <QtTest/QTest>
#ifdef Q_OS_WIN
#endif
#include <qcoreapplication.h>
-
-
#include <qdatastream.h>
-
#include <qhostaddress.h>
#include <qdatetime.h>
#include <stddef.h>
-#ifdef Q_OS_SYMBIAN
-#include <QNetworkConfigurationManager>
-#include <QNetworkConfiguration>
-#include <QNetworkSession>
-#include <QScopedPointer>
-#define PLATFORMSOCKETENGINE QSymbianSocketEngine
-#define PLATFORMSOCKETENGINESTRING "QSymbianSocketEngine"
-#include <private/qsymbiansocketengine_p.h>
-#include <private/qcore_symbian_p.h>
-#else
#define PLATFORMSOCKETENGINE QNativeSocketEngine
#define PLATFORMSOCKETENGINESTRING "QNativeSocketEngine"
#include <private/qnativesocketengine_p.h>
-#endif
#include <qstringlist.h>
tst_PlatformSocketEngine::tst_PlatformSocketEngine()
{
- Q_SET_DEFAULT_IAP
}
tst_PlatformSocketEngine::~tst_PlatformSocketEngine()
//---------------------------------------------------------------------------
void tst_PlatformSocketEngine::broadcastTest()
{
-#ifdef Q_OS_SYMBIAN
- //broadcast isn't supported on loopback connections, but is on WLAN
-#ifndef QT_NO_BEARERMANAGEMENT
- QScopedPointer<QNetworkConfigurationManager> netConfMan(new QNetworkConfigurationManager());
- QNetworkConfiguration networkConfiguration(netConfMan->defaultConfiguration());
- QScopedPointer<QNetworkSession> networkSession(new QNetworkSession(networkConfiguration));
- if (!networkSession->isOpen()) {
- networkSession->open();
- bool ok = networkSession->waitForOpened(30000);
- qDebug() << networkSession->isOpen() << networkSession->error() << networkSession->errorString();
- QVERIFY(ok);
- }
-#endif
-#endif
#ifdef Q_OS_AIX
QSKIP("Broadcast does not work on darko", SkipAll);
#endif
QHostAddress::Broadcast,
port);
-#ifdef Q_OS_SYMBIAN
- //On symbian, broadcasts return 0 bytes written if none of the interfaces support it.
- //Notably the loopback interfaces do not. (though they do support multicast!?)
- if (written == 0)
- QEXPECT_FAIL("", "No active interface supports broadcast", Abort);
-#endif
QCOMPARE((int)written, trollMessage.size());
// Wait until we receive it ourselves
//---------------------------------------------------------------------------
void tst_PlatformSocketEngine::udpLoopbackPerformance()
{
-#ifdef SYMBIAN_WINSOCK_CONNECTIVITY
- QSKIP("Not working on Emulator without WinPCAP", SkipAll);
-#endif
PLATFORMSOCKETENGINE udpSocket;
// Initialize device #1
QVERIFY(serverSocket.initialize(socketDescriptor));
QVERIFY(serverSocket.state() == QAbstractSocket::ConnectedState);
-#if defined (Q_OS_SYMBIAN) && defined (__WINS__)
- const int messageSize = 1024 * 16;
-#else
const int messageSize = 1024 * 256;
-#endif
QByteArray message1(messageSize, '@');
QByteArray answer(messageSize, '@');
//---------------------------------------------------------------------------
void tst_PlatformSocketEngine::bind()
{
-#if !defined Q_OS_WIN && !defined Q_OS_SYMBIAN
+#if !defined Q_OS_WIN
PLATFORMSOCKETENGINE binder;
QVERIFY(binder.initialize(QAbstractSocket::TcpSocket, QAbstractSocket::IPv4Protocol));
QVERIFY(!binder.bind(QHostAddress::Any, 82));
PLATFORMSOCKETENGINE binder3;
QVERIFY(binder3.initialize(QAbstractSocket::TcpSocket, QAbstractSocket::IPv4Protocol));
QVERIFY(!binder3.bind(QHostAddress::Any, 31180));
-
-#ifdef SYMBIAN_WINSOCK_CONNECTIVITY
- qDebug("On Symbian Emulator (WinSock) we get EADDRNOTAVAIL instead of EADDRINUSE");
- QVERIFY(binder3.error() == QAbstractSocket::SocketAddressNotAvailableError);
-#else
QVERIFY(binder3.error() == QAbstractSocket::AddressInUseError);
-#endif
}
//---------------------------------------------------------------------------
#ifdef Q_OS_WIN
// could use shutdown to produce different errors
::closesocket(client.socketDescriptor());
-#elif defined(Q_OS_SYMBIAN)
- RSocket sock;
- QVERIFY(QSymbianSocketManager::instance().lookupSocket(client.socketDescriptor(), sock));
- TRequestStatus stat;
- sock.Shutdown(RSocket::EImmediate, stat);
- User::WaitForRequest(stat);
#else
::close(client.socketDescriptor());
#endif
// The server sends an urgent message
msg = 'Q';
-#if defined(Q_OS_SYMBIAN)
- RSocket sock;
- QVERIFY(QSymbianSocketManager::instance().lookupSocket(socketDescriptor, sock));
- TRequestStatus stat;
- TSockXfrLength len;
- sock.Send(TPtrC8((TUint8*)&msg,1), KSockWriteUrgent, stat, len);
- User::WaitForRequest(stat);
- QVERIFY(stat == KErrNone);
- QCOMPARE(len(), 1);
-#else
QCOMPARE(int(::send(socketDescriptor, &msg, sizeof(msg), MSG_OOB)), 1);
-#endif
// The client receives the urgent message
QVERIFY(client.waitForRead());
// The client sends an urgent message
msg = 'T';
int clientDescriptor = client.socketDescriptor();
-#if defined(Q_OS_SYMBIAN)
- QVERIFY(QSymbianSocketManager::instance().lookupSocket(clientDescriptor, sock));
- sock.Send(TPtrC8((TUint8*)&msg,1), KSockWriteUrgent, stat, len);
- User::WaitForRequest(stat);
- QVERIFY(stat == KErrNone);
- QCOMPARE(len(), 1);
-#else
QCOMPARE(int(::send(clientDescriptor, &msg, sizeof(msg), MSG_OOB)), 1);
-#endif
// The server receives the urgent message
QVERIFY(serverSocket.waitForRead());
response.resize(available);
QCOMPARE(serverSocket.read(response.data(), response.size()), qint64(1));
QCOMPARE(response.at(0), msg);
-
}
QTEST_MAIN(tst_PlatformSocketEngine)
SOURCES += tst_qabstractsocket.cpp
-symbian: TARGET.CAPABILITY = NetworkServices
-
QT = core-private network-private
-symbian: TARGET.CAPABILITY = NetworkServices
-
-
tst_QHttpSocketEngine::tst_QHttpSocketEngine()
{
- Q_SET_DEFAULT_IAP
}
tst_QHttpSocketEngine::~tst_QHttpSocketEngine()
QTime stopWatch;
stopWatch.start();
-#if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
+#if defined(Q_OS_WINCE)
QTestEventLoop::instance().enterLoop(240);
#else
QTestEventLoop::instance().enterLoop(60);
SOURCES += main.cpp
TARGET = lackey
-
-symbian:TARGET.CAPABILITY = ALL -TCB
TEMPLATE = subdirs
SUBDIRS = test # lackey should be moved to the QtScript module
-!wince*:!symbian: SUBDIRS += example
-symbian: TARGET.CAPABILITY = NetworkServices
+!wince*: SUBDIRS += example
DEFINES += QLOCALSERVER_DEBUG
DEFINES += QLOCALSOCKET_DEBUG
-symbian {
- # nothing
-} else:wince* {
+wince* {
DEFINES += QT_LOCALSOCKET_TCP
DEFINES += SRCDIR=\\\"../\\\"
} else {
additionalFiles.path = lackey
}
-symbian {
- additionalFiles.files = lackey.exe
- additionalFiles.path = \\sys\\bin
- TARGET.UID3 = 0xE0340005
- DEFINES += SYMBIAN_SRCDIR_UID=$$lower($$replace(TARGET.UID3,"0x",""))
-}
-
-wince*|symbian {
+wince* {
scriptFiles.files = ../lackey/scripts/*.js
scriptFiles.path = lackey/scripts
DEPLOYMENT += additionalFiles scriptFiles
#include <QtNetwork/qlocalserver.h>
#include "../../../../shared/util.h"
-#ifdef Q_OS_SYMBIAN
- #include <unistd.h>
-#endif
//TESTED_CLASS=QLocalServer, QLocalSocket
//TESTED_FILES=network/socket/qlocalserver.cpp network/socket/qlocalsocket.cpp
-#ifdef Q_OS_SYMBIAN
- #define STRINGIFY(x) #x
- #define TOSTRING(x) STRINGIFY(x)
- #define SRCDIR "C:/Private/" TOSTRING(SYMBIAN_SRCDIR_UID) "/"
-#endif
+
Q_DECLARE_METATYPE(QLocalSocket::LocalSocketError)
Q_DECLARE_METATYPE(QLocalSocket::LocalSocketState)
void bytesWrittenSignal();
void syncDisconnectNotify();
void asyncDisconnectNotify();
-
-#ifdef Q_OS_SYMBIAN
-private:
- void unlink(QString serverName);
-#endif
};
tst_QLocalSocket::tst_QLocalSocket()
QSignalSpy spyNewConnection(&server, SIGNAL(newConnection()));
QFETCH(QString, name);
-#ifdef Q_OS_SYMBIAN
- unlink(name);
-#endif
QFETCH(bool, canListen);
QFETCH(bool, close);
QVERIFY2((server.listen(name) == canListen), server.errorString().toLatin1().constData());
QFETCH(QString, name);
QFETCH(bool, canListen);
-#ifdef Q_OS_SYMBIAN
- unlink(name);
-#endif
QCOMPARE(server.listen(name), canListen);
QTest::qWait(1000);
//QVERIFY(!server.errorString().isEmpty());
void tst_QLocalSocket::sendData()
{
QFETCH(QString, name);
-#ifdef Q_OS_SYMBIAN
- unlink(name);
-#endif
QFETCH(bool, canListen);
LocalServer server;
// test sending/receiving data
if (server.hasPendingConnections()) {
QString testLine = "test";
-#ifdef Q_OS_SYMBIAN
- for (int i = 0; i < 25 * 1024; ++i)
-#else
for (int i = 0; i < 50000; ++i)
-#endif
testLine += "a";
QLocalSocket *serverSocket = server.nextPendingConnection();
QVERIFY(serverSocket);
{
QLocalServer server;
QString name = "qlocalsocket_pathtest";
-#if defined(Q_OS_SYMBIAN)
- QString path = "";
-#elif defined(QT_LOCALSOCKET_TCP)
+#if defined(QT_LOCALSOCKET_TCP)
QString path = "QLocalServer";
#elif defined(Q_OS_WIN)
QString path = "\\\\.\\pipe\\";
QFETCH(int, max);
LocalServer server;
QString name = "tst_localsocket";
-#ifdef Q_OS_SYMBIAN
- unlink(name);
-#endif
server.setMaxPendingConnections(max);
QVERIFY2(server.listen(name), server.errorString().toLatin1().constData());
int connections = server.maxPendingConnections() + 1;
void tst_QLocalSocket::threadedConnection()
{
-#ifdef Q_OS_SYMBIAN
- unlink("qlocalsocket_threadtest");
-#endif
-
QFETCH(int, threads);
Server server;
-#if defined(Q_OS_SYMBIAN)
- server.setStackSize(0x14000);
-#endif
server.clients = threads;
server.mutex.lock();
server.start();
QList<Client*> clients;
for (int i = 0; i < threads; ++i) {
clients.append(new Client());
-#if defined(Q_OS_SYMBIAN)
- clients.last()->setStackSize(0x14000);
-#endif
clients.last()->start();
}
*/
void tst_QLocalSocket::processConnection()
{
-#if defined(QT_NO_PROCESS) || defined(Q_CC_NOKIAX86)
+#if defined(QT_NO_PROCESS)
QSKIP("Qt was compiled with QT_NO_PROCESS", SkipAll);
#else
QFETCH(int, processes);
void tst_QLocalSocket::waitForDisconnect()
{
QString name = "tst_localsocket";
-#ifdef Q_OS_SYMBIAN
- unlink(name);
-#endif
LocalServer server;
QVERIFY(server.listen(name));
LocalSocket socket;
void tst_QLocalSocket::recycleServer()
{
-#ifdef Q_OS_SYMBIAN
- unlink("recycletest1");
-#endif
-
QLocalServer server;
QLocalSocket client;
void tst_QLocalSocket::writeOnlySocket()
{
QLocalServer server;
-#ifdef Q_OS_SYMBIAN
- unlink("writeOnlySocket");
-#endif
QVERIFY(server.listen("writeOnlySocket"));
QLocalSocket client;
client.connectToServer("writeOnlySocket", QIODevice::WriteOnly);
QVERIFY(client.waitForConnected());
-#if defined(Q_OS_SYMBIAN)
- QTest::qWait(250);
-#endif
QVERIFY(server.waitForNewConnection(200));
QLocalSocket* serverSocket = server.nextPendingConnection();
QVERIFY(serverSocket);
void tst_QLocalSocket::writeToClientAndDisconnect()
{
-#ifdef Q_OS_SYMBIAN
- unlink("writeAndDisconnectServer");
-#endif
-
QLocalServer server;
QLocalSocket client;
QSignalSpy readChannelFinishedSpy(&client, SIGNAL(readChannelFinished()));
void tst_QLocalSocket::syncDisconnectNotify()
{
-#ifdef Q_OS_SYMBIAN
- unlink("syncDisconnectNotify");
-#endif
-
QLocalServer server;
QVERIFY(server.listen("syncDisconnectNotify"));
QLocalSocket client;
void tst_QLocalSocket::asyncDisconnectNotify()
{
-#ifdef Q_OS_SYMBIAN
- unlink("asyncDisconnectNotify");
-#endif
-
QLocalServer server;
QVERIFY(server.listen("asyncDisconnectNotify"));
QLocalSocket client;
QTRY_VERIFY(!disconnectedSpy.isEmpty());
}
-#ifdef Q_OS_SYMBIAN
-void tst_QLocalSocket::unlink(QString name)
-{
- if(name.length() == 0)
- return;
-
- QString fullName;
- // determine the full server path
- if (name.startsWith(QLatin1Char('/'))) {
- fullName = name;
- } else {
- fullName = QDir::cleanPath(QDir::tempPath());
- fullName += QLatin1Char('/') + name;
- fullName = QDir::toNativeSeparators(fullName);
- }
-
- int result = ::unlink(fullName.toUtf8().data());
-
- if(result != 0) {
- qWarning() << "Unlinking " << fullName << " failed with " << strerror(errno);
- }
-}
-#endif
QTEST_MAIN(tst_QLocalSocket)
#include "tst_qlocalsocket.moc"
QT = core-private network-private
-# Symbian toolchain does not support correct include semantics
-symbian:INCLUDEPATH+=..\\..\\..\\include\\QtNetwork\\private
-symbian: TARGET.CAPABILITY = NetworkServices
-
-
requires(contains(QT_CONFIG,private_tests))
tst_QSocks5SocketEngine::tst_QSocks5SocketEngine()
{
- Q_SET_DEFAULT_IAP
}
tst_QSocks5SocketEngine::~tst_QSocks5SocketEngine()
//---------------------------------------------------------------------------
void tst_QSocks5SocketEngine::udpTest()
{
-#ifdef SYMBIAN_WINSOCK_CONNECTIVITY
- QSKIP("UDP works bads on non WinPCAP emulator setting", SkipAll);
-#endif
-
QSocks5SocketEngine udpSocket;
// Initialize device #1
QTime stopWatch;
stopWatch.start();
-#if !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN)
+#if !defined(Q_OS_WINCE)
QTestEventLoop::instance().enterLoop(60);
#else
QTestEventLoop::instance().enterLoop(180);
# This means the auto test works on some machines for MinGW. No dialog stalls
# the application.
win32-g++*:CONFIG += console
-symbian: TARGET.CAPABILITY += NetworkServices ReadUserData
return 1;
}
-#if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
+#if defined(Q_OS_WINCE)
QFile file(QLatin1String("/test_signal.txt"));
file.open(QIODevice::WriteOnly);
file.write("Listening\n");
}
}
-symbian {
- crashApp.files = $$QT_BUILD_TREE/examples/widgets/wiggly/$${BUILD_DIR}/crashingServer.exe
- crashApp.path = .
- DEPLOYMENT += crashApp
- TARGET.CAPABILITY += NetworkServices ReadUserData
-}
-
TARGET = ../tst_qtcpserver
win32 {
**
****************************************************************************/
-// Just to get Q_OS_SYMBIAN
#include <qglobal.h>
-#if defined(_WIN32) && !defined(Q_OS_SYMBIAN)
+#if defined(_WIN32)
#include <winsock2.h>
#else
#include <sys/types.h>
tst_QTcpServer::tst_QTcpServer()
{
- Q_SET_DEFAULT_IAP
}
tst_QTcpServer::~tst_QTcpServer()
ThreadConnector connector(findLocalIpSocket.localAddress(), server.serverPort());
connector.start();
-#if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
+#if defined(Q_OS_WINCE)
QVERIFY(server.waitForNewConnection(9000, &timeout));
#else
QVERIFY(server.waitForNewConnection(3000, &timeout));
void tst_QTcpServer::setSocketDescriptor()
{
QTcpServer server;
-#ifdef Q_OS_SYMBIAN
- QTest::ignoreMessage(QtWarningMsg, "QSymbianSocketEngine::initialize - socket descriptor not found");
-#endif
QVERIFY(!server.setSocketDescriptor(42));
QCOMPARE(server.serverError(), QAbstractSocket::UnsupportedSocketOperationError);
-#ifndef Q_OS_SYMBIAN
//adopting Open C sockets is not supported, neither is adopting externally created RSocket
#ifdef Q_OS_WIN
// ensure winsock is started
#ifdef Q_OS_WIN
WSACleanup();
#endif
-#endif
}
//----------------------------------------------------------------------------------
{
// how a user woulddo it (qabstractsocketengine is not public)
unsigned long arg = 0;
-#if defined(Q_OS_SYMBIAN)
- arg = fcntl(socketDescriptor, F_GETFL, NULL);
- arg &= (~O_NONBLOCK);
- ok = ::fcntl(socketDescriptor, F_SETFL, arg) != -1;
-#elif defined(Q_OS_WIN)
+#if defined(Q_OS_WIN)
ok = ::ioctlsocket(socketDescriptor, FIONBIO, &arg) == 0;
::closesocket(socketDescriptor);
#else
void tst_QTcpServer::addressReusable()
{
-#if defined(Q_OS_SYMBIAN) && defined(Q_CC_NOKIAX86)
- QSKIP("Symbian: Emulator does not support process launching", SkipAll );
-#endif
-
#if defined(QT_NO_PROCESS)
QSKIP("Qt was compiled with QT_NO_PROCESS", SkipAll);
#else
QSKIP("With socks5 this test does not make senans at the momment", SkipAll);
}
}
-#if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
+#if defined(Q_OS_WINCE)
QString signalName = QString::fromLatin1("/test_signal.txt");
QFile::remove(signalName);
// The crashingServer process will crash once it gets a connection.
void tst_QTcpServer::setNewSocketDescriptorBlocking()
{
-#ifdef Q_OS_SYMBIAN
- QSKIP("open C ioctls on Qt sockets not supported", SkipAll);
-#else
QFETCH_GLOBAL(bool, setProxy);
if (setProxy) {
QFETCH_GLOBAL(int, proxyType);
socket.connectToHost(QHostAddress::LocalHost, server.serverPort());
QVERIFY(server.waitForNewConnection(5000));
QVERIFY(server.ok);
-#endif
}
void tst_QTcpServer::invalidProxy_data()
!wince*: SUBDIRS = test stressTest
-wince*|symbian|vxworks* : SUBDIRS = test
+wince*|vxworks* : SUBDIRS = test
requires(contains(QT_CONFIG,private_tests))
DESTDIR = ./
MOC_DIR = .moc/
TMP_DIR = .tmp/
-
-symbian: TARGET.CAPABILITY = NetworkServices
-
QT += network
vxworks:QT -= gui
-symbian: {
- TARGET.EPOCHEAPSIZE="0x100 0x3000000"
- TARGET.CAPABILITY = NetworkServices ReadUserData
-}
-
TARGET = tst_qtcpsocket
win32 {
**
****************************************************************************/
-
-// Just to get Q_OS_SYMBIAN
#include <qglobal.h>
-#if defined(_WIN32) && !defined(Q_OS_SYMBIAN)
+#if defined(_WIN32)
#include <winsock2.h>
#else
#include <sys/types.h>
{
QTcpSocket *socket = newSocket();
QCOMPARE(socket->socketDescriptor(), -1);
-#ifdef Q_OS_SYMBIAN
- QTest::ignoreMessage(QtWarningMsg, "QSymbianSocketEngine::initialize - socket descriptor not found");
-#endif
QVERIFY(!socket->setSocketDescriptor(-5, QTcpSocket::UnconnectedState));
QCOMPARE(socket->socketDescriptor(), -1);
void tst_QTcpSocket::setSocketDescriptor()
{
-#ifdef Q_OS_SYMBIAN
- QSKIP("adopting open c socket handles is not supported", SkipAll);
-#else
QFETCH_GLOBAL(bool, setProxy);
if (setProxy)
return; // this test doesn't make sense with proxies
#ifdef Q_OS_WIN
delete dummy;
#endif
-#endif
}
//----------------------------------------------------------------------------------
}
connect(socket, SIGNAL(disconnected()), SLOT(exitLoopSlot()));
-#ifndef Q_OS_SYMBIAN
enterLoop(10);
-#else
- enterLoop(30);
-#endif
QVERIFY2(!timeout(), "Network timeout");
QVERIFY(socket->state() == QAbstractSocket::UnconnectedState);
if (!closeDirectly) {
{
bool timedOut = false;
while (!quit) {
-#ifndef Q_OS_SYMBIAN
if (server->waitForNewConnection(500, &timedOut))
-#else
- if (server->waitForNewConnection(5000, &timedOut))
-#endif
break;
if (!timedOut)
return;
QTcpSocket *socket = server->nextPendingConnection();
while (!quit) {
-#ifndef Q_OS_SYMBIAN
if (socket->waitForDisconnected(500))
-#else
- if (socket->waitForDisconnected(5000))
-#endif
break;
if (socket->error() != QAbstractSocket::SocketTimeoutError)
return;
socket->disconnectFromHost();
}
-#ifndef Q_OS_SYMBIAN
QVERIFY2(socket->waitForDisconnected(10000), "Network timeout");
-#else
- QVERIFY2(socket->waitForDisconnected(30000), "Network timeout");
-#endif
QVERIFY(socket->state() == QAbstractSocket::UnconnectedState);
if (!closeDirectly) {
QCOMPARE(int(socket->openMode()), int(QIODevice::ReadWrite));
// let anything queued happen
QEventLoop loop;
-#ifndef Q_OS_SYMBIAN
QTimer::singleShot(50, &loop, SLOT(quit()));
-#else
- QTimer::singleShot(5000, &loop, SLOT(quit()));
-#endif
loop.exec();
// recheck
QTcpSocket *socket = newSocket();
socket->connectToHost(serverAddress, server.serverPort());
-#ifndef Q_OS_SYMBIAN
QVERIFY(!socket->waitForReadyRead(100));
-#else
- QVERIFY(!socket->waitForReadyRead(5000));
-#endif
QCOMPARE(socket->error(), QTcpSocket::SocketTimeoutError);
QVERIFY(socket->isOpen());
-#ifndef Q_OS_SYMBIAN
QVERIFY(!socket->waitForDisconnected(100));
-#else
- QVERIFY(!socket->waitForDisconnected(5000));
-#endif
QCOMPARE(socket->error(), QTcpSocket::SocketTimeoutError);
QVERIFY(socket->isOpen());
void tst_QTcpSocket::suddenRemoteDisconnect()
{
-#if defined( Q_OS_SYMBIAN )
- QSKIP("Symbian: QProcess IO is not yet supported, fix when supported", SkipAll);
-#else
QFETCH(QString, client);
QFETCH(QString, server);
// Check that both exited normally.
QCOMPARE(clientProcess.readAll().constData(), "SUCCESS\n");
QCOMPARE(serverProcess.readAll().constData(), "SUCCESS\n");
-#endif
}
//----------------------------------------------------------------------------------
QTest::newRow("no-such-host-http") << int(QNetworkProxy::HttpProxy)
<< "this-host-will-never-exist.troll.no" << 3128 << false
<< int(QAbstractSocket::ProxyNotFoundError);
-#if !defined(Q_OS_SYMBIAN)
QTest::newRow("http-on-socks5") << int(QNetworkProxy::HttpProxy) << fluke << 1080 << false
<< int(QAbstractSocket::ProxyConnectionClosedError);
QTest::newRow("socks5-on-http") << int(QNetworkProxy::Socks5Proxy) << fluke << 3128 << false
<< int(QAbstractSocket::SocketTimeoutError);
-#endif
}
void tst_QTcpSocket::invalidProxy()
CONFIG -= app_bundle
TARGET = clientserver
DESTDIR = ./
-
-symbian: TARGET.CAPABILITY += NetworkServices
DESTDIR = ../
}
-wince*|symbian: {
+wince* {
addApp.files = ../clientserver/clientserver.exe
addApp.path = clientserver
DEPLOYMENT += addApp
TARGET = tst_qudpsocket
-symbian: TARGET.CAPABILITY += NetworkServices
-
-
CONFIG+=insignificant_test
tst_QUdpSocket::tst_QUdpSocket()
{
- Q_SET_DEFAULT_IAP
}
tst_QUdpSocket::~tst_QUdpSocket()
qint64(i * 1024));
QCOMPARE(errorspy.count(), 0);
if (!server.waitForReadyRead(5000)) {
-#ifdef Q_OS_SYMBIAN
- //symbian receive buffer for datagrams is ~30k, but it can send datagrams up to the maximum 64k...
- if (i > 28) {
- i = 64;
- continue;
- }
-#endif
QSKIP(QString("UDP packet lost at size %1, unable to complete the test.").arg(i * 1024).toLatin1().data(), SkipSingle);
}
QCOMPARE(server.pendingDatagramSize(), qint64(i * 1024));
void tst_QUdpSocket::performance()
{
-#if defined(Q_OS_SYMBIAN)
- // Large packets seems not to go through on Symbian
- // Reason might be also fragmentation due to VPN connection etc
-
- QFETCH_GLOBAL(bool, setProxy);
- QFETCH_GLOBAL(int, proxyType);
-
- int arrSize = 8192;
- if (setProxy && proxyType == QNetworkProxy::Socks5Proxy)
- arrSize = 1024;
-
- QByteArray arr(arrSize, '@');
-#else
QByteArray arr(8192, '@');
-#endif // Q_OS_SYMBIAN
QUdpSocket server;
#ifdef FORCE_SESSION
float secs = stopWatch.elapsed() / 1000.0;
qDebug("\t%.2fMB/%.2fs: %.2fMB/s", float(nbytes / (1024.0*1024.0)),
secs, float(nbytes / (1024.0*1024.0)) / secs);
-
-#if defined(Q_OS_SYMBIAN)
- if(nbytes == 0) {
- qDebug("No bytes passed through local UDP socket, since UDP socket write returns EWOULDBLOCK");
- qDebug("Should try with blocking sockets, but it is not currently possible due to Open C defect");
- }
-#endif
-
}
void tst_QUdpSocket::bindMode()
socket2.setProperty("_q_networksession", QVariant::fromValue(networkSession));
#endif
QVERIFY(!socket2.bind(socket.localPort()));
-#if defined(Q_OS_SYMBIAN)
- if(RProcess().HasCapability(ECapabilityNetworkControl)) {
- qDebug("Test executed *with* NetworkControl capability");
- // In Symbian OS ReuseAddressHint together with NetworkControl capability
- // gives application *always* right to bind to port. I.e. it does not matter
- // if first socket was bound with any bind flag. Since autotests in Symbian
- // are currently executed with ALL -TCB rights, this path is the one executed.
- QVERIFY(socket2.bind(socket.localPort(), QUdpSocket::ReuseAddressHint));
- socket.close();
- socket2.close();
-
- QVERIFY2(socket.bind(0, QUdpSocket::ShareAddress), socket.errorString().toLatin1().constData());
- QVERIFY(!socket2.bind(socket.localPort()));
- QVERIFY2(socket2.bind(socket.localPort(), QUdpSocket::ReuseAddressHint), socket2.errorString().toLatin1().constData());
- socket.close();
- socket2.close();
-
- QVERIFY2(socket.bind(0, QUdpSocket::DontShareAddress), socket.errorString().toLatin1().constData());
- QVERIFY(!socket2.bind(socket.localPort()));
- QVERIFY(socket2.bind(socket.localPort(), QUdpSocket::ReuseAddressHint));
- socket.close();
- socket2.close();
- } else {
- qDebug("Test executed *without* NetworkControl capability");
- // If we don't have NetworkControl capability, attempt to bind already bound
- // address will *always* fail. I.e. it does not matter if first socket was
- // bound with any bind flag.
- QVERIFY(!socket2.bind(socket.localPort(), QUdpSocket::ReuseAddressHint));
- socket.close();
-
- QVERIFY2(socket.bind(0, QUdpSocket::ShareAddress), socket.errorString().toLatin1().constData());
- QVERIFY(!socket2.bind(socket.localPort()));
- QVERIFY2(!socket2.bind(socket.localPort(), QUdpSocket::ReuseAddressHint), socket2.errorString().toLatin1().constData());
- socket.close();
-
- QVERIFY2(socket.bind(0, QUdpSocket::DontShareAddress), socket.errorString().toLatin1().constData());
- QVERIFY(!socket2.bind(socket.localPort()));
- QVERIFY(!socket2.bind(socket.localPort(), QUdpSocket::ReuseAddressHint));
- socket.close();
- }
-#elif defined(Q_OS_UNIX)
+#if defined(Q_OS_UNIX)
QVERIFY(!socket2.bind(socket.localPort(), QUdpSocket::ReuseAddressHint));
socket.close();
QVERIFY2(socket.bind(0, QUdpSocket::ShareAddress), socket.errorString().toLatin1().constData());
void tst_QUdpSocket::outOfProcessConnectedClientServerTest()
{
-#if defined(Q_OS_WINCE) || defined (Q_OS_SYMBIAN)
- QSKIP("This test depends on reading data from QProcess (not supported on Qt/WinCE and Symbian).", SkipAll);
+#if defined(Q_OS_WINCE)
+ QSKIP("This test depends on reading data from QProcess (not supported on Qt/WinCE).", SkipAll);
#endif
#if defined(QT_NO_PROCESS)
QSKIP("Qt was compiled with QT_NO_PROCESS", SkipAll);
void tst_QUdpSocket::outOfProcessUnconnectedClientServerTest()
{
-#if defined(Q_OS_WINCE) || defined (Q_OS_SYMBIAN)
- QSKIP("This test depends on reading data from QProcess (not supported on Qt/WinCE and Symbian).", SkipAll);
+#if defined(Q_OS_WINCE)
+ QSKIP("This test depends on reading data from QProcess (not supported on Qt/WinCE).", SkipAll);
#endif
#if defined(QT_NO_PROCESS)
QSKIP("Qt was compiled with QT_NO_PROCESS", SkipAll);
#ifdef FORCE_SESSION
udpSocket.setProperty("_q_networksession", QVariant::fromValue(networkSession));
#endif
-#ifdef Q_OS_SYMBIAN
- QVERIFY2(udpSocket.bind(),
- qPrintable(udpSocket.errorString()));
-#else
QVERIFY2(udpSocket.bind(groupAddress, 0),
qPrintable(udpSocket.errorString()));
-#endif
QVERIFY2(udpSocket.joinMulticastGroup(groupAddress),
qPrintable(udpSocket.errorString()));
udpSocket.close();
void tst_QUdpSocket::setMulticastInterface()
{
-#ifdef Q_OS_SYMBIAN
- QSKIP("Symbian has no IPV6_MULTICAST_IF equivalent", SkipAll);
-#else
QFETCH_GLOBAL(bool, setProxy);
QFETCH(QNetworkInterface, iface);
QFETCH(QHostAddress, address);
} else {
QVERIFY(!iface2.isValid());
}
-#endif
}
void tst_QUdpSocket::multicast_data()
#endif
// bind first, then verify that we can join the multicast group
-#ifdef Q_OS_SYMBIAN
- if (!setProxy) {
- QEXPECT_FAIL("same bind, group ipv4 address", "bind to group address not supported on symbian", Abort);
- QEXPECT_FAIL("same bind, group ipv6 address", "bind to group address not supported on symbian", Abort);
- }
-#endif
QVERIFY2(receiver.bind(bindAddress, 0) == bindResult,
qPrintable(receiver.errorString()));
if (!bindResult)
receiver.readDatagram(datagram.data(), datagram.size(), 0, 0);
receivedDatagrams << datagram;
}
-#ifdef Q_OS_SYMBIAN
- QEXPECT_FAIL("valid bind, group ipv4 address", "IPv4 multicast not supported on symbian", Abort);
-#endif
QCOMPARE(receivedDatagrams, datagrams);
QVERIFY2(receiver.leaveMulticastGroup(groupAddress), qPrintable(receiver.errorString()));
CONFIG -= app_bundle
CONFIG += console
-symbian:TARGET.CAPABILITY="ALL -TCB"
-
}
}
-wince*|symbian: {
- certFiles.files = certificates more-certificates
- certFiles.path = .
- DEPLOYMENT += certFiles
-}
-
-wince*: {
- DEFINES += SRCDIR=\\\".\\\"
-} else:!symbian {
- DEFINES += SRCDIR=\\\"$$PWD/\\\"
+wince* {
+ certFiles.files = certificates more-certificates
+ certFiles.path = .
+ DEPLOYMENT += certFiles
+ DEFINES += SRCDIR=\\\".\\\"
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD/\\\"
}
-
-symbian:TARGET.CAPABILITY = NetworkServices ReadUserData
#include <qsslkey.h>
#include <qsslsocket.h>
-#ifdef Q_OS_SYMBIAN
-// In Symbian OS test data is located in applications private dir
-// Current path (C:\private\<UID>) contains only ascii chars
-#define SRCDIR "./"
-#endif
-
class tst_QSslCertificate : public QObject
{
Q_OBJECT
DESTDIR = release
}
}
-
-symbian: TARGET.CAPABILITY = NetworkServices
-
DESTDIR = release
}
}
-
-symbian: TARGET.CAPABILITY = NetworkServices
-
}
}
-wince*|symbian: {
- keyFiles.files = keys
- keyFiles.path = .
+wince* {
+ keyFiles.files = keys
+ keyFiles.path = .
- passphraseFiles.files = rsa-without-passphrase.pem rsa-with-passphrase.pem
- passphraseFiles.path = .
+ passphraseFiles.files = rsa-without-passphrase.pem rsa-with-passphrase.pem
+ passphraseFiles.path = .
- DEPLOYMENT += keyFiles passphraseFiles
-}
-
-wince*: {
- DEFINES += SRCDIR=\\\".\\\"
-} else:!symbian {
- DEFINES+= SRCDIR=\\\"$$PWD\\\"
- TARGET.CAPABILITY = NetworkServices
+ DEPLOYMENT += keyFiles passphraseFiles
+ DEFINES += SRCDIR=\\\".\\\"
+} else {
+ DEFINES+= SRCDIR=\\\"$$PWD\\\"
+ TARGET.CAPABILITY = NetworkServices
}
#include <QtNetwork/qhostaddress.h>
#include <QtNetwork/qnetworkproxy.h>
-#ifdef Q_OS_SYMBIAN
-// In Symbian OS test data is located in applications private dir
-// Current path (C:\private\<UID>) contains only ascii chars
-#define SRCDIR "."
-#endif
-
class tst_QSslKey : public QObject
{
Q_OBJECT
# OpenSSL support
contains(QT_CONFIG, openssl) | contains(QT_CONFIG, openssl-linked) {
- symbian {
- INCLUDEPATH *= $$OS_LAYER_SSL_SYSTEMINCLUDE
- } else {
- include($$QT_SOURCE_TREE/config.tests/unix/openssl/openssl.pri)
- }
+ include($$QT_SOURCE_TREE/config.tests/unix/openssl/openssl.pri)
# Add optional SSL libs
LIBS += $$OPENSSL_LIBS
}
certFiles.files = certs ssl.tar.gz
certFiles.path = .
DEPLOYMENT += certFiles
-} else:symbian {
- DEFINES += QSSLSOCKET_CERTUNTRUSTED_WORKAROUND
- TARGET.EPOCHEAPSIZE="0x100 0x3000000"
- TARGET.CAPABILITY=NetworkServices ReadUserData
-
- certFiles.files = certs ssl.tar.gz
- certFiles.path = .
- DEPLOYMENT += certFiles
- INCLUDEPATH *= $$MW_LAYER_SYSTEMINCLUDE # Needed for e32svr.h in S^3 envs
} else {
DEFINES += SRCDIR=\\\"$$PWD/\\\"
}
#define QSSLSOCKET_CERTUNTRUSTED_WORKAROUND
#endif
-#ifdef Q_OS_SYMBIAN
-#define SRCDIR ""
-#endif
-
#ifndef QT_NO_OPENSSL
class QSslSocketPtr: public QSharedPointer<QSslSocket>
{
qRegisterMetaType<QAbstractSocket::SocketError>("QAbstractSocket::SocketError");
qRegisterMetaType<QAbstractSocket::SocketState>("QSslSocket::SslMode");
#endif
- Q_SET_DEFAULT_IAP
}
tst_QSslSocket::~tst_QSslSocket()
enterLoop(10);
// Entered connecting state
-#ifndef Q_OS_SYMBIAN
QCOMPARE(socket.state(), QAbstractSocket::ConnectingState);
QCOMPARE(connectedSpy.count(), 0);
-#endif
QCOMPARE(hostFoundSpy.count(), 1);
QCOMPARE(disconnectedSpy.count(), 0);
enterLoop(10);
connect(socket, SIGNAL(sslErrors(const QList<QSslError> &)), this, SLOT(ignoreErrorSlot()));
socket->connectToHostEncrypted(QtNetworkSettings::serverName(), 993);
-#ifdef Q_OS_SYMBIAN
- QVERIFY(socket->waitForConnected(10000));
- QVERIFY(socket->waitForEncrypted(10000));
-
- // dont forget to login
- QCOMPARE((int) socket->write("USER ftptest\r\n"), 14);
- QCOMPARE((int) socket->write("PASS ftP2Ptf\r\n"), 14);
-
- QVERIFY(socket->waitForReadyRead(10000));
- QVERIFY(!socket->peerCertificate().isNull());
- QVERIFY(!socket->peerCertificateChain().isEmpty());
-#else
QVERIFY(socket->waitForConnected(10000));
QVERIFY(socket->waitForEncrypted(10000));
QVERIFY(socket->waitForReadyRead(10000));
QVERIFY(!socket->peerCertificate().isNull());
QVERIFY(!socket->peerCertificateChain().isEmpty());
-#endif
}
void tst_QSslSocket::startClientEncryption()
// delayed acceptance:
QTest::qSleep(100);
-#ifndef Q_OS_SYMBIAN
bool ret = server.waitForNewConnection(2000);
-#else
- bool ret = server.waitForNewConnection(20000);
-#endif
Q_UNUSED(ret);
// delayed start of encryption
QSslSocketPtr socket = newSocket();
socket->connectToHostEncrypted(QtNetworkSettings::serverName(), 993);
socket->ignoreSslErrors();
-#ifndef Q_OS_SYMBIAN
QVERIFY(socket->waitForEncrypted(5000));
-#else
- QVERIFY(socket->waitForEncrypted(10000));
-#endif
socket->write("XXXX LOGOUT\r\n");
QCOMPARE(socket->state(), QAbstractSocket::ConnectedState);
socket->disconnectFromHost();
QCOMPARE(socket->state(), QAbstractSocket::ClosingState);
-#ifdef Q_OS_SYMBIAN
- // I don't understand how socket->waitForDisconnected can work on other platforms
- // since socket->write will end to:
- // QMetaObject::invokeMethod(this, "_q_flushWriteBuffer", Qt::QueuedConnection);
- // In order that _q_flushWriteBuffer will be called the eventloop need to run
- // If we just call waitForDisconnected, which blocks the whole thread how that can happen?
- connect(socket, SIGNAL(disconnected()), this, SLOT(exitLoop()));
- enterLoop(5);
- QVERIFY(!timeout());
-#else
QVERIFY(socket->waitForDisconnected(5000));
-#endif
QCOMPARE(socket->bytesToWrite(), qint64(0));
}
addFiles.path = .
DEPLOYMENT += addFiles
DEFINES += SRCDIR=\\\"\\\"
-} else:symbian {
- addFiles.files = rfc3252.txt
- addFiles.path = .
- DEPLOYMENT += addFiles
- TARGET.CAPABILITY = NetworkServices ReadUserData
} else:vxworks*: {
DEFINES += SRCDIR=\\\"\\\"
} else {
#include <QtNetwork/qnetworksession.h>
#endif
-#ifdef Q_OS_SYMBIAN
-// In Symbian OS test data is located in applications private dir
-// Current path (C:\private\<UID>) contains only ascii chars
-//#define SRCDIR QDir::currentPath()
-#define SRCDIR "."
-#endif
-
#include "../network-settings.h"
class tst_NetworkSelfTest: public QObject
tst_NetworkSelfTest::tst_NetworkSelfTest()
{
- Q_SET_DEFAULT_IAP
}
tst_NetworkSelfTest::~tst_NetworkSelfTest()
void tst_NetworkSelfTest::remotePortsOpen()
{
-#ifdef Q_OS_SYMBIAN
- if (qstrcmp(QTest::currentDataTag(), "http-proxy-auth-ntlm") == 0)
- QSKIP("NTML authentication not yet supported in Symbian", SkipSingle);
-#endif
-
QFETCH(int, portNumber);
QTcpSocket socket;
socket.connectToHost(QtNetworkSettings::serverName(), portNumber);
// << Chat::expect("213 40\r\n")
<< Chat::send("QUIT\r\n");
-#ifdef Q_OS_SYMBIAN
- if (userSuffix.length() == 0) // received but unacknowledged packets are discarded by TCP RST, so this doesn't work with frox proxy
-#endif
rv << Chat::expect("221")
<< Chat::discardUntil("\r\n");
void tst_NetworkSelfTest::httpProxyNtlmAuth()
{
-#ifdef Q_OS_SYMBIAN
- QSKIP("NTML authentication not yet supported in Symbian", SkipAll);
-#else
netChat(3130, QList<Chat>()
// test auth required response
<< Chat::send("GET http://" + QtNetworkSettings::serverName().toLatin1() + "/ HTTP/1.0\r\n"
<< Chat::discardUntil("\r\nProxy-Authenticate: NTLM\r\n")
<< Chat::DiscardUntilDisconnect
);
-#endif
}
// SOCKSv5 is a binary protocol
#include <QtOpenGL/QtOpenGL>
#include "tst_qglthreads.h"
-#ifdef Q_OS_SYMBIAN
-#define RUNNING_TIME 2000 // save GPU mem by running shorter time.
-#else
#define RUNNING_TIME 5000
-#endif
-
-
-
tst_QGLThreads::tst_QGLThreads(QObject *parent)
: QObject(parent)
while (time.elapsed() < RUNNING_TIME) {
int width = 400;
int height = 300;
-#ifdef Q_OS_SYMBIAN
- // GPU mem is very scarce resource on Symbian currently.
- // That's why we create only small textures.
- width = 50;
- height = 20;
-#endif
QImage image(width, height, QImage::Format_RGB32);
QPainter p(&image);
p.fillRect(image.rect(), QColor(rand() % 256, rand() % 256, rand() % 256));
QSKIP("OpenGL threading tests are currently disabled on Mac as they were causing reboots", SkipAll);
#endif
-#ifdef Q_OS_SYMBIAN
- QSKIP("OpenGL threading tests are disabled on Symbian as accessing RWindow from a secondary thread is not supported", SkipAll);
-#endif
-
QFETCH(bool, resize);
QFETCH(bool, update);
qmultiscreen
}
-symbian {
- SUBDIRS += qsoftkeymanager \
- qs60mainapplication
-}
-
!win32-msvc*:!wince*:SUBDIRS += exceptionsafety_objects
# Following tests depends on private API
QVERIFY(act.shortcut() == act.shortcuts().first());
QList<QKeySequence> expected;
-#if defined(Q_WS_MAC) || defined(Q_OS_SYMBIAN)
+#if defined(Q_WS_MAC)
expected << QKeySequence("CTRL+C");
#elif defined(Q_WS_WIN) || defined(Q_WS_QWS) || defined(Q_WS_QPA)
expected << QKeySequence("CTRL+C") << QKeySequence("CTRL+INSERT");
######################################################################
TEMPLATE = app
-!symbian: {
DEPENDPATH += .
INCLUDEPATH += .
-}
wince*:TARGET = ../desktopsettingsaware
-symbian:TARGET = desktopsettingsaware
# Input
QT += widgets
DEPLOYMENT += additional deploy someTest
}
-symbian: {
- additional.files = $$OUT_PWD/../desktopsettingsaware/desktopsettingsaware.exe
- additional.path = desktopsettingsaware
- someTest.files = test.pro
- someTest.path = test
- windowIcon.files = ../heart.svg
- DEPLOYMENT += additional deploy someTest windowIcon
- LIBS += -lcone -lavkon
-}
-
win32 {
CONFIG(debug, debug|release) {
TARGET = ../../debug/tst_qapplication
#ifdef Q_OS_WINCE
#include <windows.h>
#endif
-#ifdef Q_OS_SYMBIAN
-#include <aknenv.h>
-#endif
//TESTED_CLASS=
//TESTED_FILES=
-#if defined(Q_OS_SYMBIAN)
-// In Symbian, the PluginsPath doesn't specify the only absolute path; just the dir that can be found on any drive
-static void addExpectedSymbianPluginsPath(QStringList& expected)
-{
- QString installPathPlugins = QDir::fromNativeSeparators(QLibraryInfo::location(QLibraryInfo::PluginsPath));
- QFileInfoList driveList = QDir::drives();
- QListIterator<QFileInfo> iter(driveList);
- while (iter.hasNext()) {
- QFileInfo testFi(iter.next().canonicalPath().append(installPathPlugins));
- if (testFi.exists())
- expected << testFi.canonicalFilePath();
- }
-}
-#endif
-
class tst_QApplication : public QObject
{
Q_OBJECT
void touchEventPropagation();
- void symbianNoApplicationPanes();
-
- void symbianNeedForTraps();
- void symbianLeaveThroughMain();
void qtbug_12673();
-
-
void globalStaticObjectDestruction(); // run this last
};
QStringList actual = QApplication::libraryPaths();
actual.sort();
-#if defined(Q_OS_SYMBIAN)
- QStringList expected;
- addExpectedSymbianPluginsPath(expected);
- expected << appDirPath;
-#else
QStringList expected = QSet<QString>::fromList((QStringList() << installPathPlugins << appDirPath)).toList();
-#endif
expected.sort();
QVERIFY2(isPathListIncluded(actual, expected),
void tst_QApplication::libraryPaths_qt_plugin_path_2()
{
-#ifdef Q_OS_SYMBIAN
- QByteArray validPath = "C:\\data";
- QByteArray nonExistentPath = "Z:\\nonexistent";
- QByteArray pluginPath = validPath + ";" + nonExistentPath;
-#elif defined(Q_OS_UNIX)
+#ifdef Q_OS_UNIX
QByteArray validPath = QDir("/tmp").canonicalPath().toLatin1();
QByteArray nonExistentPath = "/nonexistent";
QByteArray pluginPath = validPath + ":" + nonExistentPath;
QApplication app(argc, &argv0, QApplication::GuiServer);
// library path list should contain the default plus the one valid path
-#if defined(Q_OS_SYMBIAN)
- // In Symbian, the PluginsPath doesn't specify the only absolute path; just the dir that can be found on any drive
- QStringList expected;
- addExpectedSymbianPluginsPath(expected);
- expected << QDir(app.applicationDirPath()).canonicalPath()
- << QDir(QDir::fromNativeSeparators(QString::fromLatin1(validPath))).canonicalPath();
-#else
QStringList expected =
QStringList()
<< QLibraryInfo::location(QLibraryInfo::PluginsPath)
# ifdef Q_OS_WINCE
expected = QSet<QString>::fromList(expected).toList();
# endif
-#endif
QVERIFY2(isPathListIncluded(app.libraryPaths(), expected),
qPrintable("actual:\n - " + app.libraryPaths().join("\n - ") +
"\nexpected:\n - " + expected.join("\n - ")));
qputenv("QT_PLUGIN_PATH", pluginPath);
// library path list should contain the default
-#if defined(Q_OS_SYMBIAN)
- QStringList expected;
- addExpectedSymbianPluginsPath(expected);
- expected << app.applicationDirPath();
-#else
QStringList expected =
QStringList()
<< QLibraryInfo::location(QLibraryInfo::PluginsPath)
# ifdef Q_OS_WINCE
expected = QSet<QString>::fromList(expected).toList();
# endif
-#endif
QVERIFY(isPathListIncluded(app.libraryPaths(), expected));
qputenv("QT_PLUGIN_PATH", QByteArray());
testProcess.start("desktopsettingsaware/debug/desktopsettingsaware");
#elif defined(Q_OS_WIN)
testProcess.start("desktopsettingsaware/release/desktopsettingsaware");
-#elif defined(Q_OS_SYMBIAN)
- testProcess.start("desktopsettingsaware");
-#if defined(Q_CC_NOKIAX86)
- QEXPECT_FAIL("", "QProcess on Q_CC_NOKIAX86 cannot launch another Qt application, due to DLL conflicts.", Abort);
- // TODO: Remove XFAIL, as soon as we can launch Qt applications from within Qt applications on Symbian
- QVERIFY(testProcess.error() != QProcess::FailedToStart);
-#endif // defined(Q_CC_NOKIAX86)
#else
testProcess.start("desktopsettingsaware/desktopsettingsaware");
#endif
}
}
-void tst_QApplication::symbianNoApplicationPanes()
-{
-#ifndef Q_OS_SYMBIAN
- QSKIP("This is a Symbian only test", SkipAll);
-#else
- QApplication::setAttribute(Qt::AA_S60DontConstructApplicationPanes);
-
- // Run in a block so that QApplication is destroyed before resetting the attribute.
- {
- // Actually I wasn't able to get the forced orientation change to work properly,
- // but I'll leave the code here for the future in case we manage to test that
- // later. If someone knows how to force an orientation switch in an autotest, do
- // feel free to fix this testcase.
- int argc = 0;
- QApplication app(argc, 0);
- QWidget *w;
-
- w = new QWidget;
- w->show();
- QT_TRAP_THROWING(static_cast<CAknAppUi *>(CCoeEnv::Static()->AppUi())
- ->SetOrientationL(CAknAppUi::EAppUiOrientationLandscape));
- app.processEvents();
- delete w;
-
- w = new QWidget;
- w->show();
- QT_TRAP_THROWING(static_cast<CAknAppUi *>(CCoeEnv::Static()->AppUi())
- ->SetOrientationL(CAknAppUi::EAppUiOrientationPortrait));
- app.processEvents();
- delete w;
-
- w = new QWidget;
- w->showMaximized();
- QT_TRAP_THROWING(static_cast<CAknAppUi *>(CCoeEnv::Static()->AppUi())
- ->SetOrientationL(CAknAppUi::EAppUiOrientationLandscape));
- app.processEvents();
- delete w;
-
- w = new QWidget;
- w->showMaximized();
- QT_TRAP_THROWING(static_cast<CAknAppUi *>(CCoeEnv::Static()->AppUi())
- ->SetOrientationL(CAknAppUi::EAppUiOrientationPortrait));
- app.processEvents();
- delete w;
-
- w = new QWidget;
- w->showFullScreen();
- QT_TRAP_THROWING(static_cast<CAknAppUi *>(CCoeEnv::Static()->AppUi())
- ->SetOrientationL(CAknAppUi::EAppUiOrientationLandscape));
- app.processEvents();
- delete w;
-
- w = new QWidget;
- w->showFullScreen();
- QT_TRAP_THROWING(static_cast<CAknAppUi *>(CCoeEnv::Static()->AppUi())
- ->SetOrientationL(CAknAppUi::EAppUiOrientationPortrait));
- app.processEvents();
- delete w;
-
- // These will have no effect, since there is no status pane, but they shouldn't
- // crash either.
- w = new QWidget;
- w->show();
- w->setWindowTitle("Testing title");
- app.processEvents();
- delete w;
-
- w = new QWidget;
- w->show();
- w->setWindowIcon(QIcon(QPixmap("heart.svg")));
- app.processEvents();
- delete w;
-
- QDesktopWidget desktop;
- QCOMPARE(desktop.availableGeometry(), desktop.screenGeometry());
- }
-
- QApplication::setAttribute(Qt::AA_S60DontConstructApplicationPanes, false);
-
- // No other error condition. Program will crash if unsuccessful.
-#endif
-}
-
-#ifdef Q_OS_SYMBIAN
-class CBaseDummy : public CBase
-{
-public:
- CBaseDummy(int *numDestroyed) : numDestroyed(numDestroyed)
- {
- }
- ~CBaseDummy()
- {
- (*numDestroyed)++;
- }
-
-private:
- int *numDestroyed;
-};
-
-static void fakeMain(int *numDestroyed)
-{
- // Push a few objects, just so that the cleanup stack has something to clean up.
- CleanupStack::PushL(new (ELeave) CBaseDummy(numDestroyed));
- int argc = 0;
- QApplication app(argc, 0);
- CleanupStack::PushL(new (ELeave) CBaseDummy(numDestroyed));
-
- User::Leave(KErrGeneral); // Fake error
-}
-#endif
-
-void tst_QApplication::symbianNeedForTraps()
-{
-#ifndef Q_OS_SYMBIAN
- QSKIP("This is a Symbian-only test", SkipAll);
-#else
- int argc = 0;
- QApplication app(argc, 0);
- int numDestroyed = 0;
-
- // This next part should not require a trap. If it does, the test will crash.
- CleanupStack::PushL(new (ELeave) CBaseDummy(&numDestroyed));
- CleanupStack::PopAndDestroy();
-
- QCOMPARE(numDestroyed, 1);
-
- // No other failure condition. The program will crash if it does not pass.
-#endif
-}
-
-void tst_QApplication::symbianLeaveThroughMain()
-{
-#ifndef Q_OS_SYMBIAN
- QSKIP("This is a Symbian-only test", SkipAll);
-#else
- int numDestroyed = 0;
- TInt err;
- TRAP(err, fakeMain(&numDestroyed));
-
- QCOMPARE(numDestroyed, 2);
-#endif
-}
-
void tst_QApplication::qtbug_12673()
{
-#ifdef Q_OS_SYMBIAN
- QSKIP("This might not make sense in Symbian, but since I do not know how to test it I'll just skip it for now.", SkipAll);
-#else
QProcess testProcess;
QStringList arguments;
#ifdef Q_OS_MAC
#endif
QVERIFY(testProcess.waitForFinished(20000));
QCOMPARE(testProcess.exitStatus(), QProcess::NormalExit);
-#endif // Q_OS_SYMBIAN
}
/*
#include <qitemdelegate.h>
#include <qcolumnview.h>
#include "../../../src/widgets/itemviews/qcolumnviewgrip_p.h"
-#ifndef Q_OS_SYMBIAN
#include "../../../src/widgets/dialogs/qfilesystemmodel_p.h"
-#endif
#include <qdirmodel.h>
#include <qstringlistmodel.h>
#include <qdebug.h>
// We need to set the keyboard input interval to a higher value
// as the processEvent() call takes too much time, so it restarts
// the keyboard search then
-#if defined(QT_ARCH_ARM) || defined(QT_ARCH_MIPS) || defined(QT_ARCH_SYMBIAN)
+#if defined(QT_ARCH_ARM) || defined(QT_ARCH_MIPS)
int oldInterval = QApplication::keyboardInputInterval();
QApplication::setKeyboardInputInterval(1500);
#endif
QApplication::sendEvent(testWidget, &kr2);
qApp->processEvents(); // Process events to trigger autocompletion
QTRY_COMPARE(testWidget->currentIndex(), 3);
-#if defined(QT_ARCH_ARM) || defined(QT_ARCH_MIPS) || defined(QT_ARCH_SYMBIAN)
+#if defined(QT_ARCH_ARM) || defined(QT_ARCH_MIPS)
QApplication::setKeyboardInputInterval(oldInterval);
#endif
}
#elif defined(Q_OS_WIN)
QTest::newRow("()") << "C" << "" << "C:" << "C:";
QTest::newRow("()") << "C:\\Program" << "" << "Program Files" << "C:\\Program Files";
-#elif defined(Q_OS_SYMBIAN)
- QTest::newRow("()") << "C" << "" << "C:" << "C:";
- QTest::newRow("()") << "C:\\re" << "" << "resource" << "C:\\resource";
#elif defined (Q_OS_MAC)
QTest::newRow("()") << "" << "" << "/" << "/";
QTest::newRow("(/a)") << "/a" << "" << "Applications" << "/Applications";
#elif defined(Q_OS_WIN)
QTest::newRow("()") << "C" << "" << "C:" << "C:";
QTest::newRow("()") << "C:\\Program" << "" << "Program Files" << "C:\\Program Files";
-#elif defined(Q_OS_SYMBIAN)
- QTest::newRow("()") << "C" << "" << "C:" << "C:";
- QTest::newRow("()") << "C:\\re" << "" << "resource" << "C:\\resource";
#elif defined (Q_OS_MAC)
QTest::newRow("()") << "" << "" << "/" << "/";
QTest::newRow("(/a)") << "/a" << "" << "Applications" << "/Applications";
QRect allScreens;
for (int i = 0; i < desktopWidget->numScreens(); ++i) {
QRect screenGeometry = desktopWidget->screenGeometry(i);
-#if !defined(Q_OS_SYMBIAN)
QCOMPARE(desktopWidget->screenNumber(screenGeometry.center()), i);
-#endif
allScreens |= screenGeometry;
}
} catch(...) {
++caughtExceptions;
}
-#ifdef Q_OS_SYMBIAN
- //on symbian, the event loop absorbs exceptions
- QCOMPARE(caughtExceptions, 0);
-#else
QCOMPARE(caughtExceptions, 1);
-#endif
}
#else
void tst_QDialog::throwInExec()
QT += widgets
SOURCES += tst_qdirmodel.cpp
-wince*|symbian {
+wince* {
addit.files = dirtest\\test1\\*
addit.path = dirtest\\test1
tests.files = test\\*
wince*: {
DEFINES += SRCDIR=\\\"./\\\"
-} else:symbian {
- TARGET.UID3 = 0xE0340003
- DEFINES += SYMBIAN_SRCDIR_UID=$$lower($$replace(TARGET.UID3,"0x",""))
} else {
DEFINES += SRCDIR=\\\"$$PWD/\\\"
}
//TESTED_CLASS=
//TESTED_FILES=
-#if defined(Q_OS_SYMBIAN)
-# define STRINGIFY(x) #x
-# define TOSTRING(x) STRINGIFY(x)
-# define SRCDIR "C:/Private/" TOSTRING(SYMBIAN_SRCDIR_UID) "/"
-#endif
-
class tst_QDirModel : public QObject
{
Q_OBJECT
void tst_QDirModel::filePath()
{
-#ifdef Q_OS_SYMBIAN
- QSKIP("OS doesn't support symbolic links", SkipAll);
-#else
QFile::remove(SRCDIR "test.lnk");
QVERIFY(QFile(SRCDIR "tst_qdirmodel.cpp").link(SRCDIR "test.lnk"));
QDirModel model;
model.setResolveSymlinks(true);
QCOMPARE(model.filePath(index), path + QString( "tst_qdirmodel.cpp"));
QFile::remove(SRCDIR "test.lnk");
-#endif
}
void tst_QDirModel::task196768_sorting()
view.setSortingEnabled(true);
index2 = model.index(path);
-#ifdef Q_OS_SYMBIAN
- if(!RProcess().HasCapability(ECapabilityAllFiles))
- QEXPECT_FAIL("", "QTBUG-9746", Continue);
-#endif
QCOMPARE(index.data(), index2.data());
}
QT += core-private gui-private
SOURCES += tst_qfiledialog.cpp
-wince*|symbian {
+wince* {
addFiles.files = *.cpp
addFiles.path = .
filesInDir.files = *.pro
DEPLOYMENT += addFiles filesInDir
}
-symbian:TARGET.EPOCHEAPSIZE="0x100 0x1000000"
-symbian:HEADERS += ../../../include/qtgui/private/qfileinfogatherer_p.h
-
wince* {
DEFINES += SRCDIR=\\\"./\\\"
-} else:symbian {
- TARGET.UID3 = 0xE0340003
- DEFINES += SYMBIAN_SRCDIR_UID=$$lower($$replace(TARGET.UID3,"0x",""))
} else {
DEFINES += SRCDIR=\\\"$$PWD/\\\"
}
//TESTED_CLASS=
//TESTED_FILES=
-#if defined(Q_OS_SYMBIAN)
-# define STRINGIFY(x) #x
-# define TOSTRING(x) STRINGIFY(x)
-# define SRCDIR "C:/Private/" TOSTRING(SYMBIAN_SRCDIR_UID) "/"
-#elif defined(Q_OS_UNIX)
+#if defined(Q_OS_UNIX)
#ifdef QT_BUILD_INTERNAL
QT_BEGIN_NAMESPACE
extern Q_GUI_EXPORT QString qt_tildeExpansion(const QString &path, bool *expanded = 0);
if (input.startsWith(".."))
input.clear();
for (int ii = 0; ii < expectedFiles.count(); ++ii) {
-#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
+#if defined(Q_OS_WIN)
if (expectedFiles.at(ii).startsWith(input,Qt::CaseInsensitive))
#else
if (expectedFiles.at(ii).startsWith(input))
//qDebug() << expectedFiles;
}
-
- // ### FIXME: This will fail on Symbian on some tests and some environments until the file engine and QFileSystemModel
- // are fixed to properly capitalize paths, so that some folders are not duplicated in QFileSystemModel.
-#if defined(Q_OS_SYMBIAN)
- QSKIP("This will fail on Symbian on some tests and some environments until the file engine and QFileSystemModel are fixed to properly capitalize paths", SkipAll);
-#endif
QTRY_COMPARE(cModel->rowCount(), expected);
} QT_CATCH(...) {
qDeleteAll(files);
QVERIFY(listView);
for (int i = 0; i < list.count(); ++i) {
fd.selectFile(fd.directory().path() + "/" + list.at(i));
-#if defined(QT_MAC_USE_COCOA) || defined(Q_WS_WIN) || defined(Q_OS_SYMBIAN)
- QEXPECT_FAIL("", "This test does not work on Mac, Windows, or Symbian", Abort);
+#if defined(QT_MAC_USE_COCOA) || defined(Q_WS_WIN)
+ QEXPECT_FAIL("", "This test does not work on Mac or Windows", Abort);
#endif
QTRY_VERIFY(!listView->selectionModel()->selectedRows().isEmpty());
toSelect.append(listView->selectionModel()->selectedRows().last());
void tst_QFiledialog::hooks()
{
-#ifdef Q_OS_SYMBIAN
- if(QSysInfo::symbianVersion() < QSysInfo::SV_SF_3)
- QSKIP("writing to data exports in paged dll not supported and crashes on symbian versions prior to ^3", SkipAll);
-#endif
qt_filedialog_existing_directory_hook = &existing;
qt_filedialog_save_filename_hook = &saveName;
qt_filedialog_open_filename_hook = &openName;
SOURCES += tst_qfiledialog2.cpp
-wince*|symbian {
+wince* {
addFiles.files = *.cpp
addFiles.path = .
filesInDir.files = *.pro
DEPLOYMENT += addFiles filesInDir
}
-symbian:TARGET.EPOCHEAPSIZE="0x100 0x1000000"
-symbian:HEADERS += ../../../include/qtgui/private/qfileinfogatherer_p.h
-
wince* {
DEFINES += SRCDIR=\\\"./\\\"
-} else:symbian {
- TARGET.UID3 = 0xE0340003
- DEFINES += SYMBIAN_SRCDIR_UID=$$lower($$replace(TARGET.UID3,"0x",""))
} else {
DEFINES += SRCDIR=\\\"$$PWD/\\\"
}
//TESTED_CLASS=
//TESTED_FILES=
-#if defined(Q_OS_SYMBIAN)
-# define STRINGIFY(x) #x
-# define TOSTRING(x) STRINGIFY(x)
-# define SRCDIR "C:/Private/" TOSTRING(SYMBIAN_SRCDIR_UID) "/"
-#endif
-
#if defined QT_BUILD_INTERNAL
QT_BEGIN_NAMESPACE
Q_GUI_EXPORT bool qt_test_isFetchedRoot();
SOURCES += tst_qfilesystemmodel.cpp
TARGET = tst_qfilesystemmodel
-
-symbian: {
- HEADERS += ../../../include/qtgui/private/qfileinfogatherer_p.h
-
- # need to deploy something to create the private directory
- dummyDeploy.files = tst_qfilesystemmodel.cpp
- dummyDeploy.path = .
- DEPLOYMENT += dummyDeploy
- LIBS += -lefsrv
-}
#include <QTime>
#include <QStyle>
#include <QtGlobal>
-#if defined(Q_OS_SYMBIAN)
-# include <f32file.h>
-#endif
+
//TESTED_CLASS=
//TESTED_FILES=
} \
} while(0)
-#if defined(Q_OS_SYMBIAN)
-static HBufC* qt_QString2HBufCNewL(const QString& aString)
-{
- HBufC *buffer;
-#ifdef QT_NO_UNICODE
- TPtrC8 ptr(reinterpret_cast<const TUint8*>(aString.toLocal8Bit().constData()));
- buffer = HBufC8::NewL(ptr.Length());
- buffer->Des().Copy(ptr);
-#else
- TPtrC16 ptr(reinterpret_cast<const TUint16*>(aString.utf16()));
- buffer = HBufC16::NewL(ptr.Length());
- buffer->Des().Copy(ptr);
-#endif
- return buffer;
-}
-#endif
-
class tst_QFileSystemModel : public QObject {
Q_OBJECT
private:
QFileSystemModel *model;
QString flatDirTestPath;
-#if defined(Q_OS_SYMBIAN)
- RFs rfs;
-#endif
};
tst_QFileSystemModel::tst_QFileSystemModel() : model(0)
qsrand(midnight.secsTo(QTime::currentTime()));
// generating unique temporary directory name
flatDirTestPath = QDir::temp().path() + '/' + QString("flatdirtest.") + QString::number(qrand());
-#if defined(Q_OS_SYMBIAN)
- rfs.Connect();
-#endif
}
tst_QFileSystemModel::~tst_QFileSystemModel()
{
-#if defined(Q_OS_SYMBIAN)
- rfs.Close();
-#endif
QString tmp = flatDirTestPath;
QDir dir(tmp);
if (dir.exists() && !dir.rmdir(tmp))
void tst_QFileSystemModel::indexPath()
{
-#if !defined(Q_OS_WIN) && !defined(Q_OS_SYMBIAN)
+#if !defined(Q_OS_WIN)
int depth = QDir::currentPath().count('/');
model->setRootPath(QDir::currentPath());
QTest::qWait(WAITTIME);
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
if (initial_files.at(i)[0] == '.')
QProcess::execute(QString("attrib +h %1").arg(file.fileName()));
-#elif defined(Q_OS_SYMBIAN)
- if (initial_files.at(i)[0] == '.') {
- HBufC* buffer = qt_QString2HBufCNewL(QDir::toNativeSeparators(file.fileName()));
- rfs.SetAtt(*buffer, KEntryAttHidden, 0);
- delete buffer;
- }
#endif
//qDebug() << test_path + '/' + initial_files.at(i) << (QFile::exists(test_path + '/' + initial_files.at(i)));
}
QTest::addColumn<int>("dirFilters");
QTest::addColumn<QStringList>("nameFilters");
QTest::addColumn<int>("rowCount");
-#if !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN)
+#if !defined(Q_OS_WINCE)
QTest::newRow("no dirs") << (QStringList() << "a" << "b" << "c") << QStringList() << (int)(QDir::Dirs) << QStringList() << 2;
QTest::newRow("no dirs - dot") << (QStringList() << "a" << "b" << "c") << QStringList() << (int)(QDir::Dirs | QDir::NoDot) << QStringList() << 1;
QTest::newRow("no dirs - dotdot") << (QStringList() << "a" << "b" << "c") << QStringList() << (int)(QDir::Dirs | QDir::NoDotDot) << QStringList() << 1;
QTest::newRow("no dir + hidden") << (QStringList() << "a" << "b" << "c") << QStringList() << (int)(QDir::Dirs | QDir::Hidden) << QStringList() << 0;
QTest::newRow("dir+hid+files") << (QStringList() << "a" << "b" << "c") << QStringList() <<
(int)(QDir::Dirs | QDir::Files | QDir::Hidden) << QStringList() << 3;
-#if defined(Q_OS_SYMBIAN)
- // Some symbian envs have a bug that causes "A" and ".A" to be considered same name in file system.
- QTest::newRow("dir+file+hid-dot .D") << (QStringList() << "a" << "b" << "c") << (QStringList() << ".D") <<
-#else
QTest::newRow("dir+file+hid-dot .A") << (QStringList() << "a" << "b" << "c") << (QStringList() << ".A") <<
-#endif
(int)(QDir::Dirs | QDir::Files | QDir::Hidden | QDir::NoDotAndDotDot) << QStringList() << 4;
QTest::newRow("dir+files+hid+dot A") << (QStringList() << "a" << "b" << "c") << (QStringList() << "AFolder") <<
(int)(QDir::Dirs | QDir::Files | QDir::Hidden | QDir::NoDotAndDotDot) << (QStringList() << "A*") << 2;
RESOURCES += images.qrc
win32:!wince*: LIBS += -lUser32
-!wince*:!symbian:DEFINES += SRCDIR=\\\"$$PWD\\\"
+!wince*:DEFINES += SRCDIR=\\\"$$PWD\\\"
DEFINES += QT_NO_CAST_TO_ASCII
-wince*|symbian: {
+wince* {
rootFiles.files = Ash_European.jpg graphicsScene_selection.data
rootFiles.path = .
renderFiles.files = testData\\render\\*
renderFiles.path = testData\\render
DEPLOYMENT += rootFiles renderFiles
-}
-wince*:{
DEFINES += SRCDIR=\\\".\\\"
}
-symbian:TARGET.EPOCHEAPSIZE="0x100000 0x1000000" # Min 1Mb, max 16Mb
contains(QT_CONFIG,xcb):qpa:CONFIG+=insignificant_test # QTBUG-20756 crashes on qpa, xcb
#define Q_CHECK_PAINTEVENTS
#endif
-#ifdef Q_OS_SYMBIAN
-// In Symbian OS test data is located in applications private dir
-// Current path (C:\private\<UID>) contains only ascii chars
-#define SRCDIR QDir::currentPath().append("\\").toAscii()
-#endif
-
//TESTED_CLASS=
//TESTED_FILES=
SOURCES += tst_qgraphicsview.cpp tst_qgraphicsview_2.cpp
DEFINES += QT_NO_CAST_TO_ASCII
-symbian:TARGET.EPOCHEAPSIZE = 1000000 10000000
contains(QT_CONFIG,xcb):qpa:CONFIG+=insignificant_test # QTBUG-20756 crashes on qpa, xcb
QSKIP("No Motif style compiled.", SkipSingle);
#endif
} else {
-#if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
+#if defined(Q_OS_WINCE)
view.setStyle(new QWindowsStyle);
#elif !defined(QT_NO_STYLE_PLASTIQUE)
view.setStyle(new QPlastiqueStyle);
#if defined(Q_OS_WINCE)
QFont font(QLatin1String("Tahoma"), 7);
view->setFont(font);
-#elif defined(Q_OS_SYMBIAN)
- QFont font(QLatin1String("Series 60 Sans"), 6);
- view->setFont(font);
#endif
view->setStretchLastSection(true);
topLevel->show();
QT += widgets
SOURCES += tst_qinputcontext.cpp
-symbian {
- LIBS += -lws32 -lcone
-}
-
mac*:CONFIG+=insignificant_test
CONFIG += insignificant_test # QTBUG-21402
#include <qgraphicswebview.h>
#endif
-#ifdef Q_OS_SYMBIAN
-#include <private/qt_s60_p.h>
-#include <private/qcoefepinputcontext_p.h>
-
-#include <w32std.h>
-#include <coecntrl.h>
-#endif
-
class tst_QInputContext : public QObject
{
Q_OBJECT
tst_QInputContext() : m_phoneIsQwerty(false) {}
virtual ~tst_QInputContext() {}
- template <class WidgetType> void symbianTestCoeFepInputContext_addData();
-
public slots:
- void initTestCase();
void cleanupTestCase() {}
void init() {}
void cleanup() {}
void closeSoftwareInputPanel();
void selections();
void focusProxy();
- void symbianTestCoeFepInputContext_data();
- void symbianTestCoeFepInputContext();
- void symbianTestCoeFepAutoCommit_data();
- void symbianTestCoeFepAutoCommit();
private:
bool m_phoneIsQwerty;
};
-#ifdef Q_OS_SYMBIAN
-class KeyEvent : public TWsEvent
-{
-public:
- KeyEvent(QWidget *w, TInt type, TInt scanCode, TUint code, TUint modifiers, TInt repeats) {
- iHandle = w->effectiveWinId()->DrawableWindow()->WindowGroupId();
- iType = type;
- SetTimeNow();
- TKeyEvent *keyEvent = reinterpret_cast<TKeyEvent *>(iEventData);
- keyEvent->iScanCode = scanCode;
- keyEvent->iCode = code;
- keyEvent->iModifiers = modifiers;
- keyEvent->iRepeats = repeats;
- }
-};
-
-class FepReplayEvent
-{
-public:
- enum Type {
- Pause,
- Key,
- CompleteKey
- };
-
- FepReplayEvent(int msecsToPause)
- : m_type(Pause)
- , m_msecsToPause(msecsToPause)
- {
- }
-
- FepReplayEvent(TInt keyType, TInt scanCode, TUint code, TUint modifiers, TInt repeats)
- : m_type(Key)
- , m_keyType(keyType)
- , m_scanCode(scanCode)
- , m_code(code)
- , m_modifiers(modifiers)
- , m_repeats(repeats)
- {
- }
-
- FepReplayEvent(TInt scanCode, TUint code, TUint modifiers, TInt repeats)
- : m_type(CompleteKey)
- , m_scanCode(scanCode)
- , m_code(code)
- , m_modifiers(modifiers)
- , m_repeats(repeats)
- {
- }
-
- void sendEvent(QWidget *w, TInt type, TInt scanCode, TUint code, TUint modifiers, TInt repeats)
- {
- KeyEvent event(w, type, scanCode, code, modifiers, repeats);
- S60->wsSession().SendEventToWindowGroup(w->effectiveWinId()->DrawableWindow()->WindowGroupId(), event);
- }
-
- void pause(int msecs)
- {
- // Don't use qWait here. The polling nature of that function screws up the test.
- QTimer timer;
- QEventLoop loop;
- QObject::connect(&timer, SIGNAL(timeout()), &loop, SLOT(quit()));
- timer.setSingleShot(true);
- timer.start(msecs);
- loop.exec();
- }
-
- // For some reason, the test fails if using processEvents instead of an event loop
- // with a timer to quit it, so use the timer.
-#define KEY_WAIT 10
-
- void replay(QWidget *w)
- {
- if (m_type == Pause) {
- pause(m_msecsToPause);
- } else if (m_type == Key) {
- sendEvent(w, m_keyType, m_scanCode, m_code, m_modifiers, m_repeats);
- if (m_keyType != EEventKeyDown)
- // EEventKeyDown events should have no pause before the EEventKey event.
- pause(KEY_WAIT);
- } else if (m_type == CompleteKey) {
- sendEvent(w, EEventKeyDown, m_scanCode, 0, m_modifiers, m_repeats);
- // EEventKeyDown events should have no pause before the EEventKey event.
- sendEvent(w, EEventKey, m_scanCode, m_code, m_modifiers, m_repeats);
- pause(KEY_WAIT);
- sendEvent(w, EEventKeyUp, m_scanCode, 0, m_modifiers, m_repeats);
- pause(KEY_WAIT);
- }
- }
-
-private:
- Type m_type;
- int m_msecsToPause;
- TInt m_keyType;
- TInt m_scanCode;
- TUint m_code;
- TUint m_modifiers;
- TInt m_repeats;
-};
-
-Q_DECLARE_METATYPE(QList<FepReplayEvent>)
-Q_DECLARE_METATYPE(Qt::InputMethodHints)
-Q_DECLARE_METATYPE(QLineEdit::EchoMode);
-
-#endif // Q_OS_SYMBIAN
-
-void tst_QInputContext::initTestCase()
-{
-#ifdef Q_OS_SYMBIAN
- // Sanity test. Checks FEP for:
- // - T9 mode is default (it will attempt to fix this)
- // - Language is English (it cannot fix this; bail out if not correct)
- QWidget w;
- QLayout *layout = new QVBoxLayout;
- w.setLayout(layout);
- QLineEdit *lineedit = new QLineEdit;
- layout->addWidget(lineedit);
- lineedit->setFocus();
-#ifdef QT_KEYPAD_NAVIGATION
- lineedit->setEditFocus(true);
-#endif
- w.show();
-
- QDesktopWidget desktop;
- QRect screenSize = desktop.screenGeometry(&w);
- if (screenSize.width() > screenSize.height()) {
- // Crude way of finding out we are running on a qwerty phone.
- m_phoneIsQwerty = true;
- return;
- }
-
- for (int iterations = 0; iterations < 16; iterations++) {
- QTest::qWait(500);
-
- QList<FepReplayEvent> keyEvents;
-
- keyEvents << FepReplayEvent('9', '9', 0, 0);
- keyEvents << FepReplayEvent('6', '6', 0, 0);
- keyEvents << FepReplayEvent('8', '8', 0, 0);
- keyEvents << FepReplayEvent(EStdKeyRightArrow, EKeyRightArrow, 0, 0);
-
- foreach(FepReplayEvent event, keyEvents) {
- event.replay(lineedit);
- }
-
- QApplication::processEvents();
-
- if (lineedit->text().endsWith("you", Qt::CaseInsensitive)) {
- // Success!
- return;
- }
-
- // Try changing modes.
- // After 8 iterations, try to press the mode switch twice before typing.
- for (int c = 0; c <= iterations / 8; c++) {
- FepReplayEvent(EStdKeyHash, '#', 0, 0).replay(lineedit);
- }
- }
-
- QFAIL("FEP sanity test failed. Either the phone is not set to English, or the test was unable to enable T9");
-#endif
-}
-
void tst_QInputContext::maximumTextLength()
{
QLineEdit le;
};
#endif // QT_WEBKIT_LIB
-void tst_QInputContext::symbianTestCoeFepInputContext_data()
-{
-#ifdef Q_OS_SYMBIAN
- QTest::addColumn<QWidget *> ("editwidget");
- QTest::addColumn<bool> ("inputMethodEnabled");
- QTest::addColumn<Qt::InputMethodHints> ("inputMethodHints");
- QTest::addColumn<int> ("maxLength"); // Zero for no limit
- QTest::addColumn<QLineEdit::EchoMode> ("echoMode");
- QTest::addColumn<QList<FepReplayEvent> > ("keyEvents");
- QTest::addColumn<QString> ("finalString");
- QTest::addColumn<QString> ("preeditString");
-
- symbianTestCoeFepInputContext_addData<QLineEdit>();
- symbianTestCoeFepInputContext_addData<QPlainTextEdit>();
- symbianTestCoeFepInputContext_addData<QTextEdit>();
-# ifdef QT_WEBKIT_LIB
- symbianTestCoeFepInputContext_addData<AutoWebView>();
- symbianTestCoeFepInputContext_addData<AutoGraphicsWebView>();
-# endif
-#endif
-}
-
-Q_DECLARE_METATYPE(QWidget *)
-Q_DECLARE_METATYPE(QLineEdit *)
-Q_DECLARE_METATYPE(QPlainTextEdit *)
-Q_DECLARE_METATYPE(QTextEdit *)
-
-template <class WidgetType>
-void tst_QInputContext::symbianTestCoeFepInputContext_addData()
-{
-#ifdef Q_OS_SYMBIAN
- QList<FepReplayEvent> events;
- QWidget *editwidget;
-
- events << FepReplayEvent(EStdKeyBackspace, EKeyBackspace, 0, 0);
- events << FepReplayEvent(EStdKeyBackspace, EKeyBackspace, 0, 0);
- events << FepReplayEvent('5', '5', 0, 0);
- events << FepReplayEvent('4', '4', 0, 0);
- events << FepReplayEvent('6', '6', 0, 0);
- events << FepReplayEvent(EStdKeyBackspace, EKeyBackspace, 0, 0);
- events << FepReplayEvent(EStdKeyBackspace, EKeyBackspace, 0, 0);
- events << FepReplayEvent('1', '1', 0, 0);
- events << FepReplayEvent(EStdKeyBackspace, EKeyBackspace, 0, 0);
- events << FepReplayEvent('2', '2', 0, 0);
- events << FepReplayEvent('1', '1', 0, 0);
- editwidget = new WidgetType;
- QTest::newRow(QString(QString::fromLatin1(editwidget->metaObject()->className())
- + ": Numbers (no FEP)").toLocal8Bit())
- << editwidget
- << false
- << Qt::InputMethodHints(Qt::ImhNone)
- << 0
- << QLineEdit::Normal
- << events
- << QString("521")
- << QString("");
- editwidget = new WidgetType;
- QTest::newRow(QString(QString::fromLatin1(editwidget->metaObject()->className())
- + ": Numbers and password mode (no FEP)").toLocal8Bit())
- << editwidget
- << false
- << Qt::InputMethodHints(Qt::ImhNone)
- << 0
- << QLineEdit::Password
- << events
- << QString("521")
- << QString("");
- editwidget = new WidgetType;
- QTest::newRow(QString(QString::fromLatin1(editwidget->metaObject()->className())
- + ": Numbers").toLocal8Bit())
- << editwidget
- << true
- << Qt::InputMethodHints(Qt::ImhDigitsOnly)
- << 0
- << QLineEdit::Normal
- << events
- << QString("521")
- << QString("");
- editwidget = new WidgetType;
- QTest::newRow(QString(QString::fromLatin1(editwidget->metaObject()->className())
- + ": Numbers max length (no FEP)").toLocal8Bit())
- << editwidget
- << false
- << Qt::InputMethodHints(Qt::ImhNone)
- << 2
- << QLineEdit::Normal
- << events
- << QString("21")
- << QString("");
- editwidget = new WidgetType;
- QTest::newRow(QString(QString::fromLatin1(editwidget->metaObject()->className())
- + ": Numbers max length").toLocal8Bit())
- << editwidget
- << true
- << Qt::InputMethodHints(Qt::ImhDigitsOnly)
- << 2
- << QLineEdit::Normal
- << events
- << QString("21")
- << QString("");
- events.clear();
-
- events << FepReplayEvent(EEventKeyDown, '5', 0, 0, 0);
- events << FepReplayEvent(EEventKey, '5', '5', 0, 0);
- events << FepReplayEvent(EEventKey, '5', '5', 0, 1);
- events << FepReplayEvent(EEventKey, '5', '5', 0, 1);
- events << FepReplayEvent(EEventKeyUp, '5', 0, 0, 0);
- editwidget = new WidgetType;
- QTest::newRow(QString(QString::fromLatin1(editwidget->metaObject()->className())
- + ": Numbers and autorepeat (no FEP)").toLocal8Bit())
- << editwidget
- << false
- << Qt::InputMethodHints(Qt::ImhNone)
- << 0
- << QLineEdit::Normal
- << events
- << QString("555")
- << QString("");
- events.clear();
-
- events << FepReplayEvent(EStdKeyBackspace, EKeyBackspace, 0, 0);
- events << FepReplayEvent('2', '2', 0, 0);
- events << FepReplayEvent('3', '3', 0, 0);
- events << FepReplayEvent('4', '4', 0, 0);
- events << FepReplayEvent('4', '4', 0, 0);
- events << FepReplayEvent('5', '5', 0, 0);
- events << FepReplayEvent('5', '5', 0, 0);
- events << FepReplayEvent(EStdKeyBackspace, EKeyBackspace, 0, 0);
- editwidget = new WidgetType;
- QTest::newRow(QString(QString::fromLatin1(editwidget->metaObject()->className())
- + ": Multitap").toLocal8Bit())
- << editwidget
- << true
- << Qt::InputMethodHints(Qt::ImhNoPredictiveText)
- << 0
- << QLineEdit::Normal
- << events
- << QString("Adh")
- << QString("");
- editwidget = new WidgetType;
- QTest::newRow(QString(QString::fromLatin1(editwidget->metaObject()->className())
- + ": Multitap with no auto uppercase").toLocal8Bit())
- << editwidget
- << true
- << Qt::InputMethodHints(Qt::ImhNoPredictiveText | Qt::ImhNoAutoUppercase)
- << 0
- << QLineEdit::Normal
- << events
- << QString("adh")
- << QString("");
- editwidget = new WidgetType;
- QTest::newRow(QString(QString::fromLatin1(editwidget->metaObject()->className())
- + ": Multitap with uppercase").toLocal8Bit())
- << editwidget
- << true
- << Qt::InputMethodHints(Qt::ImhNoPredictiveText | Qt::ImhPreferUppercase)
- << 0
- << QLineEdit::Normal
- << events
- << QString("ADH")
- << QString("");
- editwidget = new WidgetType;
- QTest::newRow(QString(QString::fromLatin1(editwidget->metaObject()->className())
- + ": Multitap with lowercase").toLocal8Bit())
- << editwidget
- << true
- << Qt::InputMethodHints(Qt::ImhNoPredictiveText | Qt::ImhPreferLowercase)
- << 0
- << QLineEdit::Normal
- << events
- << QString("adh")
- << QString("");
- editwidget = new WidgetType;
- QTest::newRow(QString(QString::fromLatin1(editwidget->metaObject()->className())
- + ": Multitap with forced uppercase").toLocal8Bit())
- << editwidget
- << true
- << Qt::InputMethodHints(Qt::ImhNoPredictiveText | Qt::ImhUppercaseOnly)
- << 0
- << QLineEdit::Normal
- << events
- << QString("ADH")
- << QString("");
- editwidget = new WidgetType;
- QTest::newRow(QString(QString::fromLatin1(editwidget->metaObject()->className())
- + ": Multitap with forced lowercase").toLocal8Bit())
- << editwidget
- << true
- << Qt::InputMethodHints(Qt::ImhNoPredictiveText | Qt::ImhLowercaseOnly)
- << 0
- << QLineEdit::Normal
- << events
- << QString("adh")
- << QString("");
- events.clear();
-
- events << FepReplayEvent(EStdKeyHash, '#', 0, 0);
- events << FepReplayEvent('2', '2', 0, 0);
- events << FepReplayEvent('2', '2', 0, 0);
- events << FepReplayEvent('3', '3', 0, 0);
- events << FepReplayEvent('4', '4', 0, 0);
- events << FepReplayEvent('4', '4', 0, 0);
- events << FepReplayEvent('5', '5', 0, 0);
- events << FepReplayEvent('5', '5', 0, 0);
- events << FepReplayEvent(EStdKeyBackspace, EKeyBackspace, 0, 0);
- editwidget = new WidgetType;
- QTest::newRow(QString(QString::fromLatin1(editwidget->metaObject()->className())
- + ": Multitap with mode switch").toLocal8Bit())
- << editwidget
- << true
- << Qt::InputMethodHints(Qt::ImhNoPredictiveText)
- << 0
- << QLineEdit::Normal
- << events
- << QString("bdh")
- << QString("");
- events.clear();
-
- events << FepReplayEvent('7', '7', 0, 0);
- events << FepReplayEvent('7', '7', 0, 0);
- events << FepReplayEvent('8', '8', 0, 0);
- events << FepReplayEvent('9', '9', 0, 0);
- events << FepReplayEvent('9', '9', 0, 0);
- editwidget = new WidgetType;
- QTest::newRow(QString(QString::fromLatin1(editwidget->metaObject()->className())
- + ": Multitap with unfinished text").toLocal8Bit())
- << editwidget
- << true
- << Qt::InputMethodHints(Qt::ImhNoPredictiveText)
- << 0
- << QLineEdit::Normal
- << events
- << QString("Qt")
- << QString("x");
- events << FepReplayEvent(2000);
- editwidget = new WidgetType;
- QTest::newRow(QString(QString::fromLatin1(editwidget->metaObject()->className())
- + ": Multitap with committed text").toLocal8Bit())
- << editwidget
- << true
- << Qt::InputMethodHints(Qt::ImhNoPredictiveText)
- << 0
- << QLineEdit::Normal
- << events
- << QString("Qtx")
- << QString("");
- events.clear();
-
- events << FepReplayEvent('4', '4', 0, 0);
- events << FepReplayEvent('4', '4', 0, 0);
- // Simulate holding down hash key.
- events << FepReplayEvent(EEventKeyDown, EStdKeyHash, 0, 0, 0);
- events << FepReplayEvent(EEventKey, EStdKeyHash, '#', 0, 0);
- events << FepReplayEvent(500);
- events << FepReplayEvent(EEventKey, EStdKeyHash, '#', 0, 1);
- events << FepReplayEvent(EEventKey, EStdKeyHash, '#', 0, 1);
- events << FepReplayEvent(EEventKey, EStdKeyHash, '#', 0, 1);
- events << FepReplayEvent(EEventKeyUp, EStdKeyHash, 0, 0, 0);
- events << FepReplayEvent('7', '7', 0, 0);
- events << FepReplayEvent('7', '7', 0, 0);
- events << FepReplayEvent('8', '8', 0, 0);
- // QTBUG-9867: Switch back as well to make sure we don't get extra symbols
- events << FepReplayEvent(EEventKeyDown, EStdKeyHash, 0, 0, 0);
- events << FepReplayEvent(EEventKey, EStdKeyHash, '#', 0, 0);
- events << FepReplayEvent(500);
- events << FepReplayEvent(EEventKey, EStdKeyHash, '#', 0, 1);
- events << FepReplayEvent(EEventKey, EStdKeyHash, '#', 0, 1);
- events << FepReplayEvent(EEventKey, EStdKeyHash, '#', 0, 1);
- events << FepReplayEvent(EEventKeyUp, EStdKeyHash, 0, 0, 0);
- events << FepReplayEvent('9', '9', 0, 0);
- events << FepReplayEvent('6', '6', 0, 0);
- events << FepReplayEvent('8', '8', 0, 0);
- events << FepReplayEvent(2000);
- events << FepReplayEvent(EStdKeyDevice3, EKeyDevice3, 0, 0); // Select key
- editwidget = new WidgetType;
- QTest::newRow(QString(QString::fromLatin1(editwidget->metaObject()->className())
- + ": Multitap and numbers").toLocal8Bit())
- << editwidget
- << true
- << Qt::InputMethodHints(Qt::ImhNoPredictiveText)
- << 0
- << QLineEdit::Normal
- << events
- << QString("H778wmt")
- << QString("");
- editwidget = new WidgetType;
- QTest::newRow(QString(QString::fromLatin1(editwidget->metaObject()->className())
- + ": T9 and numbers").toLocal8Bit())
- << editwidget
- << true
- << Qt::InputMethodHints(Qt::ImhPreferLowercase)
- << 0
- << QLineEdit::Normal
- << events
- << QString("hi778you")
- << QString("");
- events.clear();
-
- events << FepReplayEvent('4', '4', 0, 0);
- events << FepReplayEvent('4', '4', 0, 0);
- events << FepReplayEvent(EStdKeyDevice3, EKeyDevice3, 0, 0); // Select key
- editwidget = new WidgetType;
- QTest::newRow(QString(QString::fromLatin1(editwidget->metaObject()->className())
- + ": T9").toLocal8Bit())
- << editwidget
- << true
- << Qt::InputMethodHints(Qt::ImhPreferLowercase)
- << 0
- << QLineEdit::Normal
- << events
- << QString("hi")
- << QString("");
- editwidget = new WidgetType;
- QTest::newRow(QString(QString::fromLatin1(editwidget->metaObject()->className())
- + ": T9 with uppercase").toLocal8Bit())
- << editwidget
- << true
- << Qt::InputMethodHints(Qt::ImhPreferUppercase)
- << 0
- << QLineEdit::Normal
- << events
- << QString("HI")
- << QString("");
- editwidget = new WidgetType;
- QTest::newRow(QString(QString::fromLatin1(editwidget->metaObject()->className())
- + ": T9 with forced lowercase").toLocal8Bit())
- << editwidget
- << true
- << Qt::InputMethodHints(Qt::ImhLowercaseOnly)
- << 0
- << QLineEdit::Normal
- << events
- << QString("hi")
- << QString("");
- editwidget = new WidgetType;
- QTest::newRow(QString(QString::fromLatin1(editwidget->metaObject()->className())
- + ": T9 with forced uppercase").toLocal8Bit())
- << editwidget
- << true
- << Qt::InputMethodHints(Qt::ImhUppercaseOnly)
- << 0
- << QLineEdit::Normal
- << events
- << QString("HI")
- << QString("");
- editwidget = new WidgetType;
- QTest::newRow(QString(QString::fromLatin1(editwidget->metaObject()->className())
- + ": T9 with maxlength").toLocal8Bit())
- << editwidget
- << true
- << Qt::InputMethodHints(Qt::ImhLowercaseOnly)
- << 1
- << QLineEdit::Normal
- << events
- << QString("i")
- << QString("");
- events.clear();
-
- events << FepReplayEvent('4', '4', 0, 0);
- events << FepReplayEvent('4', '4', 0, 0);
- events << FepReplayEvent(EStdKeyLeftArrow, EKeyLeftArrow, 0, 0);
- events << FepReplayEvent(EStdKeyLeftArrow, EKeyLeftArrow, 0, 0);
- events << FepReplayEvent('9', '9', 0, 0);
- events << FepReplayEvent('6', '6', 0, 0);
- events << FepReplayEvent('8', '8', 0, 0);
- events << FepReplayEvent('0', '0', 0, 0);
- events << FepReplayEvent(EStdKeyRightArrow, EKeyRightArrow, 0, 0);
- events << FepReplayEvent(EStdKeyRightArrow, EKeyRightArrow, 0, 0);
- events << FepReplayEvent('8', '8', 0, 0);
- events << FepReplayEvent('8', '8', 0, 0);
- editwidget = new WidgetType;
- QTest::newRow(QString(QString::fromLatin1(editwidget->metaObject()->className())
- + ": T9 with movement and unfinished text").toLocal8Bit())
- << editwidget
- << true
- << Qt::InputMethodHints(Qt::ImhPreferLowercase)
- << 0
- << QLineEdit::Normal
- << events
- << QString("you hi")
- << QString("tv");
- editwidget = new WidgetType;
- QTest::newRow(QString(QString::fromLatin1(editwidget->metaObject()->className())
- + ": T9 with movement, password and unfinished text").toLocal8Bit())
- << editwidget
- << true
- << Qt::InputMethodHints(Qt::ImhPreferLowercase)
- << 0
- << QLineEdit::Password
- << events
- << QString("wmt h")
- << QString("u");
- editwidget = new WidgetType;
- QTest::newRow(QString(QString::fromLatin1(editwidget->metaObject()->className())
- + ": T9 with movement, maxlength, password and unfinished text").toLocal8Bit())
- << editwidget
- << true
- << Qt::InputMethodHints(Qt::ImhPreferLowercase)
- << 2
- << QLineEdit::Password
- << events
- << QString("wh")
- << QString("");
- editwidget = new WidgetType;
- QTest::newRow(QString(QString::fromLatin1(editwidget->metaObject()->className())
- + ": T9 with movement, maxlength and unfinished text").toLocal8Bit())
- << editwidget
- << true
- << Qt::InputMethodHints(Qt::ImhPreferLowercase)
- << 2
- << QLineEdit::Normal
- << events
- << QString("hi")
- << QString("");
- editwidget = new WidgetType;
- QTest::newRow(QString(QString::fromLatin1(editwidget->metaObject()->className())
- + ": Multitap with movement and unfinished text").toLocal8Bit())
- << editwidget
- << true
- << Qt::InputMethodHints(Qt::ImhNoPredictiveText | Qt::ImhPreferLowercase)
- << 0
- << QLineEdit::Normal
- << events
- << QString("wmt h")
- << QString("u");
- editwidget = new WidgetType;
- QTest::newRow(QString(QString::fromLatin1(editwidget->metaObject()->className())
- + ": Multitap with movement, maxlength and unfinished text").toLocal8Bit())
- << editwidget
- << true
- << Qt::InputMethodHints(Qt::ImhNoPredictiveText | Qt::ImhPreferLowercase)
- << 2
- << QLineEdit::Normal
- << events
- << QString("wh")
- << QString("");
- editwidget = new WidgetType;
- QTest::newRow(QString(QString::fromLatin1(editwidget->metaObject()->className())
- + ": Numbers with movement").toLocal8Bit())
- << editwidget
- << true
- << Qt::InputMethodHints(Qt::ImhDigitsOnly)
- << 0
- << QLineEdit::Normal
- << events
- << QString("96804488")
- << QString("");
- editwidget = new WidgetType;
- QTest::newRow(QString(QString::fromLatin1(editwidget->metaObject()->className())
- + ": Numbers with movement and maxlength").toLocal8Bit())
- << editwidget
- << true
- << Qt::InputMethodHints(Qt::ImhDigitsOnly)
- << 2
- << QLineEdit::Normal
- << events
- << QString("44")
- << QString("");
- editwidget = new WidgetType;
- QTest::newRow(QString(QString::fromLatin1(editwidget->metaObject()->className())
- + ": Numbers with movement, password and unfinished text").toLocal8Bit())
- << editwidget
- << true
- << Qt::InputMethodHints(Qt::ImhDigitsOnly)
- << 0
- << QLineEdit::Password
- << events
- << QString("9680448")
- << QString("8");
- editwidget = new WidgetType;
- QTest::newRow(QString(QString::fromLatin1(editwidget->metaObject()->className())
- + ": Numbers with movement, maxlength, password and unfinished text").toLocal8Bit())
- << editwidget
- << true
- << Qt::InputMethodHints(Qt::ImhDigitsOnly)
- << 2
- << QLineEdit::Password
- << events
- << QString("44")
- << QString("");
- events << FepReplayEvent(EStdKeyRightArrow, EKeyRightArrow, 0, 0);
- editwidget = new WidgetType;
- QTest::newRow(QString(QString::fromLatin1(editwidget->metaObject()->className())
- + ": T9 with movement").toLocal8Bit())
- << editwidget
- << true
- << Qt::InputMethodHints(Qt::ImhPreferLowercase)
- << 0
- << QLineEdit::Normal
- << events
- << QString("you htvi")
- << QString("");
- editwidget = new WidgetType;
- QTest::newRow(QString(QString::fromLatin1(editwidget->metaObject()->className())
- + ": T9 with movement and password").toLocal8Bit())
- << editwidget
- << true
- << Qt::InputMethodHints(Qt::ImhPreferLowercase)
- << 0
- << QLineEdit::Password
- << events
- << QString("wmt hu")
- << QString("");
- editwidget = new WidgetType;
- QTest::newRow(QString(QString::fromLatin1(editwidget->metaObject()->className())
- + ": T9 with movement, maxlength and password").toLocal8Bit())
- << editwidget
- << true
- << Qt::InputMethodHints(Qt::ImhPreferLowercase)
- << 2
- << QLineEdit::Password
- << events
- << QString("wh")
- << QString("");
- editwidget = new WidgetType;
- QTest::newRow(QString(QString::fromLatin1(editwidget->metaObject()->className())
- + ": Multitap with movement").toLocal8Bit())
- << editwidget
- << true
- << Qt::InputMethodHints(Qt::ImhNoPredictiveText | Qt::ImhPreferLowercase)
- << 0
- << QLineEdit::Normal
- << events
- << QString("wmt hu")
- << QString("");
- editwidget = new WidgetType;
- QTest::newRow(QString(QString::fromLatin1(editwidget->metaObject()->className())
- + ": Multitap with movement and maxlength").toLocal8Bit())
- << editwidget
- << true
- << Qt::InputMethodHints(Qt::ImhNoPredictiveText | Qt::ImhPreferLowercase)
- << 2
- << QLineEdit::Normal
- << events
- << QString("wh")
- << QString("");
- editwidget = new WidgetType;
- QTest::newRow(QString(QString::fromLatin1(editwidget->metaObject()->className())
- + ": Numbers with movement and password").toLocal8Bit())
- << editwidget
- << true
- << Qt::InputMethodHints(Qt::ImhDigitsOnly)
- << 0
- << QLineEdit::Password
- << events
- << QString("96804488")
- << QString("");
- editwidget = new WidgetType;
- QTest::newRow(QString(QString::fromLatin1(editwidget->metaObject()->className())
- + ": Numbers with movement, maxlength and password").toLocal8Bit())
- << editwidget
- << true
- << Qt::InputMethodHints(Qt::ImhDigitsOnly)
- << 2
- << QLineEdit::Password
- << events
- << QString("44")
- << QString("");
- events.clear();
-
- // Test that the symbol key successfully does nothing when in number-only mode.
- events << FepReplayEvent(EEventKeyDown, EStdKeyLeftFunc, 0, 0, 0);
- events << FepReplayEvent(EEventKeyUp, EStdKeyLeftFunc, 0, 0, 0);
- editwidget = new WidgetType;
- QTest::newRow(QString(QString::fromLatin1(editwidget->metaObject()->className())
- + ": Dead symbols key").toLocal8Bit())
- << editwidget
- << true
- << Qt::InputMethodHints(Qt::ImhDigitsOnly)
- << 0
- << QLineEdit::Normal
- << events
- << QString("")
- << QString("");
- editwidget = new WidgetType;
- QTest::newRow(QString(QString::fromLatin1(editwidget->metaObject()->className())
- + ": Dead symbols key and password").toLocal8Bit())
- << editwidget
- << true
- << Qt::InputMethodHints(Qt::ImhDigitsOnly)
- << 0
- << QLineEdit::Password
- << events
- << QString("")
- << QString("");
- events.clear();
-#endif
-}
-
-void tst_QInputContext::symbianTestCoeFepInputContext()
-{
-#ifndef Q_OS_SYMBIAN
- QSKIP("This is a Symbian-only test", SkipAll);
-#else
- QCoeFepInputContext *ic = qobject_cast<QCoeFepInputContext *>(qApp->inputContext());
- if (!ic) {
- QSKIP("coefep is not the active input context; skipping test", SkipAll);
- }
-
- QFETCH(QWidget *, editwidget);
- QFETCH(bool, inputMethodEnabled);
- QFETCH(Qt::InputMethodHints, inputMethodHints);
- QFETCH(int, maxLength);
- QFETCH(QLineEdit::EchoMode, echoMode);
- QFETCH(QList<FepReplayEvent>, keyEvents);
- QFETCH(QString, finalString);
- QFETCH(QString, preeditString);
-
- if (inputMethodEnabled && m_phoneIsQwerty) {
- QSKIP("Skipping advanced input method tests on QWERTY phones", SkipSingle);
- }
-
- QWidget w;
- QLayout *layout = new QVBoxLayout;
- w.setLayout(layout);
-
- layout->addWidget(editwidget);
- editwidget->setFocus();
-#ifdef QT_KEYPAD_NAVIGATION
- editwidget->setEditFocus(true);
-#endif
- w.show();
-
- editwidget->setAttribute(Qt::WA_InputMethodEnabled, inputMethodEnabled);
- editwidget->setInputMethodHints(inputMethodHints);
- if (QLineEdit *lineedit = qobject_cast<QLineEdit *>(editwidget)) {
- if (maxLength > 0)
- lineedit->setMaxLength(maxLength);
- lineedit->setEchoMode(echoMode);
-#ifdef QT_WEBKIT_LIB
- } else if (AutoWebView *webView = qobject_cast<AutoWebView *>(editwidget)) {
- if (maxLength > 0)
- webView->setMaxLength(maxLength);
- webView->setEchoMode(echoMode);
- // WebKit disables T9 everywhere.
- if (inputMethodEnabled && !(inputMethodHints & Qt::ImhNoPredictiveText))
- return;
- } else if (AutoGraphicsWebView *webView = qobject_cast<AutoGraphicsWebView *>(editwidget)) {
- if (maxLength > 0)
- webView->setMaxLength(maxLength);
- webView->setEchoMode(echoMode);
- // WebKit disables T9 everywhere.
- if (inputMethodEnabled && !(inputMethodHints & Qt::ImhNoPredictiveText))
- return;
-#endif
- } else if (maxLength > 0 || echoMode != QLineEdit::Normal) {
- // Only some widgets support these features so don't attempt any tests using those
- // on other widgets.
- return;
- }
-
- QTest::qWait(200);
-
- foreach(FepReplayEvent event, keyEvents) {
- event.replay(editwidget);
- }
-
- QApplication::processEvents();
-
- QCOMPARE(editwidget->inputMethodQuery(Qt::ImSurroundingText).toString(), finalString);
- QCOMPARE(ic->m_preeditString, preeditString);
-
- delete editwidget;
-#endif
-}
-
-void tst_QInputContext::symbianTestCoeFepAutoCommit_data()
-{
-#ifdef Q_OS_SYMBIAN
- QTest::addColumn<Qt::InputMethodHints> ("inputMethodHints");
- QTest::addColumn<QLineEdit::EchoMode> ("echoMode");
- QTest::addColumn<QList<FepReplayEvent> > ("keyEvents");
- QTest::addColumn<QString> ("finalString");
-
- QList<FepReplayEvent> events;
-
- events << FepReplayEvent('4', '4', 0, 0);
- events << FepReplayEvent('4', '4', 0, 0);
- events << FepReplayEvent('0', '0', 0, 0);
- events << FepReplayEvent('9', '9', 0, 0);
- events << FepReplayEvent('6', '6', 0, 0);
- events << FepReplayEvent('8', '8', 0, 0);
- QTest::newRow("Numbers")
- << Qt::InputMethodHints(Qt::ImhDigitsOnly)
- << QLineEdit::Normal
- << events
- << QString("440968");
- QTest::newRow("Numbers and password")
- << Qt::InputMethodHints(Qt::ImhDigitsOnly)
- << QLineEdit::Password
- << events
- << QString("440968");
- QTest::newRow("Multitap")
- << Qt::InputMethodHints(Qt::ImhPreferLowercase | Qt::ImhNoPredictiveText)
- << QLineEdit::Normal
- << events
- << QString("h wmt");
- QTest::newRow("T9")
- << Qt::InputMethodHints(Qt::ImhPreferLowercase)
- << QLineEdit::Normal
- << events
- << QString("hi you");
- QTest::newRow("Multitap with password")
- << Qt::InputMethodHints(Qt::ImhPreferLowercase | Qt::ImhNoPredictiveText)
- << QLineEdit::Password
- << events
- << QString("h wmt");
- QTest::newRow("T9 with password")
- << Qt::InputMethodHints(Qt::ImhPreferLowercase)
- << QLineEdit::Password
- << events
- << QString("h wmt");
-#endif
-}
-
-void tst_QInputContext::symbianTestCoeFepAutoCommit()
-{
-#ifndef Q_OS_SYMBIAN
- QSKIP("This is a Symbian-only test", SkipAll);
-#else
- QCoeFepInputContext *ic = qobject_cast<QCoeFepInputContext *>(qApp->inputContext());
- if (!ic) {
- QSKIP("coefep is not the active input context; skipping test", SkipAll);
- }
-
- QFETCH(Qt::InputMethodHints, inputMethodHints);
- QFETCH(QLineEdit::EchoMode, echoMode);
- QFETCH(QList<FepReplayEvent>, keyEvents);
- QFETCH(QString, finalString);
-
- if (m_phoneIsQwerty) {
- QSKIP("Skipping advanced input method tests on QWERTY phones", SkipSingle);
- }
-
- QWidget w;
- QLayout *layout = new QVBoxLayout;
- w.setLayout(layout);
- QLineEdit *lineedit = new QLineEdit;
- layout->addWidget(lineedit);
- lineedit->setFocus();
-#ifdef QT_KEYPAD_NAVIGATION
- lineedit->setEditFocus(true);
-#endif
- QPushButton *pushButton = new QPushButton("Done");
- layout->addWidget(pushButton);
- QAction softkey("Done", &w);
- softkey.setSoftKeyRole(QAction::PositiveSoftKey);
- w.addAction(&softkey);
- w.show();
-
- lineedit->setInputMethodHints(inputMethodHints);
- lineedit->setEchoMode(echoMode);
-
- QTest::qWait(200);
- foreach(FepReplayEvent event, keyEvents) {
- event.replay(lineedit);
- }
- QApplication::processEvents();
-
- QTest::mouseClick(pushButton, Qt::LeftButton);
-
- QCOMPARE(lineedit->text(), finalString);
- QVERIFY(ic->m_preeditString.isEmpty());
-
-#ifdef Q_WS_S60
- lineedit->inputContext()->reset();
- lineedit->clear();
- lineedit->setFocus();
-#ifdef QT_KEYPAD_NAVIGATION
- lineedit->setEditFocus(true);
-#endif
-
- QTest::qWait(200);
- foreach(FepReplayEvent event, keyEvents) {
- event.replay(lineedit);
- }
- QApplication::processEvents();
-
- FepReplayEvent(EStdKeyDevice0, EKeyDevice0, 0, 0).replay(lineedit); // Left softkey
-
- QCOMPARE(lineedit->text(), finalString);
- QVERIFY(ic->m_preeditString.isEmpty());
-
-#endif // Q_WS_S60
-#endif // Q_OS_SYMBIAN
-}
-
QTEST_MAIN(tst_QInputContext)
#include "tst_qinputcontext.moc"
{
treeModel = new CheckerModel;
QModelIndex parent;
-#if defined(QT_ARCH_ARM) || defined(Q_OS_SYMBIAN)
+#if defined(QT_ARCH_ARM)
const int baseInsert = 4;
#else
const int baseInsert = 26;
view->setHorizontalScrollMode((QAbstractItemView::ScrollMode)hscroll);
view->setModel(treeModel);
view->show();
-#if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
+#if defined(Q_OS_WINCE)
srandom(0);
#else
srandom(time(0));
SOURCES += tst_qlabel.cpp
wince*::DEFINES += SRCDIR=\\\"\\\"
-else:!symbian:DEFINES += SRCDIR=\\\"$$PWD/\\\"
-wince*|symbian {
+else:DEFINES += SRCDIR=\\\"$$PWD/\\\"
+wince* {
addFiles.files = *.png \
testdata
addFiles.path = .
//TESTED_CLASS=
//TESTED_FILES=
-#if defined(Q_OS_SYMBIAN)
-# define SRCDIR ""
-#endif
#include "../../shared/util.h"
QT += widgets widgets-private
SOURCES += tst_qlayout.cpp
-wince*|symbian: {
+wince* {
addFiles.files = baseline
addFiles.path = .
DEPLOYMENT += addFiles
#include <qitemdelegate.h>
#include <qstandarditemmodel.h>
#include <qstringlistmodel.h>
-#ifndef Q_OS_SYMBIAN
#include <cmath>
-#endif
#include <math.h>
#include <QtWidgets/QScrollBar>
#include <QtWidgets/QDialog>
void tst_QListWidget::closePersistentEditor()
{
-#if defined(Q_OS_SYMBIAN)
- //give the Symbian app start event queue time to clear
- QTest::qWait(1000);
-#endif
-
// Boundary checking
int childCount = testWidget->viewport()->children().count();
testWidget->closePersistentEditor(0);
load(qttest_p4)
QT += widgets widgets-private
SOURCES += tst_qmainwindow.cpp
-# Symbian toolchain does not support correct include semantics
-symbian:INCPATH+=..\\..\\..\\include\\QtGui\\private
-
QSKIP("On Mac, we need to create native key events to test menu action activation", SkipAll);
#elif defined(Q_OS_WINCE)
QSKIP("On Windows CE, we need to create native key events to test menu action activation", SkipAll);
-#elif defined(Q_OS_SYMBIAN)
- QSKIP("On Symbian OS, we need to create native key events to test menu action activation", SkipAll);
#endif
QAction *aQuit = new QAction("Quit", &w);
main->setActiveAction(menuAction);
sub->setActiveAction(subAction);
-#ifdef Q_OS_SYMBIAN
- main->popup(QPoint(50,200));
-#else
main->popup(QPoint(200,200));
-#endif
QVERIFY(main->isVisible());
QCOMPARE(main->activeAction(), menuAction);
QSKIP("Not true for Windows Mobile Soft Keys", SkipSingle);
#endif
-#ifdef Q_OS_SYMBIAN
- // On Symbian, QS60Style::pixelMetric(QStyle::PM_SubMenuOverlap) is different with other styles.
- QVERIFY(sub->pos().x() < main->pos().x());
-#else
QVERIFY(sub->pos().x() > main->pos().x());
-#endif
QCOMPARE(sub->activeAction(), subAction);
}
QSKIP("QTBUG-20753 QCursor::setPos() / QTest::mouseMove() doesn't work on qpa", SkipAll);
#endif
Menu258920 menu;
- // On Symbian, styleHint(QStyle::SH_Menu_MouseTracking) in QS60Style is false.
- // For other styles which inherit from QWindowsStyle, the value is true.
+ // For styles which inherit from QWindowsStyle, styleHint(QStyle::SH_Menu_MouseTracking) is true.
menu.setMouseTracking(true);
QAction *action = menu.addAction("test");
#if defined(Q_WS_MAC) || defined(Q_OS_WINCE_WM)
QSKIP("On Mac/WinCE, native key events are needed to test menu action activation", SkipAll);
#endif
-#ifdef Q_OS_SYMBIAN
- QSKIP("On Symbian OS, native key events are needed to test menu action activation", SkipAll);
-#endif
// create a popup menu with menu items set the accelerators later...
initSimpleMenubar();
load(qttest_p4)
SOURCES += tst_qnetworkaccessmanager_and_qprogressdialog.cpp
QT += network widgets
-
-symbian: TARGET.CAPABILITY = NetworkServices
-
tst_QNetworkAccessManager_And_QProgressDialog::tst_QNetworkAccessManager_And_QProgressDialog()
{
- Q_SET_DEFAULT_IAP
}
void tst_QNetworkAccessManager_And_QProgressDialog::downloadCheck_data()
enum { OneMinute = 60 * 1000,
- TwoMinutes = OneMinute * 2,
- TenMinutes = OneMinute * 10,
- TwentyFiveMinutes = OneMinute * 25 };
+ TwoMinutes = OneMinute * 2 };
class tst_QObjectRace: public QObject
{
void tst_QObjectRace::moveToThreadRace()
{
-#if defined(Q_OS_SYMBIAN)
- // ### FIXME: task 257411 - remove xfail once this is fixed
- QEXPECT_FAIL("", "Symbian event dispatcher can't handle this kind of race, see task: 257411", Abort);
- QVERIFY(false);
-#endif
RaceObject *object = new RaceObject;
enum { ThreadCount = 6 };
}
};
-#if defined(Q_OS_SYMBIAN)
-// Symbian needs "a bit" more time
-# define EXTRA_THREAD_WAIT TenMinutes
-# define MAIN_THREAD_WAIT TwentyFiveMinutes
-#else
-# define EXTRA_THREAD_WAIT 3000
-# define MAIN_THREAD_WAIT TwoMinutes
-#endif
+#define EXTRA_THREAD_WAIT 3000
+#define MAIN_THREAD_WAIT TwoMinutes
void tst_QObjectRace::destroyRace()
{
-#if defined(Q_OS_SYMBIAN) && defined(Q_CC_NOKIAX86)
- // ### FIXME: task 257411 - remove xfail once this is fixed.
- // Oddly enough, this seems to work properly in HW, if given enough time and memory.
- QEXPECT_FAIL("", "Symbian event dispatcher can't handle this kind of race on emulator, see task: 257411", Abort);
- QVERIFY(false);
-#endif
-
enum { ThreadCount = 10, ObjectCountPerThread = 733,
ObjectCount = ThreadCount * ObjectCountPerThread };
QCOMPARE(0, obj1.tabStopWidth());
obj1.setTabStopWidth(INT_MIN);
QCOMPARE(0, obj1.tabStopWidth()); // Makes no sense to set a negative tabstop value
-#if defined(QT_ARCH_WINDOWSCE) || defined (QT_ARCH_SYMBIAN)
+#if defined(QT_ARCH_WINDOWSCE)
// due to rounding error in qRound when qreal==float
// we cannot use INT_MAX for this check
obj1.setTabStopWidth(SHRT_MAX*2);
load(qttest_p4)
SOURCES += tst_qs60mainapplication.cpp
-
-symbian:LIBS += -lapparc -leikcore -lcone -lavkon
QT += widgets widgets-private
SOURCES += tst_qsidebar.cpp
TARGET = tst_qsidebar
-
-symbian:HEADERS += ../../../include/qtgui/private/qfileinfogatherer_p.h
QSidebar qsidebar;
qsidebar.init(&fsmodel, emptyUrls);
QAbstractItemModel *model = qsidebar.model();
-#if defined(Q_OS_SYMBIAN)
- // On Symbian, QDir::rootPath() and QDir::home() are same.
- QDir testDir = QDir::currentPath();
-#else
QDir testDir = QDir::home();
-#endif
// default
QCOMPARE(model->rowCount(), 0);
+++ /dev/null
-load(qttest_p4)
-QT += widgets
-SOURCES += tst_qsoftkeymanager.cpp
-
-requires(symbian)
+++ /dev/null
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtTest/QtTest>
-
-#include "qevent.h"
-#include "qdialog.h"
-#include "qpushbutton.h"
-#include "qdialogbuttonbox.h"
-#include "private/qsoftkeymanager_p.h"
-
-#ifdef Q_OS_SYMBIAN
-#include "qsymbianevent.h"
-#endif
-
-#ifdef Q_WS_S60
-static const int s60CommandStart = 6000;
-#endif
-
-
-class tst_QSoftKeyManager : public QObject
-{
-Q_OBJECT
-
-public:
- tst_QSoftKeyManager();
- virtual ~tst_QSoftKeyManager();
-
-public slots:
- void initTestCase();
- void cleanupTestCase();
- void init();
- void cleanup();
-private slots:
- void updateSoftKeysCompressed();
- void handleCommand();
- void checkSoftkeyEnableStates();
- void noMergingOverWindowBoundary();
-
-private: // utils
- inline void simulateSymbianCommand(int command)
- {
- QSymbianEvent event1(QSymbianEvent::CommandEvent, command);
- qApp->symbianProcessEvent(&event1);
- };
-};
-
-class EventListener : public QObject
-{
-public:
- EventListener(QObject *listenTo)
- {
- resetCounts();
- if (listenTo)
- listenTo->installEventFilter(this);
- }
-
- void resetCounts()
- {
- numUpdateSoftKeys = 0;
- }
-
- int numUpdateSoftKeys;
-
-protected:
- bool eventFilter(QObject * /*object*/, QEvent *event)
- {
- if (event->type() == QEvent::UpdateSoftKeys)
- numUpdateSoftKeys++;
- return false;
- }
-};
-
-tst_QSoftKeyManager::tst_QSoftKeyManager() : QObject()
-{
-}
-
-tst_QSoftKeyManager::~tst_QSoftKeyManager()
-{
-}
-
-void tst_QSoftKeyManager::initTestCase()
-{
-}
-
-void tst_QSoftKeyManager::cleanupTestCase()
-{
-}
-
-void tst_QSoftKeyManager::init()
-{
-}
-
-void tst_QSoftKeyManager::cleanup()
-{
-}
-
-/*
- This tests that we only get one UpdateSoftKeys event even though
- multiple events that trigger soft keys occur.
-*/
-void tst_QSoftKeyManager::updateSoftKeysCompressed()
-{
- QWidget w;
- EventListener listener(qApp);
-
- QList<QAction *> softKeys;
- for (int i = 0; i < 10; ++i) {
- QAction *action = new QAction("foo", &w);
- action->setSoftKeyRole(QAction::PositiveSoftKey);
- softKeys << action;
- }
- w.addActions(softKeys);
-
- QApplication::processEvents();
-
- QVERIFY(listener.numUpdateSoftKeys == 1);
-}
-
-/*
- This tests that when the S60 environment sends us a command
- that it actually gets mapped to the correct action.
-*/
-void tst_QSoftKeyManager::handleCommand()
-{
- QDialog w;
- QDialogButtonBox *buttons = new QDialogButtonBox(
- QDialogButtonBox::Ok | QDialogButtonBox::Cancel,
- Qt::Horizontal,
- &w);
-
- w.show();
- QApplication::processEvents();
-
- QCOMPARE(w.actions().count(), 2);
-
- QSignalSpy spy0(w.actions()[0], SIGNAL(triggered()));
- QSignalSpy spy1(w.actions()[1], SIGNAL(triggered()));
-
- // These should work eventually, but do not yet
-// QTest::keyPress(&w, Qt::Key_Context1);
-// QTest::keyPress(&w, Qt::Key_Context2);
-
- simulateSymbianCommand(s60CommandStart); //0 = LSK position
- simulateSymbianCommand(s60CommandStart + 2); //2 = RSK position
-
- QApplication::processEvents();
-
- QCOMPARE(spy0.count(), 1);
- QCOMPARE(spy1.count(), 1);
-}
-
-/*
- This tests that the state of a widget that owns softkey action is respected when handling the softkey
- command.
-*/
-void tst_QSoftKeyManager::checkSoftkeyEnableStates()
-{
- QDialog w;
- QDialogButtonBox *buttons = new QDialogButtonBox(
- QDialogButtonBox::RestoreDefaults | QDialogButtonBox::Help,
- Qt::Horizontal,
- &w);
- QPushButton *pBDefaults = buttons->button(QDialogButtonBox::RestoreDefaults);
- QPushButton *pBHelp = buttons->button(QDialogButtonBox::Help);
- pBHelp->setEnabled(false);
- w.show();
- QApplication::processEvents();
-
- //According to StandardButton enum in QDialogButtonBox the Help action
- //is inserted before RestoreDefaults and thus help action is in index 0
- QSignalSpy spy0(w.actions()[0], SIGNAL(triggered())); //disabled help action
- QSignalSpy spy1(w.actions()[1], SIGNAL(triggered())); //restore defaults action
-
- //Verify that enabled button gets all the action trigger signals and
- //disabled button gets none.
- for (int i = 0; i < 10; i++) {
- //simulate "help" softkey press
- simulateSymbianCommand(s60CommandStart);
- //simulate "Restore Defaults" softkey press
- simulateSymbianCommand(s60CommandStart + 2);
- }
- QApplication::processEvents();
- //Restore defaults button is enabled and its signals are recorded to spy1
- QCOMPARE(spy0.count(), 0);
- QCOMPARE(spy1.count(), 10);
-
- spy0.clear();
- spy1.clear();
-
- for (int i = 0; i < 10; i++) {
- //simulate "help" softkey press
- simulateSymbianCommand(s60CommandStart);
- //simulate "Restore Defaults" softkey press
- simulateSymbianCommand(s60CommandStart + 2);
- //switch enabled button to disabled and vice versa
- pBHelp->setEnabled(!pBHelp->isEnabled());
- pBDefaults->setEnabled(!pBDefaults->isEnabled());
- }
- QApplication::processEvents();
- QCOMPARE(spy0.count(), 5);
- QCOMPARE(spy1.count(), 5);
-}
-
-/*
- This tests that the softkeys are not merged over window boundaries. I.e. dialogs
- don't get softkeys of base widget by default - QTBUG-6163.
-*/
-void tst_QSoftKeyManager::noMergingOverWindowBoundary()
-{
- // Create base window against which the dialog softkeys will ve verified
- QWidget base;
-
- QAction* baseLeft = new QAction(tr("BaseLeft"), &base);
- baseLeft->setSoftKeyRole(QAction::PositiveSoftKey);
- base.addAction(baseLeft);
-
- QAction* baseRight = new QAction(tr("BaseRight"), &base);
- baseRight->setSoftKeyRole(QAction::NegativeSoftKey);
- base.addAction(baseRight);
-
- base.showMaximized();
- QApplication::processEvents();
-
- QSignalSpy baseLeftSpy(baseLeft, SIGNAL(triggered()));
- QSignalSpy baseRightSpy(baseRight, SIGNAL(triggered()));
-
- //Verify that both base softkeys emit triggered signals
- simulateSymbianCommand(s60CommandStart);
- simulateSymbianCommand(s60CommandStart + 2);
-
- QCOMPARE(baseLeftSpy.count(), 1);
- QCOMPARE(baseRightSpy.count(), 1);
- baseLeftSpy.clear();
- baseRightSpy.clear();
-
- // Verify that no softkey merging when using dialog without parent
- QDialog dlg;
- dlg.show();
-
- QApplication::processEvents();
-
- simulateSymbianCommand(s60CommandStart);
- simulateSymbianCommand(s60CommandStart + 2);
-
- QCOMPARE(baseLeftSpy.count(), 0);
- QCOMPARE(baseRightSpy.count(), 0);
-
- // Ensure base view has focus again
- dlg.hide();
- base.showMaximized();
-
- // Verify that no softkey merging when using dialog with parent
- QDialog dlg2(&base);
- dlg2.show();
-
- QApplication::processEvents();
-
- simulateSymbianCommand(s60CommandStart);
- simulateSymbianCommand(s60CommandStart + 2);
-
- QCOMPARE(baseLeftSpy.count(), 0);
- QCOMPARE(baseRightSpy.count(), 0);
-}
-
-QTEST_MAIN(tst_QSoftKeyManager)
-#include "tst_qsoftkeymanager.moc"
load(qttest_p4)
SOURCES += tst_qsound.cpp
-wince*|symbian: {
- deploy.files += 4.wav
- DEPLOYMENT += deploy
- !symbian:DEFINES += SRCDIR=\\\"\\\"
+wince* {
+ deploy.files += 4.wav
+ DEPLOYMENT += deploy
+ DEFINES += SRCDIR=\\\"\\\"
} else {
DEFINES += SRCDIR=\\\"$$PWD/\\\"
}
-
#include <QtTest/QtTest>
#include <QtGui>
-#if defined(Q_OS_SYMBIAN)
-#define SRCDIR ""
-#endif
-
class tst_QSound : public QObject
{
Q_OBJECT
QT += widgets
SOURCES += tst_qsplitter.cpp
-wince*|symbian: {
+wince* {
addFiles.files = extradata.txt setSizes3.dat
addFiles.path = .
DEPLOYMENT += addFiles
- !symbian:DEFINES += SRCDIR=\\\"./\\\"
+ DEFINES += SRCDIR=\\\"./\\\"
} else {
DEFINES += SRCDIR=\\\"$$PWD/\\\"
}
#include <qdebug.h> // for file error messages
#include "../../shared/util.h"
-#if defined(Q_OS_SYMBIAN)
-# define SRCDIR ""
-#endif
-
//TESTED_CLASS=
//TESTED_FILES=
wince* {
DEFINES += SRCDIR=\\\"./\\\"
-} else:symbian {
- TARGET.EPOCHEAPSIZE="0x100 0x1000000"
- TARGET.CAPABILITY=NetworkServices ReadUserData
- INCLUDEPATH *= $$MW_LAYER_SYSTEMINCLUDE # Needed for e32svr.h in S^3 envs
} else {
DEFINES += SRCDIR=\\\"$$PWD/\\\"
}
#include "../network-settings.h"
-#ifdef Q_OS_SYMBIAN
-#define SRCDIR ""
-#endif
-
#ifndef QT_NO_OPENSSL
class QSslSocketPtr: public QSharedPointer<QSslSocket>
{
tst_QSslSocket_onDemandCertificates_member::tst_QSslSocket_onDemandCertificates_member()
{
- Q_SET_DEFAULT_IAP
}
tst_QSslSocket_onDemandCertificates_member::~tst_QSslSocket_onDemandCertificates_member()
wince* {
DEFINES += SRCDIR=\\\"./\\\"
-} else:symbian {
- TARGET.EPOCHEAPSIZE="0x100 0x1000000"
- TARGET.CAPABILITY=NetworkServices ReadUserData
- INCLUDEPATH *= $$MW_LAYER_SYSTEMINCLUDE # Needed for e32svr.h in S^3 envs
} else {
DEFINES += SRCDIR=\\\"$$PWD/\\\"
}
#include "../network-settings.h"
-#ifdef Q_OS_SYMBIAN
-#define SRCDIR ""
-#endif
-
#ifndef QT_NO_OPENSSL
class QSslSocketPtr: public QSharedPointer<QSslSocket>
{
tst_QSslSocket_onDemandCertificates_static::tst_QSslSocket_onDemandCertificates_static()
{
- Q_SET_DEFAULT_IAP
}
tst_QSslSocket_onDemandCertificates_static::~tst_QSslSocket_onDemandCertificates_static()
QT += widgets
SOURCES += tst_qstyle.cpp
-wince*|symbian: {
- !symbian:DEFINES += SRCDIR=\\\".\\\"
+wince* {
+ DEFINES += SRCDIR=\\\".\\\"
addPixmap.files = task_25863.png
addPixmap.path = .
DEPLOYMENT += addPixmap
#include <qlineedit.h>
#include <qmdiarea.h>
-#if defined(Q_OS_SYMBIAN)
-#define SRCDIR "."
-#endif
-
#include <QCleanlooksStyle>
#ifdef Q_WS_MAC
QPixmap p(QString(SRCDIR) + "/task_25863.png", "PNG");
QPixmap actualPix = QPixmap::grabWidget(testWidget);
-#ifdef Q_OS_SYMBIAN
- // QPixmap cannot be assumed to be exactly same, unless it is created from exactly same content.
- // In Symbian, pixmap format might get "optimized" depending on how QPixmap is created.
- // Therefore, force the content to specific format and compare QImages.
- // Then re-create the QPixmaps and compare those.
- QImage i1 = p.toImage().convertToFormat(QImage::Format_ARGB32_Premultiplied);
- p = QPixmap::fromImage(i1);
- QImage i2 = actualPix.toImage().convertToFormat(QImage::Format_ARGB32_Premultiplied);
- actualPix = QPixmap::fromImage(i2);
- QVERIFY(i1 == i2);
-#endif
QVERIFY(pixmapsAreEqual(&actualPix,&p));
testWidget->hide();
}
load(qttest_p4)
QT += widgets
SOURCES += tst_qtablewidget.cpp
-
-# This prevents the GCCE compile failure: "elf2e32: Error 1063: Fatal Error in
-# PostLinker." The paged statement is documented in the S60 docs.
-symbian {
- MMP_RULES -= PAGED
-
- custom_paged_rule = "$${LITERAL_HASH}ifndef GCCE"\
- "PAGED" \
- "$${LITERAL_HASH}endif"
- MMP_RULES += custom_paged_rule
-}
-
-symbian:MMP_RULES += "OPTION GCCE -mlong-calls"
-
load(qttest_p4)
SOURCES += tst_qtextbrowser.cpp
-!symbian:DEFINES += SRCDIR=\\\"$$PWD\\\"
+DEFINES += SRCDIR=\\\"$$PWD\\\"
QT += widgets
-wince*|symbian: {
+wince* {
addFiles.files = *.html
addFiles.path = .
addDir.files = subdir/*
DEPLOYMENT += addFiles addDir
}
-
CONFIG+=insignificant_test
//TESTED_CLASS=
//TESTED_FILES=
-#if defined(Q_OS_SYMBIAN)
-# define SRCDIR ""
-#endif
-
class TestBrowser : public QTextBrowser
{
public:
HEADERS +=
SOURCES += tst_qtextedit.cpp
-wince*|symbian: {
+wince* {
addImages.files = fullWidthSelection/*
addImages.path = fullWidthSelection
DEPLOYMENT += addImages
-}
-
-wince* {
DEFINES += SRCDIR=\\\"./\\\"
-} else:!symbian {
+} else {
DEFINES += SRCDIR=\\\"$$PWD/\\\"
}
#include <Carbon/Carbon.h>
#endif
-#if defined(Q_OS_SYMBIAN)
-# define SRCDIR ""
-#endif
-
-
bool nativeClipboardWorking()
{
#ifdef Q_WS_MAC
LIBS += $$QMAKE_LIBS_X11
}
-symbian {
- INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE
- LIBS += -leikcore -lcone -leikcoctl
-}
-
-!wince*:!symbian:win32: LIBS += -luser32 -lgdi32
+!wince*:win32: LIBS += -luser32 -lgdi32
CONFIG+=insignificant_test
#include <akncontext.h> // CAknContextPane
#endif
-#ifdef Q_OS_SYMBIAN
-#include <eikspane.h> // CEikStatusPane
-#include <eikbtgpc.h> // CEikButtonGroupContainer
-#include <eikenv.h> // CEikonEnv
-#include <eikaufty.h> // MEikAppUiFactory
-#include <eikmenub.h> // CEikMenuBar
-#endif
-
#ifdef Q_WS_QWS
# include <qscreen_qws.h>
#endif
void ensureCreated();
void winIdChangeEvent();
-#ifdef Q_OS_SYMBIAN
- void reparentCausesChildWinIdChange();
-#else
void persistentWinId();
-#endif
void showNativeChild();
void qobject_castInDestroyedSlot();
void setGraphicsEffect();
void destroyBackingStore();
- void destroyBackingStoreWhenHidden();
void activateWindow();
void openModal_taskQTBUG_5804();
-#ifdef Q_OS_SYMBIAN
- void cbaVisibility();
- void fullScreenWindowModeTransitions();
- void maximizedWindowModeTransitions();
- void minimizedWindowModeTransitions();
- void normalWindowModeTransitions();
- void focusSwitchClosesPopupMenu();
-#endif
-
void focusProxyAndInputMethods();
void scrollWithoutBackingStore();
subWindow2->setGeometry(75, 75, 100, 100);
subSubWindow->setGeometry(10, 10, 10, 10);
-#if !defined (Q_OS_WINCE) && !defined(Q_OS_SYMBIAN) //still no proper minimizing
+#if !defined (Q_OS_WINCE) //still no proper minimizing
//update visibility
if (windowMinimized) {
if (!windowHidden) {
#if defined(Q_OS_WINCE)
QEXPECT_FAIL("", "Windows CE does only support rectangular regions", Continue); //See also task 147191
#endif
-#if defined(Q_OS_SYMBIAN)
- QEXPECT_FAIL("", "Symbian/S60 does only support rectangular regions", Continue); //See also task 147191
-#endif
#if defined(Q_WS_QPA)
QEXPECT_FAIL("", "Window mask not implemented on Lighthouse", Continue);
#endif
#if defined(Q_OS_WINCE)
QEXPECT_FAIL("", "Windows CE does only support rectangular regions", Continue); //See also task 147191
#endif
-#if defined(Q_OS_SYMBIAN)
- QEXPECT_FAIL("", "Symbian/S60 does only support rectangular regions", Continue); //See also task 147191
-#endif
#if defined(Q_WS_QPA)
QEXPECT_FAIL("", "Window mask not implemented on Lighthouse", Continue);
#endif
{
// Changing grandparent of a native widget
- // Should cause winId of grandchild to change only on Symbian
QWidget grandparent1, grandparent2;
QWidget parent(&grandparent1);
WinIdChangeWidget child(&parent);
QCOMPARE(child.winIdChangeEventCount(), 1);
parent.setParent(&grandparent2);
const WId winIdAfter = child.internalWinId();
-#ifdef Q_OS_SYMBIAN
- QVERIFY(winIdBefore != winIdAfter);
- QVERIFY(winIdAfter != 0);
- QCOMPARE(child.winIdChangeEventCount(), 2);
-#else
QCOMPARE(winIdBefore, winIdAfter);
QCOMPARE(child.winIdChangeEventCount(), 1);
-#endif
}
{
}
}
-#ifdef Q_OS_SYMBIAN
-void tst_QWidget::reparentCausesChildWinIdChange()
-{
- QWidget *parent = new QWidget;
- QWidget *w1 = new QWidget;
- QWidget *w2 = new QWidget;
- QWidget *w3 = new QWidget;
- w1->setParent(parent);
- w2->setParent(w1);
- w3->setParent(w2);
-
- WId winId1 = w1->winId();
- WId winId2 = w2->winId();
- WId winId3 = w3->winId();
-
- // reparenting causes winIds of the widget being reparented, and all of its children, to change
- w1->setParent(0);
- QVERIFY(w1->winId() != winId1);
- winId1 = w1->winId();
- QVERIFY(w2->winId() != winId2);
- winId2 = w2->winId();
- QVERIFY(w3->winId() != winId3);
- winId3 = w3->winId();
-
- w1->setParent(parent);
- QVERIFY(w1->winId() != winId1);
- winId1 = w1->winId();
- QVERIFY(w2->winId() != winId2);
- winId2 = w2->winId();
- QVERIFY(w3->winId() != winId3);
- winId3 = w3->winId();
-
- w2->setParent(0);
- QVERIFY(w2->winId() != winId2);
- winId2 = w2->winId();
- QVERIFY(w3->winId() != winId3);
- winId3 = w3->winId();
-
- w2->setParent(parent);
- QVERIFY(w2->winId() != winId2);
- winId2 = w2->winId();
- QVERIFY(w3->winId() != winId3);
- winId3 = w3->winId();
-
- w2->setParent(w1);
- QVERIFY(w2->winId() != winId2);
- winId2 = w2->winId();
- QVERIFY(w3->winId() != winId3);
- winId3 = w3->winId();
-
- w3->setParent(0);
- QVERIFY(w3->winId() != winId3);
- winId3 = w3->winId();
-
- w3->setParent(w1);
- QVERIFY(w3->winId() != winId3);
- winId3 = w3->winId();
-
- w3->setParent(w2);
- QVERIFY(w3->winId() != winId3);
- winId3 = w3->winId();
-
- delete parent;
-}
-#else
void tst_QWidget::persistentWinId()
{
QWidget *parent = new QWidget;
delete parent;
}
-#endif // Q_OS_SYMBIAN
void tst_QWidget::showNativeChild()
{
custom->logicalDpiX();
QCOMPARE(custom->metricCallCount, 1);
child->logicalDpiX();
-#ifdef Q_WS_S60
- // QWidget::metric is not recursive on Symbian
- QCOMPARE(custom->metricCallCount, 1);
-#else
QCOMPARE(custom->metricCallCount, 2);
-#endif
delete topLevel;
}
return backingStore;
}
-// Wait for a condition to be true, timing out after 1 second
-// This is used following calls to QWidget::show() and QWidget::hide(), which are
-// expected to asynchronously trigger native window visibility events.
-#define WAIT_AND_VERIFY(condition) \
- do { \
- QTime start = QTime::currentTime(); \
- while (!(condition) && (start.elapsed() < 1000)) { \
- qApp->processEvents(); \
- QTest::qWait(50); \
- } \
- if (!QTest::qVerify((condition), #condition, "", __FILE__, __LINE__)) \
- return; \
- } while (0)
-
-void tst_QWidget::destroyBackingStoreWhenHidden()
-{
-#ifndef QT_BUILD_INTERNAL
- QSKIP("Test step requires access to Q_AUTOTEST_EXPORT", SkipAll);
-#endif
-
-#ifndef Q_OS_SYMBIAN
- QSKIP("Only Symbian destroys backing store when native window becomes invisible", SkipAll);
-#endif
-
- testWidget->hide();
- QTest::qWait(1000);
-
- // 1. Single top-level QWidget
- {
- QWidget w;
- w.setAutoFillBackground(true);
- w.setPalette(Qt::yellow);
- w.setGeometry(0, 0, 100, 100);
- w.show();
- QTest::qWaitForWindowShown(&w);
- QVERIFY(0 != backingStore(w));
-
- w.hide();
- WAIT_AND_VERIFY(0 == backingStore(w));
-
- w.show();
- QTest::qWaitForWindowShown(&w);
- QVERIFY(0 != backingStore(w));
- }
-
- // 2. Two top-level widgets
- {
- QWidget w1;
- w1.setGeometry(0, 0, 100, 100);
- w1.setAutoFillBackground(true);
- w1.setPalette(Qt::red);
- w1.show();
- QTest::qWaitForWindowShown(&w1);
- QVERIFY(0 != backingStore(w1));
-
- QWidget w2;
- w2.setGeometry(w1.geometry());
- w1.setAutoFillBackground(true);
- w1.setPalette(Qt::blue);
- w2.show();
- QTest::qWaitForWindowShown(&w2);
- QVERIFY(0 != backingStore(w2));
-
- // Check that w1 deleted its backing store when obscured by w2
- QVERIFY(0 == backingStore(w1));
-
- w2.move(w2.pos() + QPoint(10, 10));
-
- // Check that w1 recreates its backing store when partially revealed
- WAIT_AND_VERIFY(0 != backingStore(w1));
- }
-
- // 3. Native child widget
- {
- QWidget parent;
- parent.setGeometry(0, 0, 100, 100);
- parent.setAutoFillBackground(true);
- parent.setPalette(Qt::yellow);
-
- QWidget child(&parent);
- child.setAutoFillBackground(true);
- child.setPalette(Qt::green);
-
- QVBoxLayout layout(&parent);
- layout.setContentsMargins(10, 10, 10, 10);
- layout.addWidget(&child);
- parent.setLayout(&layout);
-
- child.winId();
-
- parent.show();
- QTest::qWaitForWindowShown(&parent);
-
- // Check that child window does not obscure parent window
- QVERIFY(!parent.visibleRegion().subtracted(child.visibleRegion()).isEmpty());
-
- // Native child widget should share parent's backing store
- QWidgetBackingStore *const parentBs = backingStore(parent);
- QVERIFY(0 != parentBs);
- QVERIFY(0 == backingStore(child));
-
- // Set margins to zero so that child widget totally obscures parent
- layout.setContentsMargins(0, 0, 0, 0);
-
- WAIT_AND_VERIFY(parent.visibleRegion().subtracted(child.visibleRegion()).isEmpty());
-
- // Backing store should remain unchanged despite child window obscuring
- // parent window
- QVERIFY(parentBs == backingStore(parent));
- QVERIFY(0 == backingStore(child));
- }
-
- // 4. Alien child widget which is made full-screen
- {
- QWidget parent;
- parent.setGeometry(0, 0, 100, 100);
- parent.setAutoFillBackground(true);
- parent.setPalette(Qt::red);
-
- QWidget child(&parent);
- child.setAutoFillBackground(true);
- child.setPalette(Qt::blue);
-
- QVBoxLayout layout(&parent);
- layout.setContentsMargins(10, 10, 10, 10);
- layout.addWidget(&child);
- parent.setLayout(&layout);
-
- parent.show();
- QTest::qWaitForWindowShown(&parent);
-
- // Check that child window does not obscure parent window
- QVERIFY(!parent.visibleRegion().subtracted(child.visibleRegion()).isEmpty());
-
- // Native child widget should share parent's backing store
- QVERIFY(0 != backingStore(parent));
- QVERIFY(0 == backingStore(child));
-
- // Make child widget full screen
- child.setWindowFlags((child.windowFlags() | Qt::Window) ^ Qt::SubWindow);
- child.setWindowState(child.windowState() | Qt::WindowFullScreen);
- child.show();
- QTest::qWaitForWindowShown(&child);
-
- // Check that child window obscures parent window
- QVERIFY(parent.visibleRegion().subtracted(child.visibleRegion()).isEmpty());
-
- // Now that extent of child widget goes beyond parent's extent,
- // a new backing store should be created for the child widget.
- QVERIFY(0 != backingStore(child));
-
- // Parent is obscured, therefore its backing store should be destroyed
- QVERIFY(0 == backingStore(parent));
-
- // Disable full screen
- child.setWindowFlags(child.windowFlags() ^ (Qt::Window | Qt::SubWindow));
- child.setWindowState(child.windowState() ^ Qt::WindowFullScreen);
- child.show();
- QTest::qWaitForWindowShown(&child);
-
- // Check that parent is now visible again
- QVERIFY(!parent.visibleRegion().subtracted(child.visibleRegion()).isEmpty());
-
- // Native child widget should once again share parent's backing store
- QVERIFY(0 != backingStore(parent));
- QVERIFY(0 == backingStore(child));
- }
-
- // 5. Native child widget which is made full-screen
- {
- QWidget parent;
- parent.setGeometry(0, 0, 100, 100);
- parent.setAutoFillBackground(true);
- parent.setPalette(Qt::red);
-
- QWidget child(&parent);
- child.setAutoFillBackground(true);
- child.setPalette(Qt::blue);
-
- QWidget grandChild(&child);
- grandChild.setAutoFillBackground(true);
- grandChild.setPalette(Qt::yellow);
-
- QVBoxLayout layout(&parent);
- layout.setContentsMargins(10, 10, 10, 10);
- layout.addWidget(&child);
- parent.setLayout(&layout);
-
- QVBoxLayout childLayout(&child);
- childLayout.setContentsMargins(10, 10, 10, 10);
- childLayout.addWidget(&grandChild);
- child.setLayout(&childLayout);
-
- // Ensure that this widget and all its ancestors are native
- grandChild.winId();
-
- parent.show();
-
- QTest::qWaitForWindowShown(&parent);
-
- // Check that child window does not obscure parent window
- QVERIFY(!parent.visibleRegion().subtracted(child.visibleRegion()).isEmpty());
-
- // Native child widget should share parent's backing store
- QVERIFY(0 != backingStore(parent));
- QVERIFY(0 == backingStore(child));
- QVERIFY(0 == backingStore(grandChild));
-
- // Make child widget full screen
- child.setWindowFlags((child.windowFlags() | Qt::Window) ^ Qt::SubWindow);
- child.setWindowState(child.windowState() | Qt::WindowFullScreen);
- child.show();
-
- // Paint into the child to ensure that it gets a backing store
- QPainter painter(&child);
- painter.fillRect(QRect(0, 0, 90, 90), Qt::white);
-
- QTest::qWaitForWindowShown(&child);
-
- // Ensure that 'window hidden' event is received by parent
- qApp->processEvents();
-
- // Check that child window obscures parent window
- QVERIFY(parent.visibleRegion().subtracted(child.visibleRegion() + grandChild.visibleRegion()).isEmpty());
-
- // Now that extent of child widget goes beyond parent's extent,
- // a new backing store should be created for the child widget.
- QVERIFY(0 != backingStore(child));
-
- // Parent is obscured, therefore its backing store should be destroyed
- QVERIFY(0 == backingStore(parent));
-
- // Disable full screen
- child.setWindowFlags(child.windowFlags() ^ (Qt::Window | Qt::SubWindow));
- child.setWindowState(child.windowState() ^ Qt::WindowFullScreen);
- child.show();
- QTest::qWaitForWindowShown(&child);
-
- // Check that parent is now visible again
- QVERIFY(!parent.visibleRegion().subtracted(child.visibleRegion() + grandChild.visibleRegion()).isEmpty());
-
- // Native child widget should once again share parent's backing store
- QVERIFY(0 != backingStore(parent));
- QVERIFY(0 == backingStore(child));
- QVERIFY(0 == backingStore(grandChild));
- }
-
- // 6. Partial reveal followed by full reveal
- {
- QWidget upper;
- upper.setAutoFillBackground(true);
- upper.setPalette(Qt::red);
- upper.setGeometry(50, 50, 100, 100);
-
- QWidget lower;
- lower.setAutoFillBackground(true);
- lower.setPalette(Qt::green);
- lower.setGeometry(50, 50, 100, 100);
-
- lower.show();
- QTest::qWaitForWindowShown(&lower);
- upper.show();
- QTest::qWaitForWindowShown(&upper);
- upper.raise();
-
- QVERIFY(0 != backingStore(upper));
- QVERIFY(0 == backingStore(lower));
-
- // Check that upper obscures lower
- QVERIFY(lower.visibleRegion().subtracted(upper.visibleRegion()).isEmpty());
-
- // Partially reveal lower
- upper.move(100, 100);
-
- // Completely reveal lower
- upper.hide();
-
- // Hide lower widget - this should cause its backing store to be deleted
- lower.hide();
-
- // Check that backing store was deleted
- WAIT_AND_VERIFY(0 == backingStore(lower));
- }
-
- // 7. Reparenting of visible native child widget
- {
- QWidget parent1;
- parent1.setAutoFillBackground(true);
- parent1.setPalette(Qt::green);
- parent1.setGeometry(50, 50, 100, 100);
-
- QWidget *child = new QWidget(&parent1);
- child->winId();
- child->setAutoFillBackground(true);
- child->setPalette(Qt::red);
- child->setGeometry(10, 10, 30, 30);
-
- QWidget parent2;
- parent2.setAutoFillBackground(true);
- parent2.setPalette(Qt::blue);
- parent2.setGeometry(150, 150, 100, 100);
-
- parent1.show();
- QTest::qWaitForWindowShown(&parent1);
- QVERIFY(0 != backingStore(parent1));
-
- parent2.show();
- QTest::qWaitForWindowShown(&parent2);
- QVERIFY(0 != backingStore(parent2));
-
- child->setParent(&parent2);
- child->setGeometry(10, 10, 30, 30);
- child->show();
-
- parent1.hide();
- WAIT_AND_VERIFY(0 == backingStore(parent1));
-
- parent2.hide();
- WAIT_AND_VERIFY(0 == backingStore(parent2));
- }
-}
-
-#undef WAIT_AND_VERIFY
-
void tst_QWidget::rectOutsideCoordinatesLimit_task144779()
{
#ifdef Q_OS_WINCE_WM
delete win;
}
-#ifdef Q_OS_SYMBIAN
-void tst_QWidget::cbaVisibility()
-{
- // Test case for task 261048
-
- // Create first mainwindow in fullsreen and activate it
- QMainWindow* mainwindow = new QMainWindow();
- QLabel* label = new QLabel(mainwindow);
- mainwindow->setCentralWidget(label);
- mainwindow->setWindowState(Qt::WindowFullScreen);
- mainwindow->setVisible(true);
- mainwindow->activateWindow();
- qApp->processEvents();
-
- QVERIFY(mainwindow->isActiveWindow());
- QVERIFY(QDesktopWidget().availableGeometry().size() == mainwindow->size());
-
- // Create second mainwindow in maximized and activate it
- QMainWindow* mainwindow2 = new QMainWindow();
- QLabel* label2 = new QLabel(mainwindow2);
- mainwindow2->setCentralWidget(label2);
- mainwindow2->setWindowState(Qt::WindowMaximized);
- mainwindow2->setVisible(true);
- mainwindow2->activateWindow();
- qApp->processEvents();
-
- QVERIFY(!mainwindow->isActiveWindow());
- QVERIFY(mainwindow2->isActiveWindow());
- QVERIFY(QDesktopWidget().availableGeometry().size() == mainwindow2->size());
-
- // Verify window decorations i.e. status pane and CBA are visible.
- CEikStatusPane* statusPane = CEikonEnv::Static()->AppUiFactory()->StatusPane();
- QVERIFY(statusPane->IsVisible());
- CEikButtonGroupContainer* buttonGroup = CEikButtonGroupContainer::Current();
- QVERIFY(buttonGroup->IsVisible());
-}
-
-void tst_QWidget::fullScreenWindowModeTransitions()
-{
- QWidget widget;
- QVBoxLayout *layout = new QVBoxLayout;
- QPushButton *button = new QPushButton("test Button");
- layout->addWidget(button);
- widget.setLayout(layout);
- widget.show();
-
- const QRect normalGeometry = widget.normalGeometry();
- const QRect fullScreenGeometry = qApp->desktop()->screenGeometry(&widget);
- const QRect maximumScreenGeometry = qApp->desktop()->availableGeometry(&widget);
- CEikStatusPane *statusPane = CEikonEnv::Static()->AppUiFactory()->StatusPane();
- CEikButtonGroupContainer *buttonGroup = CEikButtonGroupContainer::Current();
-
- //Enter
- widget.showNormal();
- widget.showFullScreen();
- QCOMPARE(widget.geometry(), fullScreenGeometry);
- QVERIFY(!buttonGroup->IsVisible());
- QVERIFY(!statusPane->IsVisible());
-
- widget.showMaximized();
- widget.showFullScreen();
- QCOMPARE(widget.geometry(), fullScreenGeometry);
- QVERIFY(!buttonGroup->IsVisible());
- QVERIFY(!statusPane->IsVisible());
-
- widget.showMinimized();
- widget.showFullScreen();
- QCOMPARE(widget.geometry(), fullScreenGeometry);
- QVERIFY(!buttonGroup->IsVisible());
- QVERIFY(!statusPane->IsVisible());
-
- //Exit
- widget.showFullScreen();
- widget.showNormal();
- QCOMPARE(widget.geometry(), normalGeometry);
- QVERIFY(buttonGroup->IsVisible());
- QVERIFY(statusPane->IsVisible());
-
- widget.showFullScreen();
- widget.showMaximized();
- QCOMPARE(widget.geometry(), maximumScreenGeometry);
- QVERIFY(buttonGroup->IsVisible());
- QVERIFY(statusPane->IsVisible());
-
- widget.showFullScreen();
- widget.showMinimized();
- QCOMPARE(widget.geometry(), fullScreenGeometry);
- QVERIFY(!buttonGroup->IsVisible());
- QVERIFY(!statusPane->IsVisible());
-}
-
-void tst_QWidget::maximizedWindowModeTransitions()
-{
- QWidget widget;
- QVBoxLayout *layout = new QVBoxLayout;
- QPushButton *button = new QPushButton("test Button");
- layout->addWidget(button);
- widget.setLayout(layout);
- widget.show();
-
- const QRect normalGeometry = widget.normalGeometry();
- const QRect fullScreenGeometry = qApp->desktop()->screenGeometry(&widget);
- const QRect maximumScreenGeometry = qApp->desktop()->availableGeometry(&widget);
- CEikStatusPane *statusPane = CEikonEnv::Static()->AppUiFactory()->StatusPane();
- CEikButtonGroupContainer *buttonGroup = CEikButtonGroupContainer::Current();
-
- //Enter
- widget.showNormal();
- widget.showMaximized();
- QCOMPARE(widget.geometry(), maximumScreenGeometry);
- QVERIFY(buttonGroup->IsVisible());
- QVERIFY(statusPane->IsVisible());
-
- widget.showFullScreen();
- widget.showMaximized();
- QCOMPARE(widget.geometry(), maximumScreenGeometry);
- QVERIFY(buttonGroup->IsVisible());
- QVERIFY(statusPane->IsVisible());
-
- widget.showMinimized();
- widget.showMaximized();
- QCOMPARE(widget.geometry(), maximumScreenGeometry);
- QVERIFY(buttonGroup->IsVisible());
- QVERIFY(statusPane->IsVisible());
-
- //Exit
- widget.showMaximized();
- widget.showNormal();
- QCOMPARE(widget.geometry(), normalGeometry);
- QVERIFY(buttonGroup->IsVisible());
- QVERIFY(statusPane->IsVisible());
-
- widget.showMaximized();
- widget.showFullScreen();
- QCOMPARE(widget.geometry(), fullScreenGeometry);
- QVERIFY(!buttonGroup->IsVisible());
- QVERIFY(!statusPane->IsVisible());
-
- widget.showMaximized();
- widget.showMinimized();
- // Since showMinimized hides window decoration availableGeometry gives different value
- // than with decoration visible. Altual size does not really matter since widget is invisible.
- QCOMPARE(widget.geometry(), qApp->desktop()->availableGeometry(&widget));
- QVERIFY(!buttonGroup->IsVisible());
- QVERIFY(!statusPane->IsVisible());
-}
-
-void tst_QWidget::minimizedWindowModeTransitions()
-{
- QWidget widget;
- QVBoxLayout *layout = new QVBoxLayout;
- QPushButton *button = new QPushButton("test Button");
- layout->addWidget(button);
- widget.setLayout(layout);
- widget.show();
-
- const QRect normalGeometry = widget.normalGeometry();
- const QRect fullScreenGeometry = qApp->desktop()->screenGeometry(&widget);
- const QRect maximumScreenGeometry = qApp->desktop()->availableGeometry(&widget);
- CEikStatusPane *statusPane = CEikonEnv::Static()->AppUiFactory()->StatusPane();
- CEikButtonGroupContainer *buttonGroup = CEikButtonGroupContainer::Current();
-
- //Enter
- widget.showNormal();
- widget.showMinimized();
- QCOMPARE(widget.geometry(), normalGeometry);
- QVERIFY(!buttonGroup->IsVisible());
- QVERIFY(!statusPane->IsVisible());
-
- widget.showFullScreen();
- widget.showMinimized();
- QCOMPARE(widget.geometry(), fullScreenGeometry);
- QVERIFY(!buttonGroup->IsVisible());
- QVERIFY(!statusPane->IsVisible());
-
- widget.showMaximized();
- widget.showMinimized();
- // Since showMinimized hides window decoration availableGeometry gives different value
- // than with decoration visible. Altual size does not really matter since widget is invisible.
- QCOMPARE(widget.geometry(), qApp->desktop()->availableGeometry(&widget));
- QVERIFY(!buttonGroup->IsVisible());
- QVERIFY(!statusPane->IsVisible());
-
- //Exit
- widget.showMinimized();
- widget.showNormal();
- QCOMPARE(widget.geometry(), normalGeometry);
- QVERIFY(buttonGroup->IsVisible());
- QVERIFY(statusPane->IsVisible());
-
- widget.showMinimized();
- widget.showFullScreen();
- QCOMPARE(widget.geometry(), fullScreenGeometry);
- QVERIFY(!buttonGroup->IsVisible());
- QVERIFY(!statusPane->IsVisible());
-
- widget.showMinimized();
- widget.showMaximized();
- QCOMPARE(widget.geometry(), maximumScreenGeometry);
- QVERIFY(buttonGroup->IsVisible());
- QVERIFY(statusPane->IsVisible());
-}
-
-void tst_QWidget::normalWindowModeTransitions()
-{
- QWidget widget;
- QVBoxLayout *layout = new QVBoxLayout;
- QPushButton *button = new QPushButton("test Button");
- layout->addWidget(button);
- widget.setLayout(layout);
- widget.show();
-
- const QRect normalGeometry = widget.normalGeometry();
- const QRect fullScreenGeometry = qApp->desktop()->screenGeometry(&widget);
- const QRect maximumScreenGeometry = qApp->desktop()->availableGeometry(&widget);
- CEikStatusPane *statusPane = CEikonEnv::Static()->AppUiFactory()->StatusPane();
- CEikButtonGroupContainer *buttonGroup = CEikButtonGroupContainer::Current();
-
- //Enter
- widget.showMaximized();
- widget.showNormal();
- QCOMPARE(widget.geometry(), normalGeometry);
- QVERIFY(buttonGroup->IsVisible());
- QVERIFY(statusPane->IsVisible());
-
- widget.showFullScreen();
- widget.showNormal();
- QCOMPARE(widget.geometry(), normalGeometry);
- QVERIFY(buttonGroup->IsVisible());
- QVERIFY(statusPane->IsVisible());
-
- widget.showMinimized();
- widget.showNormal();
- QCOMPARE(widget.geometry(), normalGeometry);
- QVERIFY(buttonGroup->IsVisible());
- QVERIFY(statusPane->IsVisible());
-
- //Exit
- widget.showNormal();
- widget.showMaximized();
- QCOMPARE(widget.geometry(), maximumScreenGeometry);
- QVERIFY(buttonGroup->IsVisible());
- QVERIFY(statusPane->IsVisible());
-
- widget.showNormal();
- widget.showFullScreen();
- QCOMPARE(widget.geometry(), fullScreenGeometry);
- QVERIFY(!buttonGroup->IsVisible());
- QVERIFY(!statusPane->IsVisible());
-
- widget.showNormal();
- widget.showMinimized();
- QCOMPARE(widget.geometry(), normalGeometry);
- QVERIFY(!buttonGroup->IsVisible());
- QVERIFY(!statusPane->IsVisible());
-}
-
-void tst_QWidget::focusSwitchClosesPopupMenu()
-{
- QMainWindow mainWindow;
- QAction action("Test action", &mainWindow);
- mainWindow.menuBar()->addAction(&action);
-
- mainWindow.show();
- QT_TRAP_THROWING(CEikonEnv::Static()->AppUiFactory()->MenuBar()->TryDisplayMenuBarL());
- QVERIFY(CEikonEnv::Static()->AppUiFactory()->MenuBar()->IsDisplayed());
-
- // Close the popup by opening a new window.
- QMainWindow mainWindow2;
- QAction action2("Test action", &mainWindow2);
- mainWindow2.menuBar()->addAction(&action2);
- mainWindow2.show();
- QVERIFY(!CEikonEnv::Static()->AppUiFactory()->MenuBar()->IsDisplayed());
-
- QT_TRAP_THROWING(CEikonEnv::Static()->AppUiFactory()->MenuBar()->TryDisplayMenuBarL());
- QVERIFY(CEikonEnv::Static()->AppUiFactory()->MenuBar()->IsDisplayed());
-
- // Close the popup by switching focus.
- mainWindow.activateWindow();
- QVERIFY(!CEikonEnv::Static()->AppUiFactory()->MenuBar()->IsDisplayed());
-}
-#endif
-
class InputContextTester : public QInputContext
{
Q_OBJECT
void tst_QWidget::movedAndResizedAttributes()
{
-#if defined (Q_OS_MAC) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN)
+#if defined (Q_OS_MAC) || defined(Q_WS_QWS)
QEXPECT_FAIL("", "FixMe, QTBUG-8941 and QTBUG-8977", Abort);
QVERIFY(false);
#else
wince*: {
DEPLOYMENT_PLUGIN += qsqlite
}
-
-symbian {
- qt_not_deployed {
- contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
- sqlite.path = /sys/bin
- sqlite.files = sqlite3.dll
- DEPLOYMENT += sqlite
- }
- }
-}
DEPLOYMENT += testData
}
-
-symbian {
- TARGET.EPOCHEAPSIZE=5000 5000000
- TARGET.EPOCSTACKSIZE=50000
-
- qt_not_deployed {
- contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
- sqlite.path = /sys/bin
- sqlite.files = sqlite3.dll
- DEPLOYMENT += sqlite
- }
- }
-}
-
LIBS += ws2_32.lib
}
}
-
-symbian {
- qt_not_deployed {
- contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
- sqlite.path = /sys/bin
- sqlite.files = sqlite3.dll
- DEPLOYMENT += sqlite
- }
- }
-}
QT = core sql
SOURCES += tst_qsqlerror.cpp
-
-symbian {
- qt_not_deployed {
- contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
- sqlite.path = /sys/bin
- sqlite.files = sqlite3.dll
- DEPLOYMENT += sqlite
- }
- }
-}
SOURCES += tst_qsqlfield.cpp
QT = core sql
-
-symbian {
- qt_not_deployed {
- contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
- sqlite.path = /sys/bin
- sqlite.files = sqlite3.dll
- DEPLOYMENT += sqlite
- }
- }
-}
-
DEPLOYMENT += plugFiles
LIBS += -lws2
}
-
-symbian {
- qt_not_deployed {
- contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
- sqlite.path = /sys/bin
- sqlite.files = sqlite3.dll
- DEPLOYMENT += sqlite
- }
- }
-}
load(qttest_p4)
SOURCES += tst_qsqlrecord.cpp
-symbian {
- qt_not_deployed {
- contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
- sqlite.path = /sys/bin
- sqlite.files = sqlite3.dll
- DEPLOYMENT += sqlite
- }
- }
-
- TARGET.EPOCSTACKSIZE=50000
- TARGET.EPOCHEAPSIZE=50000 5000000
-}
-
QT = core sql
-
-
-
plugFiles.path = .
DEPLOYMENT += plugFiles
LIBS += -lws2
-}else:symbian {
- qt_not_deployed {
- contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
- sqlite.path = /sys/bin
- sqlite.files = sqlite3.dll
- DEPLOYMENT += sqlite
- }
- }
-}else {
+} else {
win32:LIBS += -lws2_32
}
wince*: {
DEPLOYMENT_PLUGIN += qsqlite
LIBS += -lws2
-}else:symbian {
- qt_not_deployed {
- contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
- sqlite.path = /sys/bin
- sqlite.files = sqlite3.dll
- DEPLOYMENT += sqlite
- }
- }
} else {
win32:LIBS += -lws2_32
}
plugFiles.path = .
DEPLOYMENT += plugFiles
LIBS += -lws2
-}else:symbian {
- qt_not_deployed {
- contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
- sqlite.path = /sys/bin
- sqlite.files = sqlite3.dll
- DEPLOYMENT += sqlite
- }
- }
} else {
win32-g++* {
LIBS += -lws2_32
plugFiles.path = .
DEPLOYMENT += plugFiles
LIBS += -lws2
-}else:symbian {
- qt_not_deployed {
- contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
- sqlite.path = /sys/bin
- sqlite.files = sqlite3.dll
- DEPLOYMENT += sqlite
- }
- }
-}else {
+} else {
win32:LIBS += -lws2_32
}
+++ /dev/null
-load(qttest_p4)
-HEADERS +=
-SOURCES += tst_orientationchange.cpp
-
-symbian {
- INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE
- LIBS += -lcone -leikcore -lavkon # Screen orientation
-}
+++ /dev/null
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtTest/QtTest>
-
-#ifdef Q_OS_SYMBIAN
-
-#include <eikenv.h>
-#include <aknappui.h>
-#include <private/qcore_symbian_p.h>
-#include <QDesktopWidget>
-
-class tst_orientationchange : public QObject
-{
- Q_OBJECT
-public:
- tst_orientationchange(){};
- ~tst_orientationchange(){};
-
-private slots:
- void resizeEventOnOrientationChange();
-};
-
-class TestWidget : public QWidget
-{
-public:
- TestWidget(QWidget *parent = 0);
-
- void reset();
-public:
- void resizeEvent(QResizeEvent *event);
-
-public:
- QSize resizeEventSize;
- int resizeEventCount;
-};
-
-TestWidget::TestWidget(QWidget *parent)
-: QWidget(parent)
-{
- reset();
-}
-
-void TestWidget::reset()
-{
- resizeEventSize = QSize();
- resizeEventCount = 0;
-}
-
-void TestWidget::resizeEvent(QResizeEvent *event)
-{
- QWidget::resizeEvent(event);
-
- // Size delivered in first resize event is stored.
- if (!resizeEventCount)
- resizeEventSize = event->size();
-
- resizeEventCount++;
-}
-
-void tst_orientationchange::resizeEventOnOrientationChange()
-{
- // This will test that when orientation 'changes', then
- // at most one resize event is generated.
-
- TestWidget *normalWidget = new TestWidget();
- TestWidget *fullScreenWidget = new TestWidget();
- TestWidget *maximizedWidget = new TestWidget();
-
- fullScreenWidget->showFullScreen();
- maximizedWidget->showMaximized();
- normalWidget->show();
-
- QCoreApplication::sendPostedEvents();
- QCoreApplication::sendPostedEvents();
-
- QCOMPARE(fullScreenWidget->resizeEventCount, 1);
- QCOMPARE(fullScreenWidget->size(), fullScreenWidget->resizeEventSize);
- QCOMPARE(maximizedWidget->resizeEventCount, 1);
- QCOMPARE(maximizedWidget->size(), maximizedWidget->resizeEventSize);
- QCOMPARE(normalWidget->resizeEventCount, 1);
- QCOMPARE(normalWidget->size(), normalWidget->resizeEventSize);
-
- fullScreenWidget->reset();
- maximizedWidget->reset();
- normalWidget->reset();
-
- // Assumes that Qt application is AVKON application.
- CAknAppUi *appUi = static_cast<CAknAppUi*>(CEikonEnv::Static()->EikAppUi());
-
- // Determine 'opposite' orientation to the current orientation.
-
- CAknAppUi::TAppUiOrientation orientation = CAknAppUi::EAppUiOrientationLandscape;
- if (fullScreenWidget->size().width() > fullScreenWidget->size().height()) {
- orientation = CAknAppUi::EAppUiOrientationPortrait;
- }
-
- TRAPD(err, appUi->SetOrientationL(orientation));
-
- QCoreApplication::sendPostedEvents();
- QCoreApplication::sendPostedEvents();
-
- // setOrientationL is not guaranteed to change orientation
- // (if emulator configured to support just portrait or landscape, then
- // setOrientationL call shouldn't do anything).
- // So let's ensure that we do not get resize event twice.
-
- QVERIFY(fullScreenWidget->resizeEventCount <= 1);
- if (fullScreenWidget->resizeEventCount) {
- QCOMPARE(fullScreenWidget->size(), fullScreenWidget->resizeEventSize);
- }
- QVERIFY(maximizedWidget->resizeEventCount <= 1);
- if (fullScreenWidget->resizeEventCount) {
- QCOMPARE(maximizedWidget->size(), maximizedWidget->resizeEventSize);
- }
- QCOMPARE(normalWidget->resizeEventCount, 0);
-
- QDesktopWidget desktop;
- QRect qtAvail = desktop.availableGeometry(normalWidget);
- TRect clientRect = static_cast<CEikAppUi*>(CCoeEnv::Static()-> AppUi())->ClientRect();
- QRect symbianAvail = qt_TRect2QRect(clientRect);
- QCOMPARE(qtAvail, symbianAvail);
-
- // Switch orientation back to original
- orientation = orientation == CAknAppUi::EAppUiOrientationPortrait
- ? CAknAppUi::EAppUiOrientationLandscape
- : CAknAppUi::EAppUiOrientationPortrait;
-
-
- fullScreenWidget->reset();
- maximizedWidget->reset();
- normalWidget->reset();
-
- TRAP(err, appUi->SetOrientationL(orientation));
-
- QCoreApplication::sendPostedEvents();
- QCoreApplication::sendPostedEvents();
-
- // setOrientationL is not guaranteed to change orientation
- // (if emulator configured to support just portrait or landscape, then
- // setOrientationL call shouldn't do anything).
- // So let's ensure that we do not get resize event twice.
-
- QVERIFY(fullScreenWidget->resizeEventCount <= 1);
- if (fullScreenWidget->resizeEventCount) {
- QCOMPARE(fullScreenWidget->size(), fullScreenWidget->resizeEventSize);
- }
- QVERIFY(maximizedWidget->resizeEventCount <= 1);
- if (fullScreenWidget->resizeEventCount) {
- QCOMPARE(maximizedWidget->size(), maximizedWidget->resizeEventSize);
- }
- QCOMPARE(normalWidget->resizeEventCount, 0);
-
- qtAvail = desktop.availableGeometry(normalWidget);
- clientRect = static_cast<CEikAppUi*>(CCoeEnv::Static()-> AppUi())->ClientRect();
- symbianAvail = qt_TRect2QRect(clientRect);
- QCOMPARE(qtAvail, symbianAvail);
-
- TRAP(err, appUi->SetOrientationL(CAknAppUi::EAppUiOrientationUnspecified));
-
- delete normalWidget;
- delete fullScreenWidget;
- delete maximizedWidget;
-}
-
-QTEST_MAIN(tst_orientationchange)
-#include "tst_orientationchange.moc"
-#else
-QTEST_NOOP_MAIN
-#endif
+++ /dev/null
-load(qttest_p4)
-HEADERS +=
-SOURCES += tst_qmainexceptions.cpp
+++ /dev/null
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtTest/QtTest>
-#include <e32base.h>
-#include <typeinfo>
-#include <stdexcept>
-#include <euserhl.h>
-
-#ifdef Q_OS_SYMBIAN
-
-typedef void TLeavingFunc();
-
-class tst_qmainexceptions : public QObject
-{
- Q_OBJECT
-public:
- tst_qmainexceptions(){};
- ~tst_qmainexceptions(){};
-
- void TestSchedulerCatchesError(TLeavingFunc* f, int error);
- void TestSymbianRoundTrip(int leave, int trap);
- void TestStdRoundTrip(const std::exception& thrown, const std::exception& caught);
-
- bool event(QEvent *event);
-
-public slots:
- void initTestCase();
-private slots:
- void trap();
- void cleanupstack();
- void leave();
- void testTranslateBadAlloc();
- void testTranslateBigAlloc();
- void testRoundTrip();
- void testTrap();
- void testPropagation();
- void testDtor1();
- void testDtor2();
- void testNestedExceptions();
- void testScopedPointer();
- void testHybrid();
-};
-
-class CDummy : public CBase
-{
-public:
- CDummy(){}
- ~CDummy(){}
-};
-
-void tst_qmainexceptions::initTestCase()
-{
-}
-
-void tst_qmainexceptions::trap()
-{
- TTrapHandler *th= User::TrapHandler();
- QVERIFY((int)th);
-}
-
-void tst_qmainexceptions::cleanupstack()
-{
- __UHEAP_MARK;
- //fails if OOM
- CDummy* dummy1 = new (ELeave) CDummy;
- __UHEAP_CHECK(1);
- CleanupStack::PushL(dummy1);
- CleanupStack::PopAndDestroy(dummy1);
- __UHEAP_MARKEND;
-}
-
-void tst_qmainexceptions::leave()
-{
- __UHEAP_MARK;
- CDummy* dummy1 = 0;
- TRAPD(err,{
- CDummy* csDummy = new (ELeave) CDummy;
- CleanupStack::PushL(csDummy);
- __UHEAP_FAILNEXT(1);
- dummy1 = new (ELeave) CDummy;
- //CleanupStack::PopAndDestroy(csDummy); not executed as previous line throws
- });
- QCOMPARE(err,KErrNoMemory);
- QVERIFY(!((int)dummy1));
- __UHEAP_MARKEND;
-}
-
-class CTestActive : public CActive
-{
-public:
- CTestActive(TLeavingFunc* aFunc) : CActive(EPriorityStandard), iFunc(aFunc)
- {
- CActiveScheduler::Add(this);
- }
- ~CTestActive()
- {
- Cancel();
- }
- void DoCancel() {}
- void Test()
- {
- // complete this AO in a nested scheduler, to make it synchronous
- TRequestStatus* s = &iStatus;
- SetActive();
- User::RequestComplete(s, KErrNone);
- CActiveScheduler::Start();
- }
- void RunL()
- {
- (*iFunc)();
- CActiveScheduler::Stop(); // will only get here if iFunc does not leave
- }
- TInt RunError(TInt aError)
- {
- error = aError;
- CActiveScheduler::Stop(); // will only get here if iFunc leaves
- return KErrNone;
- }
-public:
- TLeavingFunc* iFunc;
- int error;
-};
-
-void tst_qmainexceptions::TestSchedulerCatchesError(TLeavingFunc* f, int error)
-{
- CTestActive *act = new(ELeave) CTestActive(f);
- act->Test();
- QCOMPARE(act->error, error);
- delete act;
-}
-
-void ThrowBadAlloc()
-{
- throw std::bad_alloc();
-}
-
-void TranslateThrowBadAllocL()
-{
- QT_TRYCATCH_LEAVING(ThrowBadAlloc());
-}
-
-void tst_qmainexceptions::testTranslateBadAlloc()
-{
- // bad_alloc should give KErrNoMemory in an AO
- TestSchedulerCatchesError(&TranslateThrowBadAllocL, KErrNoMemory);
-}
-
-void BigAlloc()
-{
- // allocate too much memory - it's expected that 100M ints is too much, but keep doubling if not.
- int *x = 0;
- int n = 100000000;
- do {
- x = new int[n];
- delete [] x;
- n = n * 2;
- } while (x);
-}
-
-void TranslateBigAllocL()
-{
- QT_TRYCATCH_LEAVING(BigAlloc());
-}
-
-void tst_qmainexceptions::testTranslateBigAlloc()
-{
- // this test will fail if new does not throw on failure, otherwise should give KErrNoMemory in AO
- TestSchedulerCatchesError(&TranslateBigAllocL, KErrNoMemory);
-}
-
-void tst_qmainexceptions::TestSymbianRoundTrip(int leave, int trap)
-{
- // check that leave converted to exception, converted to error gives expected error code
- int trapped;
- QT_TRYCATCH_ERROR(
- trapped,
- QT_TRAP_THROWING(
- User::LeaveIfError(leave)));
- QCOMPARE(trap, trapped);
-}
-
-void tst_qmainexceptions::TestStdRoundTrip(const std::exception& thrown, const std::exception& caught)
-{
- bool ok = false;
- try {
- QT_TRAP_THROWING(qt_symbian_exception2LeaveL(thrown));
- } catch (const std::exception& ex) {
- const std::type_info& exType = typeid(ex);
- const std::type_info& caughtType = typeid(caught);
- QCOMPARE(exType, caughtType);
- ok = true;
- }
- QCOMPARE(ok, true);
-}
-
-void tst_qmainexceptions::testRoundTrip()
-{
- for (int e=-50; e<0; e++)
- TestSymbianRoundTrip(e, e);
- TestSymbianRoundTrip(KErrNone, KErrNone);
- // positive error codes are not errors
- TestSymbianRoundTrip(1, KErrNone);
- TestSymbianRoundTrip(1000000000, KErrNone);
- TestStdRoundTrip(std::bad_alloc(), std::bad_alloc());
- TestStdRoundTrip(std::invalid_argument("abc"), std::invalid_argument(""));
- TestStdRoundTrip(std::underflow_error("abc"), std::underflow_error(""));
- TestStdRoundTrip(std::overflow_error("abc"), std::overflow_error(""));
-}
-
-void tst_qmainexceptions::testTrap()
-{
- // testing qt_exception2SymbianLeaveL
- TRAPD(err, qt_symbian_exception2LeaveL(std::bad_alloc()));
- QCOMPARE(err, KErrNoMemory);
-}
-
-bool tst_qmainexceptions::event(QEvent *aEvent)
-{
- if (aEvent->type() == QEvent::User+1)
- throw std::bad_alloc();
- else if (aEvent->type() == QEvent::User+2) {
- QEvent event(QEvent::Type(QEvent::User+1));
- QApplication::sendEvent(this, &event);
- }
- return QObject::event(aEvent);
-}
-
-void tst_qmainexceptions::testPropagation()
-{
- // test exception thrown from event is propagated back to sender
- QEvent event(QEvent::Type(QEvent::User+1));
- bool caught = false;
- try {
- QApplication::sendEvent(this, &event);
- } catch (const std::bad_alloc&) {
- caught = true;
- }
- QCOMPARE(caught, true);
-
- // testing nested events propagate back to top level sender
- caught = false;
- QEvent event2(QEvent::Type(QEvent::User+2));
- try {
- QApplication::sendEvent(this, &event2);
- } catch (const std::bad_alloc&) {
- caught = true;
- }
- QCOMPARE(caught, true);
-}
-
-void tst_qmainexceptions::testDtor1()
-{
- // destructors work on exception
- int i = 0;
- struct SAutoInc {
- SAutoInc(int& aI) : i(aI) { ++i; }
- ~SAutoInc() { --i; }
- int &i;
- } ai(i);
- QCOMPARE(i, 1);
- try {
- SAutoInc ai2(i);
- QCOMPARE(i, 2);
- throw std::bad_alloc();
- QFAIL("should not get here");
- } catch (const std::bad_alloc&) {
- QCOMPARE(i, 1);
- }
- QCOMPARE(i, 1);
-}
-
-void tst_qmainexceptions::testDtor2()
-{
- // memory is cleaned up correctly on exception
- // this crashes with winscw compiler build < 481
- __UHEAP_MARK;
- try {
- QString str("abc");
- str += "def";
- throw std::bad_alloc();
- QFAIL("should not get here");
- } catch (const std::bad_alloc&) { }
- __UHEAP_MARKEND;
-}
-
-void tst_qmainexceptions::testNestedExceptions()
-{
- // throwing exceptions while handling exceptions
- struct Oops {
- Oops* next;
- Oops(int level) : next(level > 0 ? new Oops(level-1) : 0) {}
- ~Oops() {
- try { throw std::bad_alloc(); }
- catch (const std::exception&) {delete next;}
- }
- };
- try {
- Oops oops(5);
- throw std::bad_alloc();
- }
- catch (const std::exception&) {}
-}
-
-class CTestRef : public CBase
-{
-public:
- CTestRef(int& aX) : iX(aX) { iX++; }
- ~CTestRef() { iX--; }
- int& iX;
-};
-
-void tst_qmainexceptions::testScopedPointer()
-{
- int x = 0;
- {
- QScopedPointer<CTestRef> ptr(q_check_ptr(new CTestRef(x)));
- QCOMPARE(x, 1);
- }
- QCOMPARE(x, 0);
- try {
- QScopedPointer<CTestRef> ptr(q_check_ptr(new CTestRef(x)));
- QCOMPARE(x, 1);
- throw 1;
- } catch (int) {
- QCOMPARE(x, 0);
- }
- QCOMPARE(x, 0);
-}
-
-int dtorFired[20];
-int* recDtor;
-
-class CDtorOrder : public CBase
-{
-public:
- CDtorOrder(TInt aId) : iId(aId) {}
- ~CDtorOrder() { *(recDtor++)=iId; }
- TInt iId;
-};
-
-class QDtorOrder
-{
-public:
- QDtorOrder(int aId) : iId(aId) {}
- ~QDtorOrder() { *(recDtor++)=iId; }
- int iId;
-};
-
-class RDtorOrder : public RHandleBase
-{
-public:
- TInt Connect(TInt aId) {iId = aId; SetHandle(aId); return KErrNone; }
- void Close() { *(recDtor++)=iId; }
- TInt iId;
-};
-
-enum THybridAction {EHybridLeave, EHybridThrow, EHybridPass};
-
-void HybridFuncLX(THybridAction aAction)
-{
- recDtor = dtorFired;
- QDtorOrder q1(1);
- {QDtorOrder q2(2);}
- CDtorOrder* c1 = new(ELeave) CDtorOrder(11);
- CleanupStack::PushL(c1);
- {LManagedHandle<RDtorOrder> r1;
- r1->Connect(21) OR_LEAVE;}
- CDtorOrder* c2 = new(ELeave) CDtorOrder(12);
- CleanupStack::PushL(c2);
- QDtorOrder q3(3);
- LManagedHandle<RDtorOrder> r2;
- r2->Connect(22) OR_LEAVE;
- CDtorOrder* c3 = new(ELeave) CDtorOrder(13);
- CleanupStack::PushL(c3);
- CleanupStack::PopAndDestroy(c3);
- QDtorOrder q4(4);
- switch (aAction)
- {
- case EHybridLeave:
- User::Leave(KErrNotFound);
- break;
- case EHybridThrow:
- throw std::bad_alloc();
- break;
- default:
- break;
- }
- CleanupStack::PopAndDestroy(2);
-}
-
-void tst_qmainexceptions::testHybrid()
-{
- TRAPD(error,
- QT_TRYCATCH_LEAVING(
- HybridFuncLX(EHybridLeave);
- ) );
- QCOMPARE(error, KErrNotFound);
- int expected1[] = {2, 21, 13, 12, 11, 4, 22, 3, 1};
- QCOMPARE(int(sizeof(expected1)/sizeof(int)), int(recDtor - dtorFired));
- for (int i=0; i<sizeof(expected1)/sizeof(int); i++)
- QCOMPARE(expected1[i], dtorFired[i]);
-
- TRAP(error,
- QT_TRYCATCH_LEAVING(
- HybridFuncLX(EHybridThrow);
- ) );
- QCOMPARE(error, KErrNoMemory);
- int expected2[] = {2, 21, 13, 4, 22, 3, 1, 12, 11};
- QCOMPARE(int(sizeof(expected2)/sizeof(int)), int(recDtor - dtorFired));
- for (int i=0; i<sizeof(expected2)/sizeof(int); i++)
- QCOMPARE(expected2[i], dtorFired[i]);
-
- TRAP(error,
- QT_TRYCATCH_LEAVING(
- HybridFuncLX(EHybridPass);
- ) );
- QCOMPARE(error, KErrNone);
- int expected3[] = {2, 21, 13, 12, 11, 4, 22, 3, 1};
- QCOMPARE(int(sizeof(expected3)/sizeof(int)), int(recDtor - dtorFired));
- for (int i=0; i<sizeof(expected3)/sizeof(int); i++)
- QCOMPARE(expected3[i], dtorFired[i]);
-}
-
-
-QTEST_MAIN(tst_qmainexceptions)
-#include "tst_qmainexceptions.moc"
-#else
-QTEST_NOOP_MAIN
-#endif
+++ /dev/null
-TEMPLATE = subdirs
-SUBDIRS = qmainexceptions orientationchange
-
-requires(symbian)
QT = core xml
QT -= gui
-wince*|symbian: {
+wince* {
addFiles.files = testdata doubleNamespaces.xml umlaut.xml
addFiles.path = .
DEPLOYMENT += addFiles
wince*|qt_not_deployed {
DEPLOYMENT_PLUGIN += qcncodecs qjpcodecs qkrcodecs qtwcodecs
}
- !symbian:DEFINES += SRCDIR=\\\"\\\"
+ DEFINES += SRCDIR=\\\"\\\"
}
else {
DEFINES += SRCDIR=\\\"$$PWD/\\\"
}
-
-symbian: TARGET.EPOCHEAPSIZE="0x100000 0x1000000"
#include <QtXml>
#include <QVariant>
-#if defined(Q_OS_SYMBIAN)
-# define SRCDIR ""
-#endif
-
//TESTED_CLASS=
//TESTED_FILES=
SOURCES += tst_qxml.cpp
QT = core xml
-wince*|symbian: {
+wince* {
addFiles.files = 0x010D.xml
addFiles.path = .
DEPLOYMENT += addFiles
}
-
-
QT += network xml
QT -= gui
-
-wince*|symbian: {
+wince* {
addFiles.files = encodings parser xmldocs
addFiles.path = .
DEPLOYMENT += addFiles
{
QFETCH(QString, file_name);
-#if defined(Q_OS_SYMBIAN)
- QSKIP("Symbian: Skipped due to problems in Open C and QtNetwork", SkipAll);
-#endif
-
#if defined(Q_OS_WIN32) && (defined(Q_CC_INTEL) || defined(Q_CC_MSVC_NET))
QSKIP("Regression caused by QHOstInfo change 294548, see task 202231.", SkipAll);
#endif
#elif defined(Q_OS_MAC)
pi.insert(PI_OSName, QLS("MacOS"));
pi.insert(PI_OSVersion, QString::number(qMacVersion()));
-#elif defined(Q_OS_SYMBIAN)
- pi.insert(PI_OSName, QLS("Symbian"));
- pi.insert(PI_OSVersion, QString::number(QSysInfo::symbianVersion());
#else
pi.insert(PI_OSName, QLS("Other"));
#endif
HEADERS += \
$$PWD/qbaselinetest.h
-win32|symbian*:MKSPEC=$$replace(QMAKESPEC, \\\\, /)
+win32:MKSPEC=$$replace(QMAKESPEC, \\\\, /)
else:MKSPEC=$$QMAKESPEC
DEFINES += QMAKESPEC=\\\"$$MKSPEC\\\"
#include <QFile>
#include <qtest.h>
-#ifdef Q_OS_SYMBIAN
-// In Symbian OS test data is located in applications private dir
-// Application private dir is default serach path for files, so SRCDIR can be set to empty
-#define SRCDIR ""
-#endif
-
Q_DECLARE_METATYPE(QList<QByteArray>)
Q_DECLARE_METATYPE(QTextCodec *)
wince*:{
DEFINES += SRCDIR=\\\"\\\"
-} else:symbian* {
- addFiles.files = utf-8.txt
- addFiles.path = .
- DEPLOYMENT += addFiles
- TARGET.EPOCHEAPSIZE="0x100 0x1000000"
} else {
DEFINES += SRCDIR=\\\"$$PWD/\\\"
}
void tst_qdiriterator::data()
{
-#if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
+#if defined(Q_OS_WINCE)
QByteArray qtdir = qPrintable(QCoreApplication::applicationDirPath());
qtdir += "/depot";
#else
CONFIG += release
-SOURCES += main.cpp
-
-SOURCES += qfilesystemiterator.cpp
+SOURCES += main.cpp qfilesystemiterator.cpp
HEADERS += qfilesystemiterator.h
-wince*|symbian: {
+wince* {
corelibdir.files = $$QT_SOURCE_TREE/src/corelib
corelibdir.path = ./depot/src
DEPLOYMENT += corelibdir
dir.cd("tst");
tmpDirName = dir.absolutePath();
-#if defined(Q_OS_SYMBIAN) || defined(Q_WS_WINCE)
+#if defined(Q_WS_WINCE)
for (int i = 0; i < 100; ++i)
#else
for (int i = 0; i < 1000; ++i)
QTest::newRow("100k") << qint64(100 * 1024);
QTest::newRow("1000k") << qint64(1000 * 1024);
QTest::newRow("10000k") << qint64(10000 * 1024);
-#ifndef Q_OS_SYMBIAN // Symbian devices don't (yet) have enough available RAM to run these
QTest::newRow("100000k") << qint64(100000 * 1024);
QTest::newRow("1000000k") << qint64(1000000 * 1024);
-#endif
}
void tst_qiodevice::read_old()
#include <math.h>
-#ifdef Q_OS_SYMBIAN
-# include <e32std.h>
-typedef RMutex NativeMutexType;
-void NativeMutexInitialize(NativeMutexType *mutex)
-{
- mutex->CreateLocal();
-}
-void NativeMutexDestroy(NativeMutexType *mutex)
-{
- mutex->Close();
-}
-void NativeMutexLock(NativeMutexType *mutex)
-{
- mutex->Wait();
-}
-void NativeMutexUnlock(NativeMutexType *mutex)
-{
- mutex->Signal();
-}
-#elif defined(Q_OS_UNIX)
+#if defined(Q_OS_UNIX)
# include <pthread.h>
# include <errno.h>
typedef pthread_mutex_t NativeMutexType;
int x[1000];
};
-// Symbian devices typically have limited memory
-#if defined(Q_OS_SYMBIAN) || defined(Q_WS_WINCE)
+// Embedded devices typically have limited memory
+#if defined(Q_WS_WINCE)
# define LARGE_MAX_SIZE 2000
#else
# define LARGE_MAX_SIZE 20000
{
QFETCH(int, size);
-#ifdef Q_OS_SYMBIAN
- if (size > 1000000)
- QSKIP("Skipped due to limited memory in many Symbian devices.", SkipSingle);
-#endif
-
QByteArray ba;
QBENCHMARK {
QByteArray ba2(size, 'x');
#include <QFile>
#include <QtTest/QtTest>
-#ifdef Q_OS_SYMBIAN
-// In Symbian OS test data is located in applications private dir
-// Application private dir is default serach path for files, so SRCDIR can be set to empty
-#define SRCDIR ""
-#endif
-
#ifdef Q_OS_UNIX
#include <sys/mman.h>
#include <unistd.h>
wince*:{
DEFINES += SRCDIR=\\\"\\\"
-} else:symbian* {
- addFiles.files = utf-8.txt
- addFiles.path = .
- DEPLOYMENT += addFiles
- TARGET.EPOCHEAPSIZE="0x100 0x1000000"
} else {
DEFINES += SRCDIR=\\\"$$PWD/\\\"
}
CONFIG += release
QT -= gui
SOURCES += main.cpp
-
-symbian: LIBS += -llibpthread
mMainView->resize(mSettings->size().width(), mSettings->size().height());
mMainView->show();
} else {
-#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5)
+#if defined(Q_WS_MAEMO_5)
mMainView->showFullScreen();
#else
if (QApplication::desktop()->width() < 360 || QApplication::desktop()->height() < 640) {
view.resize(settings.size().width(), settings.size().height());
view.show();
} else {
-#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5)
+#if defined(Q_WS_MAEMO_5)
view.showFullScreen();
#else
if (QApplication::desktop()->width() < 360 || QApplication::desktop()->height() < 640) {
RESOURCES += qgraphicsview.qrc
include(chiptester/chiptester.pri)
-
-symbian {
- qt_not_deployed {
- plugins.files = qjpeg.dll
- plugins.path = imageformats
- DEPLOYMENT += plugins
- }
-}
QTest::newRow("10x10x1 opaque") << 10 << 10 << 1 << true;
QTest::newRow("10x10x10 opaque") << 10 << 10 << 10 << true;
QTest::newRow("10x10x100 opaque") << 10 << 10 << 100 << true;
-#ifndef Q_OS_SYMBIAN
- //These test cases cause stack overflow in QWidgetPrivate::paintSiblingsRecursive
- //see http://bugreports.qt.nokia.com/browse/QTBUG-8512
- //Symbian threads have a hard limit of 80kB user stack
QTest::newRow("25x25x1 transparent ") << 25 << 25 << 1 << false;
QTest::newRow("25x25x10 transparent") << 25 << 25 << 10 << false;
QTest::newRow("25x25x100 transparent") << 25 << 25 << 100 << false;
QTest::newRow("25x25x1 opaque") << 25 << 25 << 1 << true;
QTest::newRow("25x25x10 opaque") << 25 << 25 << 10 << true;
QTest::newRow("25x25x100 opaque") << 25 << 25 << 100 << true;
-#endif
}
void tst_QWidget::update()
QFETCH(bool, show);
QFETCH(int, N);
-#ifdef Q_OS_SYMBIAN
- // Symbian has limited stack (max 80k), which will run out when N >= 20 due to
- // QWidget::show() using recursion among grid labels somewhere down the line.
- if (show && N >= 20)
- QSKIP("Grid too big for device to show", SkipSingle);
-#endif
-
QWidget *w = new QWidget();
QGridLayout *layout = new QGridLayout(w);
w->setLayout(layout);
#include <QBuffer>
#include <qtest.h>
-#ifdef Q_OS_SYMBIAN
-// In Symbian OS test data is located in applications private dir
-// Application private dir is default serach path for files, so SRCDIR can be set to empty
-#define SRCDIR ""
-#endif
-
Q_DECLARE_METATYPE(QTextDocument*)
class tst_QText: public QObject
QTest::newRow("lorem") << m_lorem;
QTest::newRow("short") << QString::fromLatin1("Lorem ipsum dolor sit amet");
-#if !defined(Q_OS_SYMBIAN)
QFile file(QString::fromLatin1(SRCDIR) + QLatin1String("/bidi.txt"));
-#else
- QFile file( SRCDIR "bidi.txt" );
-#endif
QVERIFY(file.open(QFile::ReadOnly));
QByteArray data = file.readAll();
QVERIFY(data.count() > 1000);
SOURCES += main.cpp
-symbian* {
- TARGET.CAPABILITY = ALL -TCB
- addFiles.files = bidi.txt
- addFiles.path = .
- DEPLOYMENT += addFiles
-} else {
- DEFINES += SRCDIR=\\\"$$PWD/\\\"
-}
+DEFINES += SRCDIR=\\\"$$PWD/\\\"
class qfile_vs_qnetworkaccessmanager : public QObject
{
Q_OBJECT
- // do not use on symbian.. 100 MB is too large..
- // but.. this is a manual test anyway, so :)
protected:
void qnamFileRead_iteration(QNetworkAccessManager &manager, QNetworkRequest &request);
void qnamImmediateFileRead_iteration(QNetworkAccessManager &manager, QNetworkRequest &request);
{
testFile.open();
QByteArray qba(1*1024*1024, 'x'); // 1 MB
-#ifdef Q_OS_SYMBIAN
- for (int i = 0; i < 10; i++) { // for Symbian only 10 MB
-#else
for (int i = 0; i < 100; i++) {
-#endif
testFile.write(qba);
testFile.flush();
size += qba.size();
QString cacheLoc = QDesktopServices::storageLocation(QDesktopServices::CacheLocation);
QTest::newRow("QDesktopServices Cache Location") << cacheLoc;
-#ifdef Q_OS_SYMBIAN
- if (QDir::drives().contains(QFileInfo("E:\\")))
- QTest::newRow("Symbian E: drive") << cacheLoc.replace(0, 1, QString("E"));
-#endif
-
}
//This functions times an insert() operation.
QString cacheLoc = QDesktopServices::storageLocation(QDesktopServices::CacheLocation);
QTest::newRow("QDesktopServices Cache Location") << cacheLoc;
-#ifdef Q_OS_SYMBIAN
- if (QDir::drives().contains(QFileInfo("E:\\")))
- QTest::newRow("Symbian E: drive") << cacheLoc.replace(0, 1, QString("E"));
-#endif
-
}
//Times metadata as well payload lookup
QString cacheLoc = QDesktopServices::storageLocation(QDesktopServices::CacheLocation);
QTest::newRow("QDesktopServices Cache Location") << cacheLoc;
-#ifdef Q_OS_SYMBIAN
- if (QDir::drives().contains(QFileInfo("E:\\")))
- QTest::newRow("Symbian E: drive") << cacheLoc.replace(0, 1, QString("E"));
-#endif
-
}
void tst_qnetworkdiskcache::timeRemoval()
QString cacheLoc = QDesktopServices::storageLocation(QDesktopServices::CacheLocation);
QTest::newRow("QDesktopServices Cache Location") << cacheLoc;
-#ifdef Q_OS_SYMBIAN
- if (QDir::drives().contains(QFileInfo("E:\\")))
- QTest::newRow("Symbian E: drive") << cacheLoc.replace(0, 1, QString("E"));
-#endif
-
}
+
void tst_qnetworkdiskcache::timeExpiration()
{
void tst_qnetworkreply::httpUploadPerformance()
{
-#if defined(Q_OS_SYMBIAN) || defined(Q_WS_WINCE_WM)
- // SHow some mercy for non-desktop platform/s
+#if defined(Q_WS_WINCE_WM)
+ // Show some mercy for non-desktop platform/s
enum {UploadSize = 4*1024*1024}; // 4 MB
#else
enum {UploadSize = 128*1024*1024}; // 128 MB
{
QFETCH(bool, serverSendsContentLength);
QFETCH(bool, chunkedEncoding);
-#if defined(Q_OS_SYMBIAN) || defined(Q_WS_WINCE_WM)
+#if defined(Q_WS_WINCE_WM)
// Show some mercy to non-desktop platform/s
enum {UploadSize = 4*1024*1024}; // 4 MB
#else
QFETCH(HttpDownloadPerformanceDownloadBufferTestType, testType);
// On my Linux Desktop the results are already visible with 128 kB, however we use this to have good results.
-#if defined(Q_OS_SYMBIAN) || defined(Q_WS_WINCE_WM)
+#if defined(Q_WS_WINCE_WM)
// Show some mercy to non-desktop platform/s
enum {UploadSize = 4*1024*1024}; // 4 MB
#else
**
****************************************************************************/
-// Just to get Q_OS_SYMBIAN
-#include <qglobal.h>
-
#include <QtTest/QtTest>
-
-
+#include <qglobal.h>
#include <qcoreapplication.h>
#include <qtcpsocket.h>
#include <qtcpserver.h>
tst_QTcpServer::tst_QTcpServer()
{
- Q_SET_DEFAULT_IAP
}
tst_QTcpServer::~tst_QTcpServer()
QSKIP("WinCE WM: Not yet supported", SkipAll);
#endif
-#if defined(Q_OS_SYMBIAN)
- QSKIP("Symbian: IPv6 is not yet supported", SkipAll);
-#endif
QTcpServer server;
if (!server.listen(QHostAddress::LocalHostIPv6, 0)) {
QVERIFY(server.serverError() == QAbstractSocket::UnsupportedSocketOperationError);
#include <QImageReader>
#include <QSize>
-#if defined(Q_OS_SYMBIAN)
-# define SRCDIR ""
-#endif
-
class tst_jpeg : public QObject
{
Q_OBJECT
wince*: {
DEFINES += SRCDIR=\\\"\\\"
-} else:symbian {
- # SRCDIR and SVGFILE defined in code in symbian
-}else {
+} else {
DEFINES += SRCDIR=\\\"$$PWD/\\\"
}
tableWidget->setItem(i+2, 1, new QTableWidgetItem(apNetworkConfiguration->children()[i].name()));
}
}
-
- tableWidget->setFocusPolicy(Qt::NoFocus);
-#ifdef Q_OS_SYMBIAN
- this->showMaximized();
-#endif
+ tableWidget->setFocusPolicy(Qt::NoFocus);
}
SessionTab::SessionTab(QNetworkConfiguration* apNetworkConfiguration,
main.cpp \
xqlistwidget.cpp \
datatransferer.cpp
-
-symbian:TARGET.CAPABILITY = NetworkServices NetworkControl ReadUserData WriteDeviceData ReadDeviceData
{
QApplication app(argc, argv);
BearerEx bearerEx;
-#ifdef Q_OS_SYMBIAN
- bearerEx.showMaximized();
-#else
bearerEx.show();
-#endif
return app.exec();
}
inputmethodhints.cpp
FORMS += inputmethodhints.ui
RESOURCES +=
-
-symbian:TARGET.UID3 = 0xE4938ABC
contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles2):QT += opengl
-symbian*: {
- testData.files = $$QT_BUILD_TREE/tests/auto/lancelot/scripts
- testData.path = .
- DEPLOYMENT += testData
-}
-
-
-
// IPv6 requires Winsock v2.0 or better.
WSAStartup(MAKEWORD(2,0), &wsadata);
-#elif defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN)
+#elif defined(Q_OS_UNIX)
::signal(SIGALRM, SIG_IGN);
#endif
// IPv6 requires Winsock v2.0 or better.
WSAStartup(MAKEWORD(2,0), &wsadata);
-#elif defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN)
+#elif defined(Q_OS_UNIX)
::signal(SIGALRM, SIG_IGN);
#endif
}
byteCounter = 0;
timeout.start();
-#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN)
+#if defined(Q_OS_UNIX)
alarm(10);
#endif
}
qDebug() << "Average transfer rate was" << (totalBytes / 1024.0 / 1024 * 1000 / outerTimer.elapsed()) << "MB/s";
-#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN)
+#if defined(Q_OS_UNIX)
alarm(0);
#endif
}
{
QApplication app(argv, args);
Window window;
-#if !defined(Q_OS_SYMBIAN)
window.show();
-#else
- window.showFullScreen();
-#endif
return app.exec();
}
{
QCoreApplication app(argc, argv);
-#ifdef Q_OS_SYMBIAN
- QNetworkConfigurationManager configurationManager;
- QNetworkConfiguration configuration = configurationManager.defaultConfiguration();
- if (!configuration.isValid()) {
- qDebug() << "Got an invalid session configuration";
- exit(1);
- }
-
- qDebug() << "Opening session...";
- QNetworkSession *session = new QNetworkSession(configuration);
-
- // Does not work:
-// session->open();
-// session->waitForOpened();
-
- // works:
- QEventLoop loop;
- QObject::connect(session, SIGNAL(opened()), &loop, SLOT(quit()), Qt::QueuedConnection);
- QMetaObject::invokeMethod(session, "open", Qt::QueuedConnection);
- loop.exec();
-
-
- if (session->isOpen()) {
- qDebug() << "session opened";
- } else {
- qDebug() << "session could not be opened -" << session->errorString();
- exit(1);
- }
-#endif
-
// create it
QAbstractSocketEngine *socketEngine =
QAbstractSocketEngine::createSocketEngine(QAbstractSocket::TcpSocket, QNetworkProxy(QNetworkProxy::NoProxy), 0);
bzero(buf, bufsize);
ret = socketEngine->read(buf, available);
if (ret > 0) {
-#ifdef Q_OS_SYMBIAN
- qDebug() << buf; //printf goes only to screen, this goes to remote debug channel
-#else
printf("%s", buf);
-#endif
} else {
// some failure when reading
exit(1);
CONFIG += release
-symbian: TARGET.CAPABILITY = NetworkServices
-
# Input
SOURCES += main.cpp
"Win32"
#elif defined(Q_WS_X11)
"X11"
-#elif defined(Q_OS_SYMBIAN)
- "Symbian"
#else
""
#endif
QApplication a(argc, argv);
FontBlaster dlg;
-#ifdef Q_OS_SYMBIAN
- dlg.showFullScreen();
-#else
dlg.show();
-#endif
return a.exec();
}