summaryrefslogtreecommitdiffstats
path: root/src/testlib
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@theqtcompany.com>2014-11-24 13:37:06 +0100
committerFrederik Gladhorn <frederik.gladhorn@theqtcompany.com>2014-11-24 13:39:13 +0100
commit34aba4724f196e34ed02cf50073f41968f119bb6 (patch)
tree0ebdfcabda989ab76ee6de53c6461553c7a767a5 /src/testlib
parentb86b2a742afae118bf974c82ba966ddb0cae4afb (diff)
parentb1cf07f495e10c93e53651ac03e46ebdaea0a97e (diff)
Merge remote-tracking branch 'origin/5.4' into dev
Conflicts: src/corelib/io/qiodevice.cpp src/plugins/bearer/linux_common/qofonoservice_linux.cpp src/plugins/bearer/linux_common/qofonoservice_linux_p.h src/plugins/platforms/android/qandroidplatformtheme.cpp src/tools/bootstrap/bootstrap.pro src/widgets/styles/qmacstyle_mac.mm Change-Id: Ia02aab6c4598ce74e9c30bb4666d5e2ef000f99b
Diffstat (limited to 'src/testlib')
-rw-r--r--src/testlib/qtest.h6
-rw-r--r--src/testlib/qtestcase.cpp12
-rw-r--r--src/testlib/qtesteventloop.h7
-rw-r--r--src/testlib/qtestlog.cpp1
4 files changed, 10 insertions, 16 deletions
diff --git a/src/testlib/qtest.h b/src/testlib/qtest.h
index d3443e7390..6298262958 100644
--- a/src/testlib/qtest.h
+++ b/src/testlib/qtest.h
@@ -46,7 +46,6 @@
#include <QtCore/qobject.h>
#include <QtCore/qvariant.h>
#include <QtCore/qurl.h>
-#include <QtCore/qversionnumber.h>
#include <QtCore/qpoint.h>
#include <QtCore/qsize.h>
@@ -164,11 +163,6 @@ template<> inline char *toString(const QVariant &v)
return qstrdup(vstring.constData());
}
-template<> inline char *toString(const QVersionNumber &version)
-{
- return toString(version.toString());
-}
-
template<>
inline bool qCompare(QString const &t1, QLatin1String const &t2, const char *actual,
const char *expected, const char *file, int line)
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp
index 2d92b3f6bd..24d563045b 100644
--- a/src/testlib/qtestcase.cpp
+++ b/src/testlib/qtestcase.cpp
@@ -1027,13 +1027,6 @@ QT_BEGIN_NAMESPACE
Returns a textual representation of the given \a variant.
*/
-/*!
- \fn char *QTest::toString(const QVersionNumber &version)
- \overload
-
- Returns a textual representation of the given \a version.
-*/
-
/*! \fn void QTest::qWait(int ms)
Waits for \a ms milliseconds. While waiting, events will be processed and
@@ -1735,7 +1728,8 @@ Q_TESTLIB_EXPORT void qtest_qParseArgs(int argc, char *argv[], bool qml)
} else if (strcmp(argv[i], "-vb") == 0) {
QBenchmarkGlobalData::current->verboseOutput = true;
#ifdef Q_OS_WINRT
- } else if (strncmp(argv[i], "-ServerName:", 12) == 0) {
+ } else if (strncmp(argv[i], "-ServerName:", 12) == 0 ||
+ strncmp(argv[i], "-qdevel", 7) == 0) {
continue;
#endif
} else if (argv[i][0] == '-') {
@@ -2159,7 +2153,7 @@ char *toPrettyUnicode(const ushort *p, int length)
break;
}
- if (*p < 0x7f && *p >= 0x20 && *p != '\\') {
+ if (*p < 0x7f && *p >= 0x20 && *p != '\\' && *p != '"') {
*dst++ = *p;
continue;
}
diff --git a/src/testlib/qtesteventloop.h b/src/testlib/qtesteventloop.h
index 9e738d2c47..034655cc50 100644
--- a/src/testlib/qtesteventloop.h
+++ b/src/testlib/qtesteventloop.h
@@ -40,6 +40,7 @@
#include <QtCore/qeventloop.h>
#include <QtCore/qobject.h>
#include <QtCore/qpointer.h>
+#include <QtCore/qthread.h>
QT_BEGIN_NAMESPACE
@@ -101,6 +102,12 @@ inline void QTestEventLoop::enterLoopMSecs(int ms)
inline void QTestEventLoop::exitLoop()
{
+ if (thread() != QThread::currentThread())
+ {
+ QMetaObject::invokeMethod(this, "exitLoop", Qt::QueuedConnection);
+ return;
+ }
+
if (timerId != -1)
killTimer(timerId);
timerId = -1;
diff --git a/src/testlib/qtestlog.cpp b/src/testlib/qtestlog.cpp
index 7ea953232f..e48fdc1ad0 100644
--- a/src/testlib/qtestlog.cpp
+++ b/src/testlib/qtestlog.cpp
@@ -279,7 +279,6 @@ namespace QTest {
return;
QString msg = qFormatLogMessage(type, context, message);
- msg.chop(1); // remove trailing newline
if (type != QtFatalMsg) {
if (counter.load() <= 0)