diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2014-05-13 14:27:45 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-05-13 16:08:01 +0200 |
commit | ff334fd57414be90ab6b40f91e16f0bdb1835762 (patch) | |
tree | bb74d8217781394163870cb3399f0984136498c8 /src/testlib/qtestcase.cpp | |
parent | ec4c93a852ddc1d1437232241de492ad20d4cbb1 (diff) | |
parent | b5552bab40f2e165cf7196993ffc83785f4d8264 (diff) |
Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev
Diffstat (limited to 'src/testlib/qtestcase.cpp')
-rw-r--r-- | src/testlib/qtestcase.cpp | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp index cbf479f1d2..cc58b51743 100644 --- a/src/testlib/qtestcase.cpp +++ b/src/testlib/qtestcase.cpp @@ -2863,8 +2863,6 @@ bool QTest::currentTestFailed() void QTest::qSleep(int ms) { QTEST_ASSERT(ms > 0); - QElapsedTimer timer; - timer.start(); #if defined(Q_OS_WINRT) WaitForSingleObjectEx(GetCurrentThread(), ms, true); @@ -2874,20 +2872,6 @@ void QTest::qSleep(int ms) struct timespec ts = { ms / 1000, (ms % 1000) * 1000 * 1000 }; nanosleep(&ts, NULL); #endif - // Warn if the elapsed time was more than 50% longer or more than 10% shorter than the - // requested time. - qint64 requested = 1000000 * (qint64)ms; - qint64 diff = timer.nsecsElapsed() - requested; -#ifndef Q_OS_WIN - const qint64 factor = 2; // more than 50% longer -#else - const qint64 factor = 1; // Windows: 50% is quite common, warn about 100% -#endif - if (diff * factor > requested || diff * 10 < -requested) { - QTestLog::warn(qPrintable( - QString::fromLatin1("QTest::qSleep() should have taken %1ns, but actually took %2ns!") - .arg(requested).arg(diff + requested)), __FILE__, __LINE__); - } } /*! \internal |