summaryrefslogtreecommitdiffstats
path: root/src/testlib
diff options
context:
space:
mode:
authorAndrew Knight <andrew.knight@digia.com>2013-09-13 12:22:45 +0300
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-20 13:53:59 +0200
commitd959c37eaa66298579ca55440aff5fdb8b3126b2 (patch)
tree6c61938d1046fd2e469f63b49f3e58c4da449f88 /src/testlib
parent7e2b238c507ee2fdea26f2b57512f337de2c5f85 (diff)
WinRT: Basic global support
Various global changes, primarily preprocessor flow, to support the WinRT platform. Change-Id: I3fa9cf91d5fb24019362e88fcf205e31b4f810b5 Reviewed-by: Andrew Knight <andrew.knight@digia.com>
Diffstat (limited to 'src/testlib')
-rw-r--r--src/testlib/qtestcase.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp
index 0cf2f3256b..d4869b6390 100644
--- a/src/testlib/qtestcase.cpp
+++ b/src/testlib/qtestcase.cpp
@@ -2079,7 +2079,7 @@ FatalSignalHandler::~FatalSignalHandler()
} // namespace
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
static LONG WINAPI windowsFaultHandler(struct _EXCEPTION_POINTERS *exInfo)
{
char appName[MAX_PATH];
@@ -2089,7 +2089,7 @@ static LONG WINAPI windowsFaultHandler(struct _EXCEPTION_POINTERS *exInfo)
appName, exInfo->ExceptionRecord->ExceptionCode);
return EXCEPTION_EXECUTE_HANDLER;
}
-#endif // Q_OS_WIN) && !Q_OS_WINCE
+#endif // Q_OS_WIN) && !Q_OS_WINCE && !Q_OS_WINRT
/*!
Executes tests declared in \a testObject. In addition, the private slots
@@ -2171,7 +2171,7 @@ int QTest::qExec(QObject *testObject, int argc, char **argv)
qtest_qParseArgs(argc, argv, false);
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
if (!noCrashHandler) {
# ifndef Q_CC_MINGW
_CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_DEBUG);
@@ -2179,7 +2179,7 @@ int QTest::qExec(QObject *testObject, int argc, char **argv)
SetErrorMode(SetErrorMode(0) | SEM_NOGPFAULTERRORBOX);
SetUnhandledExceptionFilter(windowsFaultHandler);
} // !noCrashHandler
-#endif // Q_OS_WIN) && !Q_OS_WINCE
+#endif // Q_OS_WIN) && !Q_OS_WINCE && !Q_OS_WINRT
#ifdef QTESTLIB_USE_VALGRIND
if (QBenchmarkGlobalData::current->mode() == QBenchmarkGlobalData::CallgrindParentProcess) {
@@ -2570,7 +2570,9 @@ void QTest::qSleep(int ms)
{
QTEST_ASSERT(ms > 0);
-#ifdef Q_OS_WIN
+#if defined(Q_OS_WINRT)
+ WaitForSingleObjectEx(GetCurrentThread(), ms, true);
+#elif defined(Q_OS_WIN)
Sleep(uint(ms));
#else
struct timespec ts = { ms / 1000, (ms % 1000) * 1000 * 1000 };