#define PGEN #include "parsetok.c" ramework that is used for developing application software that can be run on various software and hardware platforms with little or no change in the underlying codebase, while still being a native application with native capabilities and speed.
summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/_Categories/QtCore.txt4
-rw-r--r--tests/auto/_Categories/QtGui.txt4
-rw-r--r--tests/auto/_networkselftest/tst_networkselftest.cpp16
-rw-r--r--tests/auto/exceptionsafety_objects/tst_exceptionsafety_objects.cpp314
-rw-r--r--tests/auto/languagechange/tst_languagechange.cpp6
-rw-r--r--tests/auto/qabstractitemview/tst_qabstractitemview.cpp4
-rw-r--r--tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp4
-rw-r--r--tests/auto/qautoptr/qautoptr.pro2
-rw-r--r--tests/auto/qbitarray/tst_qbitarray.cpp2
-rw-r--r--tests/auto/qclipboard/tst_qclipboard.cpp6
-rw-r--r--tests/auto/qcombobox/tst_qcombobox.cpp4
-rw-r--r--tests/auto/qcssparser/qcssparser.pro1
-rw-r--r--tests/auto/qcssparser/tst_cssparser.cpp4
-rw-r--r--tests/auto/qdatetimeedit/tst_qdatetimeedit.cpp6
-rw-r--r--tests/auto/qdesktopservices/qdesktopservices.pro16
-rw-r--r--tests/auto/qdesktopservices/tst_qdesktopservices.cpp178
-rw-r--r--tests/auto/qdir/tst_qdir.cpp56
-rw-r--r--tests/auto/qfiledialog/qfiledialog.pro2
-rw-r--r--tests/auto/qfileinfo/tst_qfileinfo.cpp2
-rw-r--r--tests/auto/qfilesystemmodel/qfilesystemmodel.pro4
-rw-r--r--tests/auto/qfontdatabase/tst_qfontdatabase.cpp4
-rw-r--r--tests/auto/qfontdialog/tst_qfontdialog.cpp2
-rw-r--r--tests/auto/qftp/tst_qftp.cpp10
-rw-r--r--tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp4
-rw-r--r--tests/auto/qgraphicslayout/tst_qgraphicslayout.cpp60
-rw-r--r--tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp2
-rw-r--r--tests/auto/qhostinfo/tst_qhostinfo.cpp6
-rw-r--r--tests/auto/qhttp/tst_qhttp.cpp12
-rw-r--r--tests/auto/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp12
-rw-r--r--tests/auto/qhttpsocketengine/tst_qhttpsocketengine.cpp24
-rw-r--r--tests/auto/qimage/tst_qimage.cpp6
-rw-r--r--tests/auto/qimagereader/qimagereader.pro1
-rw-r--r--tests/auto/qitemdelegate/tst_qitemdelegate.cpp2
-rw-r--r--tests/auto/qitemmodel/qitemmodel.pro11
-rw-r--r--tests/auto/qitemview/tst_qitemview.cpp4
-rw-r--r--tests/auto/qkeyevent/tst_qkeyevent.cpp6
-rw-r--r--tests/auto/qlibrary/tst/tst.pro2
-rw-r--r--tests/auto/qlocalsocket/lackey/lackey.pro4
-rw-r--r--tests/auto/qlocalsocket/test/test.pro2
-rw-r--r--tests/auto/qlocalsocket/tst_qlocalsocket.cpp18
-rw-r--r--tests/auto/qmenu/tst_qmenu.cpp14
-rw-r--r--tests/auto/qnativesocketengine/tst_qnativesocketengine.cpp22
-rw-r--r--tests/auto/qnetworkinterface/tst_qnetworkinterface.cpp8
-rw-r--r--tests/auto/qnetworkreply/test/test.pro4
-rw-r--r--tests/auto/qnetworkreply/tst_qnetworkreply.cpp42
-rw-r--r--tests/auto/qobject/qobject.pro2
-rw-r--r--tests/auto/qobject/tst_qobject.cpp2
-rw-r--r--tests/auto/qobject/tst_qobject.pro1
-rw-r--r--tests/auto/qobjectrace/tst_qobjectrace.cpp14
-rw-r--r--tests/auto/qpluginloader/tst/tst.pro3
-rw-r--r--tests/auto/qpluginloader/tst_qpluginloader.cpp19
-rw-r--r--tests/auto/qresourceengine/qresourceengine.pro14
-rw-r--r--tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp4
-rw-r--r--tests/auto/qsettings/tst_qsettings.cpp4
-rw-r--r--tests/auto/qsocketnotifier/tst_qsocketnotifier.cpp14
-rw-r--r--tests/auto/qsocks5socketengine/tst_qsocks5socketengine.cpp28
-rw-r--r--tests/auto/qsql/qsql.pro4
-rw-r--r--tests/auto/qsqldatabase/qsqldatabase.pro4
-rw-r--r--tests/auto/qsqlerror/qsqlerror.pro2
-rw-r--r--tests/auto/qsqlfield/qsqlfield.pro2
-rw-r--r--tests/auto/qsqlquery/qsqlquery.pro2
-rw-r--r--tests/auto/qsqlquerymodel/qsqlquerymodel.pro2
-rw-r--r--tests/auto/qsqlrecord/qsqlrecord.pro2
-rw-r--r--tests/auto/qsqlrelationaltablemodel/qsqlrelationaltablemodel.pro4
-rw-r--r--tests/auto/qsqltablemodel/qsqltablemodel.pro2
-rw-r--r--tests/auto/qsqlthread/qsqlthread.pro2
-rw-r--r--tests/auto/qsslsocket/qsslsocket.pro4
-rw-r--r--tests/auto/qsslsocket/tst_qsslsocket.cpp40
-rw-r--r--tests/auto/qstatemachine/tst_qstatemachine.cpp182
-rw-r--r--tests/auto/qtcpserver/crashingServer/main.cpp2
-rw-r--r--tests/auto/qtcpserver/tst_qtcpserver.cpp8
-rw-r--r--tests/auto/qtcpsocket/tst_qtcpsocket.cpp34
-rw-r--r--tests/auto/qtemporaryfile/qtemporaryfile.pro2
-rw-r--r--tests/auto/qtextcodec/test/test.pro2
-rw-r--r--tests/auto/qtextedit/tst_qtextedit.cpp2
-rw-r--r--tests/auto/qtextodfwriter/qtextodfwriter.pro2
-rw-r--r--tests/auto/qtextstream/test/test.pro2
-rw-r--r--tests/auto/qtextstream/tst_qtextstream.cpp4
-rw-r--r--tests/auto/qtimer/tst_qtimer.cpp1
-rw-r--r--tests/auto/qudpsocket/tst_qudpsocket.cpp152
-rw-r--r--tests/auto/qvariant/tst_qvariant.cpp6
-rw-r--r--tests/auto/qwaitcondition/tst_qwaitcondition.cpp716
-rw-r--r--tests/auto/qwidget/tst_qwidget.cpp12
-rw-r--r--tests/auto/qxmlsimplereader/tst_qxmlsimplereader.cpp4
-rw-r--r--tests/auto/symbian/orientationchange/orientationchange.pro4
-rw-r--r--tests/auto/symbian/orientationchange/tst_orientationchange.cpp36
-rw-r--r--tests/auto/symbian/qmainexceptions/qmainexceptions.pro4
-rw-r--r--tests/auto/symbian/qmainexceptions/tst_qmainexceptions.cpp8
88 files changed, 1256 insertions, 1019 deletions
diff --git a/tests/auto/_Categories/QtCore.txt b/tests/auto/_Categories/QtCore.txt
index c3fb879..452b6ba 100644
--- a/tests/auto/_Categories/QtCore.txt
+++ b/tests/auto/_Categories/QtCore.txt
@@ -5,7 +5,7 @@ exceptionsafety
qabstractitemmodel
#Requires STL
qalgorithms
-qanimationgroup
+qanimationgroup
qatomicint
qatomicpointer
qbitarray
@@ -80,7 +80,7 @@ qsocketnotifier
qstate
qstatemachine
#Requires STL
-qstl
+qstl
qstring
qstringlist
qstringmatcher
diff --git a/tests/auto/_Categories/QtGui.txt b/tests/auto/_Categories/QtGui.txt
index 6ef7cfe..dcb3be5 100644
--- a/tests/auto/_Categories/QtGui.txt
+++ b/tests/auto/_Categories/QtGui.txt
@@ -43,7 +43,7 @@ qdirmodel
qdockwidget
qdoublespinbox
qdoublevalidator
-qdrag
+qdrag
qerrormessage
qfiledialog
qfileiconprovider
@@ -166,7 +166,7 @@ qtextlist
qtextobject
qtextodfwriter
#This test can only be compiled on HW currently, because it does not use reduced exports
-#Because we are planning to use class level exports also in HW later on, there is no
+#Because we are planning to use class level exports also in HW later on, there is no
#sense to enable this at all
#qtextpiecetable
qtextscriptengine
diff --git a/tests/auto/_networkselftest/tst_networkselftest.cpp b/tests/auto/_networkselftest/tst_networkselftest.cpp
index cfb5c3c..2c57e83 100644
--- a/tests/auto/_networkselftest/tst_networkselftest.cpp
+++ b/tests/auto/_networkselftest/tst_networkselftest.cpp
@@ -52,8 +52,8 @@ class tst_NetworkSelfTest: public QObject
Q_OBJECT
public:
tst_NetworkSelfTest();
- virtual ~tst_NetworkSelfTest();
-
+ virtual ~tst_NetworkSelfTest();
+
private slots:
void hostTest();
void dnsResolution_data();
@@ -68,7 +68,7 @@ private slots:
void httpServer();
void httpsServer();
void httpProxy();
- void httpProxyBasicAuth();
+ void httpProxyBasicAuth();
void httpProxyNtlmAuth();
void socks5Proxy();
void socks5ProxyAuth();
@@ -371,7 +371,7 @@ void tst_NetworkSelfTest::remotePortsOpen_data()
QTest::newRow("https") << 443;
QTest::newRow("http-proxy") << 3128;
QTest::newRow("http-proxy-auth-basic") << 3129;
- QTest::newRow("http-proxy-auth-ntlm") << 3130;
+ QTest::newRow("http-proxy-auth-ntlm") << 3130;
QTest::newRow("socks5-proxy") << 1080;
QTest::newRow("socks5-proxy-auth") << 1081;
}
@@ -381,8 +381,8 @@ 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
-
+#endif
+
QFETCH(int, portNumber);
QTcpSocket socket;
socket.connectToHost(QtNetworkSettings::serverName(), portNumber);
@@ -538,7 +538,7 @@ void tst_NetworkSelfTest::httpProxyNtlmAuth()
{
#ifdef Q_OS_SYMBIAN
QSKIP("NTML authentication not yet supported in Symbian", SkipAll);
-#else
+#else
netChat(3130, QList<Chat>()
// test auth required response
<< Chat::send("GET http://" + QtNetworkSettings::serverName().toLatin1() + "/ HTTP/1.0\r\n"
@@ -551,7 +551,7 @@ void tst_NetworkSelfTest::httpProxyNtlmAuth()
<< Chat::discardUntil("\r\nProxy-Authenticate: NTLM\r\n")
<< Chat::DiscardUntilDisconnect
);
-#endif
+#endif
}
// SOCKSv5 is a binary protocol
diff --git a/tests/auto/exceptionsafety_objects/tst_exceptionsafety_objects.cpp b/tests/auto/exceptionsafety_objects/tst_exceptionsafety_objects.cpp
index c867899..0a95e5a 100644
--- a/tests/auto/exceptionsafety_objects/tst_exceptionsafety_objects.cpp
+++ b/tests/auto/exceptionsafety_objects/tst_exceptionsafety_objects.cpp
@@ -71,49 +71,60 @@ private slots:
void widgets_data();
void widgets();
+
+ void vector_data();
+ void vector();
+
+ void list_data();
+ void list();
+
+ void linkedList_data();
+ void linkedList();
};
// helper structs to create an arbitrary widget
-struct AbstractObjectCreator
+struct AbstractTester
{
- virtual void test(QObject *parent) = 0;
+ virtual void operator()(QObject *parent) = 0;
};
+Q_DECLARE_METATYPE(AbstractTester *)
-Q_DECLARE_METATYPE(AbstractObjectCreator *)
+typedef void (*TestFunction)(QObject*);
+Q_DECLARE_METATYPE(TestFunction)
template <typename T>
-struct ObjectCreator : public AbstractObjectCreator
+struct ObjectCreator : public AbstractTester
{
- void test(QObject *)
+ void operator()(QObject *)
{
QScopedPointer<T> ptr(new T);
}
};
-struct BitArrayCreator : public AbstractObjectCreator
+struct BitArrayCreator : public AbstractTester
{
- void test(QObject *)
+ void operator()(QObject *)
{ QScopedPointer<QBitArray> bitArray(new QBitArray(100, true)); }
};
-struct ByteArrayMatcherCreator : public AbstractObjectCreator
+struct ByteArrayMatcherCreator : public AbstractTester
{
- void test(QObject *)
+ void operator()(QObject *)
{ QScopedPointer<QByteArrayMatcher> ptr(new QByteArrayMatcher("ralf test",8)); }
};
-struct CryptographicHashCreator : public AbstractObjectCreator
+struct CryptographicHashCreator : public AbstractTester
{
- void test(QObject *)
+ void operator()(QObject *)
{
QScopedPointer<QCryptographicHash> ptr(new QCryptographicHash(QCryptographicHash::Sha1));
ptr->addData("ralf test",8);
}
};
-struct DataStreamCreator : public AbstractObjectCreator
+struct DataStreamCreator : public AbstractTester
{
- void test(QObject *)
+ void operator()(QObject *)
{
QScopedPointer<QByteArray> arr(new QByteArray("hallo, test"));
QScopedPointer<QDataStream> ptr(new QDataStream(arr.data(), QIODevice::ReadWrite));
@@ -121,9 +132,9 @@ struct DataStreamCreator : public AbstractObjectCreator
}
};
-struct DirCreator : public AbstractObjectCreator
+struct DirCreator : public AbstractTester
{
- void test(QObject *)
+ void operator()(QObject *)
{
QDir::cleanPath("../////././");
QScopedPointer<QDir> ptr(new QDir("."));
@@ -140,9 +151,9 @@ struct DirCreator : public AbstractObjectCreator
void tst_ExceptionSafetyObjects::objects_data()
{
- QTest::addColumn<AbstractObjectCreator *>("objectCreator");
+ QTest::addColumn<AbstractTester *>("objectCreator");
-#define NEWROW(T) QTest::newRow(#T) << static_cast<AbstractObjectCreator *>(new ObjectCreator<T >)
+#define NEWROW(T) QTest::newRow(#T) << static_cast<AbstractTester *>(new ObjectCreator<T >)
NEWROW(QObject);
NEWROW(QBuffer);
NEWROW(QFile);
@@ -154,7 +165,7 @@ void tst_ExceptionSafetyObjects::objects_data()
NEWROW(QTranslator);
NEWROW(QFSFileEngine);
-#define NEWROW2(T, CREATOR) QTest::newRow(#T) << static_cast<AbstractObjectCreator *>(new CREATOR)
+#define NEWROW2(T, CREATOR) QTest::newRow(#T) << static_cast<AbstractTester *>(new CREATOR)
NEWROW2(QBitArray, BitArrayCreator);
NEWROW2(QByteArrayMatcher, ByteArrayMatcherCreator);
NEWROW2(QCryptographicHash, CryptographicHashCreator);
@@ -165,9 +176,10 @@ void tst_ExceptionSafetyObjects::objects_data()
// create and destructs an object, and lets each and every allocation
// during construction and destruction fail.
-static void doOOMTest(AbstractObjectCreator *creator, QObject *parent)
+template <typename T>
+static void doOOMTest(T &testFunc, QObject *parent, int start=0)
{
- int currentOOMIndex = 0;
+ int currentOOMIndex = start;
bool caught = false;
bool done = false;
@@ -180,7 +192,7 @@ static void doOOMTest(AbstractObjectCreator *creator, QObject *parent)
caught = false;
try {
- creator->test(parent);
+ testFunc(parent);
} catch (const std::bad_alloc &) {
caught = true;
} catch (const std::exception &ex) {
@@ -198,6 +210,10 @@ static void doOOMTest(AbstractObjectCreator *creator, QObject *parent)
}
}
+ // if we get a FAIL, stop executing now
+ if (QTest::currentTestFailed())
+ done = true;
+
//#define REALLY_VERBOSE
#ifdef REALLY_VERBOSE
fprintf(stderr, " OOM Index: %d\n", currentOOMIndex);
@@ -212,6 +228,8 @@ static void doOOMTest(AbstractObjectCreator *creator, QObject *parent)
#ifdef VERBOSE
fprintf(stderr, "OOM Test done, checked allocs: %d (range %d - %d)\n", currentOOMIndex,
allocCountBefore, allocFailer.currentAllocIndex());
+#else
+ Q_UNUSED(allocCountBefore);
#endif
}
@@ -278,7 +296,9 @@ void tst_ExceptionSafetyObjects::initTestCase()
(void) std::set_new_handler(nh_func);
#endif
- doOOMTest(new ObjectCreator<SelfTestObject>, 0);
+ ObjectCreator<SelfTestObject> *selfTest = new ObjectCreator<SelfTestObject>;
+ doOOMTest(*selfTest, 0);
+ delete selfTest;
QCOMPARE(alloc1Failed, 1);
QCOMPARE(alloc2Failed, 1);
QCOMPARE(alloc3Failed, 2);
@@ -289,15 +309,17 @@ void tst_ExceptionSafetyObjects::initTestCase()
void tst_ExceptionSafetyObjects::objects()
{
- QFETCH(AbstractObjectCreator *, objectCreator);
+ QFETCH(AbstractTester *, objectCreator);
- doOOMTest(objectCreator, 0);
+ doOOMTest(*objectCreator, 0);
+
+ delete objectCreator;
}
template <typename T>
-struct WidgetCreator : public AbstractObjectCreator
+struct WidgetCreator : public AbstractTester
{
- void test(QObject *parent)
+ void operator()(QObject *parent)
{
Q_ASSERT(!parent || parent->isWidgetType());
QScopedPointer<T> ptr(parent ? new T(static_cast<QWidget *>(parent)) : new T);
@@ -305,9 +327,9 @@ struct WidgetCreator : public AbstractObjectCreator
};
// QSizeGrip doesn't have a default constructor - always pass parent (even though it might be 0)
-template <> struct WidgetCreator<QSizeGrip> : public AbstractObjectCreator
+template <> struct WidgetCreator<QSizeGrip> : public AbstractTester
{
- void test(QObject *parent)
+ void operator()(QObject *parent)
{
Q_ASSERT(!parent || parent->isWidgetType());
QScopedPointer<QSizeGrip> ptr(new QSizeGrip(static_cast<QWidget *>(parent)));
@@ -315,9 +337,9 @@ template <> struct WidgetCreator<QSizeGrip> : public AbstractObjectCreator
};
// QDesktopWidget doesn't need a parent.
-template <> struct WidgetCreator<QDesktopWidget> : public AbstractObjectCreator
+template <> struct WidgetCreator<QDesktopWidget> : public AbstractTester
{
- void test(QObject *parent)
+ void operator()(QObject *parent)
{
Q_ASSERT(!parent || parent->isWidgetType());
QScopedPointer<QDesktopWidget> ptr(new QDesktopWidget());
@@ -325,10 +347,10 @@ template <> struct WidgetCreator<QDesktopWidget> : public AbstractObjectCreator
};
void tst_ExceptionSafetyObjects::widgets_data()
{
- QTest::addColumn<AbstractObjectCreator *>("widgetCreator");
+ QTest::addColumn<AbstractTester *>("widgetCreator");
#undef NEWROW
-#define NEWROW(T) QTest::newRow(#T) << static_cast<AbstractObjectCreator *>(new WidgetCreator<T >)
+#define NEWROW(T) QTest::newRow(#T) << static_cast<AbstractTester *>(new WidgetCreator<T >)
NEWROW(QWidget);
@@ -389,17 +411,239 @@ void tst_ExceptionSafetyObjects::widgets_data()
void tst_ExceptionSafetyObjects::widgets()
{
- QFETCH(AbstractObjectCreator *, widgetCreator);
+ QFETCH(AbstractTester *, widgetCreator);
- doOOMTest(widgetCreator, 0);
+ doOOMTest(*widgetCreator, 0, 00000);
QWidget parent;
- doOOMTest(widgetCreator, &parent);
+ doOOMTest(*widgetCreator, &parent, 00000);
+
+ delete widgetCreator;
// if the test reaches here without crashing, we passed :)
QVERIFY(true);
}
+struct Integer
+{
+ Integer(int value = 42)
+ : ptr(new int(value))
+ {
+ ++instanceCount;
+ }
+
+ Integer(const Integer &other)
+ : ptr(new int(*other.ptr))
+ {
+ ++instanceCount;
+ }
+
+ Integer &operator=(const Integer &other)
+ {
+ int *newPtr = new int(*other.ptr);
+ delete ptr;
+ ptr = newPtr;
+ return *this;
+ }
+
+ ~Integer()
+ {
+ --instanceCount;
+ delete ptr;
+ }
+
+ int value() const
+ {
+ return *ptr;
+ }
+
+ int *ptr;
+ static int instanceCount;
+};
+
+int Integer::instanceCount = 0;
+
+template <template<typename T> class Container>
+void containerInsertTest(QObject*)
+{
+ Container<Integer> container;
+
+ // insert an item in an empty container
+ try {
+ container.insert(container.begin(), 41);
+ } catch (...) {
+ QVERIFY(container.isEmpty());
+ QCOMPARE(Integer::instanceCount, 0);
+ return;
+ }
+
+ QCOMPARE(container.size(), 1);
+ QCOMPARE(Integer::instanceCount, 1);
+
+ // insert an item before another item
+ try {
+ container.insert(container.begin(), 42);
+ } catch (...) {
+ QCOMPARE(container.size(), 1);
+ QCOMPARE(container.first().value(), 41);
+ QCOMPARE(Integer::instanceCount, 1);
+ return;
+ }
+
+ QCOMPARE(Integer::instanceCount, 2);
+
+ // insert an item in between
+ try {
+ container.insert(container.begin() + 1, 43);
+ } catch (...) {
+ QCOMPARE(container.size(), 2);
+ QCOMPARE(container.first().value(), 41);
+ QCOMPARE((container.begin() + 1)->value(), 42);
+ QCOMPARE(Integer::instanceCount, 2);
+ return;
+ }
+
+ QCOMPARE(Integer::instanceCount, 3);
+}
+
+template <template<typename T> class Container>
+void containerAppendTest(QObject*)
+{
+ Container<Integer> container;
+
+ // append to an empty container
+ try {
+ container.append(42);
+ } catch (...) {
+ QCOMPARE(container.size(), 0);
+ QCOMPARE(Integer::instanceCount, 0);
+ return;
+ }
+
+ // append to a container with one item
+ try {
+ container.append(43);
+ } catch (...) {
+ QCOMPARE(container.size(), 1);
+ QCOMPARE(container.first().value(), 42);
+ QCOMPARE(Integer::instanceCount, 1);
+ return;
+ }
+}
+
+template <template<typename T> class Container>
+void containerEraseTest(QObject*)
+{
+ Container<Integer> container;
+
+ try {
+ container.append(42);
+ container.append(43);
+ container.append(44);
+ container.append(45);
+ container.append(46);
+ } catch (...) {
+ // don't care
+ return;
+ }
+
+ // sanity checks
+ QCOMPARE(container.size(), 5);
+ QCOMPARE(Integer::instanceCount, 5);
+
+ // delete the first one
+ try {
+ container.erase(container.begin());
+ } catch (...) {
+ QCOMPARE(container.size(), 5);
+ QCOMPARE(container.first().value(), 42);
+ QCOMPARE(Integer::instanceCount, 5);
+ return;
+ }
+
+ QCOMPARE(container.size(), 4);
+ QCOMPARE(container.first().value(), 43);
+ QCOMPARE(Integer::instanceCount, 4);
+
+ // delete the last one
+ try {
+ container.erase(container.end() - 1);
+ } catch (...) {
+ QCOMPARE(container.size(), 4);
+ QCOMPARE(Integer::instanceCount, 4);
+ return;
+ }
+
+ QCOMPARE(container.size(), 3);
+ QCOMPARE(container.first().value(), 43);
+ QCOMPARE((container.begin() + 1)->value(), 44);
+ QCOMPARE((container.begin() + 2)->value(), 45);
+ QCOMPARE(Integer::instanceCount, 3);
+
+ // delete the middle one
+ try {
+ container.erase(container.begin() + 1);
+ } catch (...) {
+ QCOMPARE(container.size(), 3);
+ QCOMPARE(container.first().value(), 43);
+ QCOMPARE((container.begin() + 1)->value(), 44);
+ QCOMPARE((container.begin() + 2)->value(), 45);
+ QCOMPARE(Integer::instanceCount, 3);
+ return;
+ }
+
+ QCOMPARE(container.size(), 2);
+ QCOMPARE(container.first().value(), 43);
+ QCOMPARE((container.begin() + 1)->value(), 45);
+ QCOMPARE(Integer::instanceCount, 2);
+}
+
+template <template<typename T> class Container>
+static void containerData()
+{
+ QTest::addColumn<TestFunction>("testFunction");
+
+ QTest::newRow("insert") << static_cast<TestFunction>(containerInsertTest<Container>);
+ QTest::newRow("append") << static_cast<TestFunction>(containerAppendTest<Container>);
+ QTest::newRow("erase") << static_cast<TestFunction>(containerEraseTest<Container>);
+}
+
+void tst_ExceptionSafetyObjects::vector_data()
+{
+ containerData<QVector>();
+}
+
+void tst_ExceptionSafetyObjects::vector()
+{
+ QFETCH(TestFunction, testFunction);
+
+ doOOMTest(testFunction, 0);
+}
+
+void tst_ExceptionSafetyObjects::list_data()
+{
+ containerData<QList>();
+}
+
+void tst_ExceptionSafetyObjects::list()
+{
+ QFETCH(TestFunction, testFunction);
+
+ doOOMTest(testFunction, 0);
+}
+
+void tst_ExceptionSafetyObjects::linkedList_data()
+{
+ containerData<QLinkedList>();
+}
+
+void tst_ExceptionSafetyObjects::linkedList()
+{
+ QFETCH(TestFunction, testFunction);
+
+ doOOMTest(testFunction, 0);
+}
+
QTEST_MAIN(tst_ExceptionSafetyObjects)
#include "tst_exceptionsafety_objects.moc"
#endif // QT_NO_EXCEPTIONS
diff --git a/tests/auto/languagechange/tst_languagechange.cpp b/tests/auto/languagechange/tst_languagechange.cpp
index f856f67..9ffadb1 100644
--- a/tests/auto/languagechange/tst_languagechange.cpp
+++ b/tests/auto/languagechange/tst_languagechange.cpp
@@ -213,11 +213,11 @@ void tst_languageChange::retranslatability()
"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
+ // Allow a little extra time or emulator startup delays cause failure
QTimer::singleShot(5000, &translator, SLOT(install()));
-#else
+#else
QTimer::singleShot(500, &translator, SLOT(install()));
-#endif
+#endif
switch (dialogType) {
case InputDialog:
(void)QInputDialog::getInteger(0, QLatin1String("title"), QLatin1String("label"));
diff --git a/tests/auto/qabstractitemview/tst_qabstractitemview.cpp b/tests/auto/qabstractitemview/tst_qabstractitemview.cpp
index 6a6b395..cceaed8 100644
--- a/tests/auto/qabstractitemview/tst_qabstractitemview.cpp
+++ b/tests/auto/qabstractitemview/tst_qabstractitemview.cpp
@@ -456,7 +456,7 @@ void tst_QAbstractItemView::basic_tests(TestView *view)
view->setDragEnabled(true);
QCOMPARE(view->dragEnabled(), true);
#endif
-
+
// setAlternatingRowColors
view->setAlternatingRowColors(false);
QCOMPARE(view->alternatingRowColors(), false);
@@ -569,7 +569,7 @@ void tst_QAbstractItemView::basic_tests(TestView *view)
view->tst_setState(TestView::CollapsingState);
QVERIFY(view->tst_state()==TestView::CollapsingState);
#endif
-
+
view->tst_startAutoScroll();
view->tst_stopAutoScroll();
view->tst_doAutoScroll();
diff --git a/tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp b/tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp
index 2a4a1a7..b3f918b 100644
--- a/tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp
+++ b/tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp
@@ -84,7 +84,7 @@ public:
#ifdef Q_OS_SYMBIAN
QString location = QLatin1String("./cache/");
#else
- QString location = QDesktopServices::storageLocation(QDesktopServices::DataLocation)
+ QString location = QDesktopServices::storageLocation(QDesktopServices::DataLocation)
+ QLatin1String("/cache/");
#endif
setCacheDirectory(location);
@@ -111,7 +111,7 @@ tst_QAbstractNetworkCache::tst_QAbstractNetworkCache()
}
tst_QAbstractNetworkCache::~tst_QAbstractNetworkCache()
-{
+{
}
static bool AlwaysTrue = true;
diff --git a/tests/auto/qautoptr/qautoptr.pro b/tests/auto/qautoptr/qautoptr.pro
index 9eab084..b0c574f 100644
--- a/tests/auto/qautoptr/qautoptr.pro
+++ b/tests/auto/qautoptr/qautoptr.pro
@@ -1,4 +1,4 @@
load(qttest_p4)
SOURCES += tst_qautoptr.cpp
-QT = core
+QT = core
include(../xmlpatterns.pri)
diff --git a/tests/auto/qbitarray/tst_qbitarray.cpp b/tests/auto/qbitarray/tst_qbitarray.cpp
index 3c9ef53..f8f288f 100644
--- a/tests/auto/qbitarray/tst_qbitarray.cpp
+++ b/tests/auto/qbitarray/tst_qbitarray.cpp
@@ -646,7 +646,7 @@ void tst_QBitArray::resize()
// grow the array back and check the new bit
a.resize(10);
QCOMPARE( a, QStringToQBitArray(QString("1100000000")) );
-
+
// other test with and
a.resize(9);
QBitArray b = QStringToQBitArray(QString("1111111111"));
diff --git a/tests/auto/qclipboard/tst_qclipboard.cpp b/tests/auto/qclipboard/tst_qclipboard.cpp
index c01f274..2dc20d5 100644
--- a/tests/auto/qclipboard/tst_qclipboard.cpp
+++ b/tests/auto/qclipboard/tst_qclipboard.cpp
@@ -198,7 +198,7 @@ void tst_QClipboard::copy_exit_paste()
// ### 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
+#endif
if (!nativeClipboardWorking())
QSKIP("Native clipboard not working in this setup", SkipAll);
const QStringList stringArgument = QStringList() << "Test string.";
@@ -242,7 +242,7 @@ void tst_QClipboard::setMimeData()
QApplication::clipboard()->setMimeData(data, QClipboard::Clipboard);
QApplication::clipboard()->setMimeData(data, QClipboard::Selection);
QApplication::clipboard()->setMimeData(data, QClipboard::FindBuffer);
-
+
QSignalSpy spySelection(QApplication::clipboard(), SIGNAL(selectionChanged()));
QSignalSpy spyData(QApplication::clipboard(), SIGNAL(dataChanged()));
QSignalSpy spyFindBuffer(QApplication::clipboard(), SIGNAL(findBufferChanged()));
@@ -279,7 +279,7 @@ void tst_QClipboard::setMimeData()
spySelection.clear();
spyData.clear();
spyFindBuffer.clear();
-
+
QApplication::clipboard()->setMimeData(newData, QClipboard::Clipboard);
QApplication::clipboard()->setMimeData(newData, QClipboard::Selection); // used to crash on X11
QApplication::clipboard()->setMimeData(newData, QClipboard::FindBuffer);
diff --git a/tests/auto/qcombobox/tst_qcombobox.cpp b/tests/auto/qcombobox/tst_qcombobox.cpp
index dbb90fd..0ed02f1 100644
--- a/tests/auto/qcombobox/tst_qcombobox.cpp
+++ b/tests/auto/qcombobox/tst_qcombobox.cpp
@@ -1246,7 +1246,7 @@ void tst_QComboBox::insertItem()
QCOMPARE(testWidget->count(), initialItems.count() + 1);
QCOMPARE(testWidget->itemText(expectedIndex), itemLabel);
-
+
if (editable)
QCOMPARE(testWidget->currentText(), QString("FOO"));
}
@@ -2202,7 +2202,7 @@ void tst_QComboBox::noScrollbar()
QVERIFY(!comboBox.view()->horizontalScrollBar()->isVisible());
QVERIFY(!comboBox.view()->verticalScrollBar()->isVisible());
}
-
+
{
QTableWidget *table = new QTableWidget(2,2);
QComboBox comboBox;
diff --git a/tests/auto/qcssparser/qcssparser.pro b/tests/auto/qcssparser/qcssparser.pro
index 2a61403..84ee425 100644
--- a/tests/auto/qcssparser/qcssparser.pro
+++ b/tests/auto/qcssparser/qcssparser.pro
@@ -13,4 +13,3 @@ wince*|symbian: {
addFiles.path = .
DEPLOYMENT += addFiles
}
-
diff --git a/tests/auto/qcssparser/tst_cssparser.cpp b/tests/auto/qcssparser/tst_cssparser.cpp
index ce923e1..9870ec2 100644
--- a/tests/auto/qcssparser/tst_cssparser.cpp
+++ b/tests/auto/qcssparser/tst_cssparser.cpp
@@ -1139,8 +1139,8 @@ void tst_CssParser::specificity()
QVERIFY(parser.parse(&sheet));
QCOMPARE(sheet.styleRules.count() + sheet.nameIndex.count() + sheet.idIndex.count() , 1);
- QCss::StyleRule rule = (!sheet.styleRules.isEmpty()) ? sheet.styleRules.at(0)
- : (!sheet.nameIndex.isEmpty()) ? *sheet.nameIndex.begin()
+ QCss::StyleRule rule = (!sheet.styleRules.isEmpty()) ? sheet.styleRules.at(0)
+ : (!sheet.nameIndex.isEmpty()) ? *sheet.nameIndex.begin()
: *sheet.idIndex.begin();
QCOMPARE(rule.selectors.count(), 1);
QTEST(rule.selectors.at(0).specificity(), "specificity");
diff --git a/tests/auto/qdatetimeedit/tst_qdatetimeedit.cpp b/tests/auto/qdatetimeedit/tst_qdatetimeedit.cpp
index 93bf4ed..652093e 100644
--- a/tests/auto/qdatetimeedit/tst_qdatetimeedit.cpp
+++ b/tests/auto/qdatetimeedit/tst_qdatetimeedit.cpp
@@ -2216,12 +2216,12 @@ void tst_QDateTimeEdit::mousePress()
// Ask the SC_SpinBoxUp button location from style
QStyleOptionSpinBox so;
- so.rect = testWidget->rect();
+ so.rect = testWidget->rect();
QRect rectUp = testWidget->style()->subControlRect(QStyle::CC_SpinBox, &so, QStyle::SC_SpinBoxUp, testWidget);
-
+
// Send mouseClick to center of SC_SpinBoxUp
QTest::mouseClick(testWidget, Qt::LeftButton, 0, rectUp.center());
- QCOMPARE(testWidget->date().year(), 2005);
+ QCOMPARE(testWidget->date().year(), 2005);
}
diff --git a/tests/auto/qdesktopservices/qdesktopservices.pro b/tests/auto/qdesktopservices/qdesktopservices.pro
index 3c96e85..7c1bdb9 100644
--- a/tests/auto/qdesktopservices/qdesktopservices.pro
+++ b/tests/auto/qdesktopservices/qdesktopservices.pro
@@ -10,22 +10,22 @@ symbian: {
dummy.path = .
text.sources = text\*
- text.path = \data\others\
+ text.path = \data\others\
image.sources = image\*
image.path = \data\images\
-
+
audio.sources = audio\*
audio.path = \data\sounds\
-
+
video.sources = video\*
- video.path = \data\videos\
-
+ video.path = \data\videos\
+
install.sources = install\*
- install.path = \data\installs\
-
+ install.path = \data\installs\
+
DEPLOYMENT += image audio video install
-
+
# These are only needed for manual tests
#DEPLOYMENT += dummy text
}
diff --git a/tests/auto/qdesktopservices/tst_qdesktopservices.cpp b/tests/auto/qdesktopservices/tst_qdesktopservices.cpp
index c69b112..dd85774 100644
--- a/tests/auto/qdesktopservices/tst_qdesktopservices.cpp
+++ b/tests/auto/qdesktopservices/tst_qdesktopservices.cpp
@@ -61,16 +61,16 @@ private slots:
void cleanup();
void openUrl();
#ifdef Q_OS_SYMBIAN
- // These test are manual ones, you need to check from device that
+ // 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
+ // When you want to run these test, uncomment //#define RUN_MANUAL_TESTS
void openHttpUrl_data();
void openHttpUrl();
void openMailtoUrl_data();
- void openMailtoUrl();
+ void openMailtoUrl();
void openFileUrl_data();
void openFileUrl();
-#endif
+#endif
void handlers();
void storageLocation_data();
void storageLocation();
@@ -104,7 +104,7 @@ void tst_qdesktopservices::openUrl()
// At the bare minimum check that they return false for invalid url's
QCOMPARE(QDesktopServices::openUrl(QUrl()), false);
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
- // this test is only valid on windows on other systems it might mean open a new document in the application handling .file
+ // this test is only valid on windows on other systems it might mean open a new document in the application handling .file
QCOMPARE(QDesktopServices::openUrl(QUrl("file://invalid.file")), false);
#endif
}
@@ -112,32 +112,32 @@ void tst_qdesktopservices::openUrl()
#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::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);
+#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");
-
+ 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;
@@ -149,97 +149,97 @@ void tst_qdesktopservices::openMailtoUrl_data()
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 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;
+
+ // 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("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;
-
+ 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 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 `?'
+ 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);
+#ifndef RUN_MANUAL_TESTS
+ QSKIP("Test disabled -- only for manual purposes", SkipAll);
+#endif
+
+ QFETCH(QUrl, url);
+ QFETCH(bool, result);
+ QCOMPARE(QDesktopServices::openUrl(url), result);
}
void tst_qdesktopservices::openFileUrl_data()
{
QTest::addColumn<QUrl>("url");
- QTest::addColumn<bool>("result");
-
+ 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("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;
-
+ 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;
+ 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);
+#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(15000);
+ QTest::qWait(15000);
}
#endif
@@ -297,17 +297,17 @@ void tst_qdesktopservices::storageLocation()
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();
+
+ QString drive = QDir::currentPath().left(2).toLower();
if( drive == "z:" )
drive = "c:";
switch(location) {
case QDesktopServices::DesktopLocation:
- QCOMPARE( storageLocation, QString() );
+ QCOMPARE( storageLocation, drive + QString("/data") );
break;
case QDesktopServices::DocumentsLocation:
QCOMPARE( storageLocation, drive + QString("/data") );
@@ -319,9 +319,9 @@ void tst_qdesktopservices::storageLocation()
case QDesktopServices::ApplicationsLocation:
#ifdef Q_CC_NOKIAX86
QCOMPARE( storageLocation, QString("z:/sys/bin") );
-#else
- QCOMPARE( storageLocation, drive + QString("/sys/bin") );
-#endif
+#else
+ QCOMPARE( storageLocation, drive + QString("/sys/bin") );
+#endif
break;
case QDesktopServices::MusicLocation:
QCOMPARE( storageLocation, drive + QString("/data/sounds") );
@@ -331,7 +331,7 @@ void tst_qdesktopservices::storageLocation()
break;
case QDesktopServices::PicturesLocation:
QCOMPARE( storageLocation, drive + QString("/data/images") );
- break;
+ break;
case QDesktopServices::TempLocation:
QCOMPARE( storageLocation, QDir::tempPath().toLower());
break;
@@ -339,18 +339,18 @@ void tst_qdesktopservices::storageLocation()
QCOMPARE( storageLocation, QDir::homePath().toLower());
break;
case QDesktopServices::DataLocation:
- // Just check the folder not the drive
+ // Just check the folder not the drive
QCOMPARE( storageLocation.mid(2), QDir::currentPath().mid(2).toLower());
- break;
+ break;
default:
QCOMPARE( storageLocation, QString() );
- break;
+ break;
}
#else
QDesktopServices::storageLocation(location);
QDesktopServices::displayName(location);
-#endif
+#endif
}
diff --git a/tests/auto/qdir/tst_qdir.cpp b/tests/auto/qdir/tst_qdir.cpp
index 60bb177..549e9d1 100644
--- a/tests/auto/qdir/tst_qdir.cpp
+++ b/tests/auto/qdir/tst_qdir.cpp
@@ -400,20 +400,20 @@ void tst_QDir::entryList_data()
QTest::addColumn<int>("sortspec");
QTest::addColumn<QStringList>("expected");
QTest::newRow("spaces1") << SRCDIR "testdir/spaces" << QStringList("*. bar")
- << (int)(QDir::NoFilter) << (int)(QDir::NoSort)
- << QStringList("foo. bar"); // notice how spaces5 works
+ << (int)(QDir::NoFilter) << (int)(QDir::NoSort)
+ << QStringList("foo. bar"); // notice how spaces5 works
QTest::newRow("spaces2") << SRCDIR "testdir/spaces" << QStringList("*.bar")
- << (int)(QDir::NoFilter) << (int)(QDir::NoSort)
- << QStringList("foo.bar");
+ << (int)(QDir::NoFilter) << (int)(QDir::NoSort)
+ << QStringList("foo.bar");
QTest::newRow("spaces3") << SRCDIR "testdir/spaces" << QStringList("foo.*")
- << (int)(QDir::NoFilter) << (int)(QDir::NoSort)
- << QString("foo. bar,foo.bar").split(',');
+ << (int)(QDir::NoFilter) << (int)(QDir::NoSort)
+ << QString("foo. bar,foo.bar").split(',');
QTest::newRow("files1") << SRCDIR "testdir/dir" << QString("*r.cpp *.pro").split(" ")
- << (int)(QDir::NoFilter) << (int)(QDir::NoSort)
- << QString("qdir.pro,qrc_qdir.cpp,tst_qdir.cpp").split(',');
+ << (int)(QDir::NoFilter) << (int)(QDir::NoSort)
+ << QString("qdir.pro,qrc_qdir.cpp,tst_qdir.cpp").split(',');
QTest::newRow("testdir1") << SRCDIR "testdir" << QStringList()
- << (int)(QDir::AllDirs) << (int)(QDir::NoSort)
- << QString(".,..,dir,spaces").split(',');
+ << (int)(QDir::AllDirs) << (int)(QDir::NoSort)
+ << QString(".,..,dir,spaces").split(',');
// #### this test uses filenames that cannot be represented on all filesystems we test, in
// particular HFS+ on the Mac. When checking out the files with perforce it silently ignores the
// error that it cannot represent the file names stored in the repository and the test fails. That
@@ -422,8 +422,8 @@ void tst_QDir::entryList_data()
// ignored but git reports an error. The test only tried to prevent QDir from _hanging_ when listing
// the directory.
// QTest::newRow("unprintablenames") << SRCDIR "unprintablenames" << QStringList("*")
-// << (int)(QDir::NoFilter) << (int)(QDir::NoSort)
-// << QString(".,..").split(",");
+// << (int)(QDir::NoFilter) << (int)(QDir::NoSort)
+// << QString(".,..").split(",");
QTest::newRow("resources1") << QString(":/tst_qdir/resources/entryList") << QStringList("*.data")
<< (int)(QDir::NoFilter) << (int)(QDir::NoSort)
<< QString("file1.data,file2.data,file3.data").split(',');
@@ -559,10 +559,10 @@ void tst_QDir::entryList()
QFile::remove(SRCDIR "entrylist/brokenlink.lnk");
QFile::remove(SRCDIR "entrylist/brokenlink");
- // WinCE/Symbian does not have . and .. in the directory listing
+ // WinCE/Symbian does not have . and .. in the directory listing
#if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
- expected.removeAll(".");
- expected.removeAll("..");
+ expected.removeAll(".");
+ expected.removeAll("..");
#endif
#if defined(Q_OS_WIN)
@@ -572,7 +572,7 @@ void tst_QDir::entryList()
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");
+ expected.removeAll("linktodirectory.lnk");
// Expecting failures from a couple of OpenC bugs. Do checks only once.
static int xFailChecked = false;
@@ -769,7 +769,7 @@ void tst_QDir::canonicalPath_data()
}
#endif
- QTest::newRow("relative") << "." << appPath;
+ QTest::newRow("relative") << "." << appPath;
QTest::newRow("relativeSubDir") << "./testData/../testData" << appPath + "/testData";
#ifndef Q_WS_WIN
@@ -816,10 +816,10 @@ void tst_QDir::current_data()
else
appPath.chop(1); // remove the ending slash
#if defined Q_WS_WIN
- if (appPath.endsWith("release", Qt::CaseInsensitive))
- appPath = appPath.left(appPath.length()-8);
+ if (appPath.endsWith("release", Qt::CaseInsensitive))
+ appPath = appPath.left(appPath.length()-8);
else if (appPath.endsWith("debug", Qt::CaseInsensitive))
- appPath = appPath.left(appPath.length()-6);
+ appPath = appPath.left(appPath.length()-6);
#endif
QTest::newRow("startup") << QString() << appPath;
@@ -853,9 +853,9 @@ void tst_QDir::current()
QDir newCurrent = QDir::current();
QDir::setCurrent(oldDir);
#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
- QCOMPARE(newCurrent.absolutePath().toLower(), currentDir.toLower());
+ QCOMPARE(newCurrent.absolutePath().toLower(), currentDir.toLower());
#else
- QCOMPARE(newCurrent.absolutePath(), currentDir);
+ QCOMPARE(newCurrent.absolutePath(), currentDir);
#endif
}
@@ -870,8 +870,8 @@ void tst_QDir::cd_data()
QTest::addColumn<QString>("newDir");
QString appPath = QDir::currentPath();
- int index = appPath.lastIndexOf("/");
- QTest::newRow("cdUp") << QDir::currentPath() << ".." << true << appPath.left(index==0?1:index);
+ 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
QTest::newRow("absolute") << QDir::currentPath() << "/" << true << "/";
@@ -913,11 +913,11 @@ void tst_QDir::setNameFilters_data()
QTest::newRow("spaces1") << appPath + "testdir/spaces" << QStringList("*. bar")
<< QStringList("foo. bar");
QTest::newRow("spaces2") << appPath + "testdir/spaces" << QStringList("*.bar")
- << QStringList("foo.bar");
+ << QStringList("foo.bar");
QTest::newRow("spaces3") << appPath + "testdir/spaces" << QStringList("foo.*")
- << QString("foo. bar,foo.bar").split(",");
+ << QString("foo. bar,foo.bar").split(",");
QTest::newRow("files1") << appPath + "testdir/dir" << QString("*r.cpp *.pro").split(" ")
- << QString("qdir.pro,qrc_qdir.cpp,tst_qdir.cpp").split(",");
+ << QString("qdir.pro,qrc_qdir.cpp,tst_qdir.cpp").split(",");
QTest::newRow("resources1") << QString(":/tst_qdir/resources/entryList") << QStringList("*.data")
<< QString("file1.data,file2.data,file3.data").split(',');
}
@@ -1204,7 +1204,7 @@ void tst_QDir::operator_eq()
void tst_QDir::dotAndDotDot()
{
#if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
- QSKIP("WinCE and Symbian do not have . nor ..", SkipAll);
+ QSKIP("WinCE and Symbian do not have . nor ..", SkipAll);
#endif
QDir dir(QString(SRCDIR "testdir/"));
QStringList entryList = dir.entryList(QDir::Dirs);
diff --git a/tests/auto/qfiledialog/qfiledialog.pro b/tests/auto/qfiledialog/qfiledialog.pro
index 3c238ec..bea7716 100644
--- a/tests/auto/qfiledialog/qfiledialog.pro
+++ b/tests/auto/qfiledialog/qfiledialog.pro
@@ -15,6 +15,4 @@ wince*|symbian: {
}
symbian:TARGET.EPOCHEAPSIZE="0x100 0x1000000"
-
symbian:HEADERS += ../../../include/qtgui/private/qfileinfogatherer_p.h
-
diff --git a/tests/auto/qfileinfo/tst_qfileinfo.cpp b/tests/auto/qfileinfo/tst_qfileinfo.cpp
index 2a19a04..75b6100 100644
--- a/tests/auto/qfileinfo/tst_qfileinfo.cpp
+++ b/tests/auto/qfileinfo/tst_qfileinfo.cpp
@@ -1112,7 +1112,7 @@ void tst_QFileInfo::isExecutable()
#ifdef Q_OS_SYMBIAN
# if defined(Q_CC_NOKIAX86)
QSKIP("Impossible to implement reading/touching of application binaries in Symbian emulator", SkipAll);
-# endif
+# endif
QString appPath = "c:/sys/bin/tst_qfileinfo.exe";
#else
QString appPath = QCoreApplication::applicationDirPath();
diff --git a/tests/auto/qfilesystemmodel/qfilesystemmodel.pro b/tests/auto/qfilesystemmodel/qfilesystemmodel.pro
index 8701318..d421e44 100644
--- a/tests/auto/qfilesystemmodel/qfilesystemmodel.pro
+++ b/tests/auto/qfilesystemmodel/qfilesystemmodel.pro
@@ -5,12 +5,12 @@ include(../../../../modeltest/modeltest.pri)
QT = core gui
-SOURCES += tst_qfilesystemmodel.cpp
+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.sources = tst_qfilesystemmodel.cpp
dummyDeploy.path = .
diff --git a/tests/auto/qfontdatabase/tst_qfontdatabase.cpp b/tests/auto/qfontdatabase/tst_qfontdatabase.cpp