diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-11-18 02:02:18 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-11-18 02:02:18 (GMT) |
commit | e1d8cf0b1cb07f7c4e70017322f2f548ae216e78 (patch) | |
tree | bd96e90a23ce3fcfec6a0a471d558eb4c05d76f8 | |
parent | cca7c5b40751e2192ba2c7c7422557eeb5672a17 (diff) | |
parent | 346953b985deb5003e801b23063daf3f6dee3824 (diff) | |
download | Qt-e1d8cf0b1cb07f7c4e70017322f2f548ae216e78.zip Qt-e1d8cf0b1cb07f7c4e70017322f2f548ae216e78.tar.gz Qt-e1d8cf0b1cb07f7c4e70017322f2f548ae216e78.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1:
Use GLIBC functions on any GLIBC architecture.
tst_qnetworkreply: Fix ugly test
-rw-r--r-- | src/corelib/tools/qlocale.cpp | 6 | ||||
-rw-r--r-- | tests/auto/qnetworkreply/tst_qnetworkreply.cpp | 34 |
2 files changed, 20 insertions, 20 deletions
diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp index 6b1de5e..d152682 100644 --- a/src/corelib/tools/qlocale.cpp +++ b/src/corelib/tools/qlocale.cpp @@ -77,7 +77,7 @@ QT_END_NAMESPACE #include <qdebug.h> #include <time.h> -#if defined(Q_OS_LINUX) && !defined(__UCLIBC__) +#if defined(__GLIBC__) && !defined(__UCLIBC__) # include <fenv.h> #endif @@ -6637,7 +6637,7 @@ Q_CORE_EXPORT char *qdtoa ( double d, int mode, int ndigits, int *decpt, int *si _control87(MCW_EM, MCW_EM); #endif -#if defined(Q_OS_LINUX) && !defined(__UCLIBC__) +#if defined(__GLIBC__) && !defined(__UCLIBC__) fenv_t envp; feholdexcept(&envp); #endif @@ -6653,7 +6653,7 @@ Q_CORE_EXPORT char *qdtoa ( double d, int mode, int ndigits, int *decpt, int *si #endif //_M_X64 #endif //Q_OS_WIN -#if defined(Q_OS_LINUX) && !defined(__UCLIBC__) +#if defined(__GLIBC__) && !defined(__UCLIBC__) fesetenv(&envp); #endif diff --git a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp index 41b3e0a..ddb7687 100644 --- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp @@ -4130,8 +4130,23 @@ void tst_QNetworkReply::httpProxyCommands() QCOMPARE(receivedHeader, expectedCommand); } +class ProxyChangeHelper : public QObject { + Q_OBJECT +public: + ProxyChangeHelper() : QObject(), signalCount(0) {}; +public slots: + void finishedSlot() { + signalCount++; + if (signalCount == 2) + QMetaObject::invokeMethod(&QTestEventLoop::instance(), "exitLoop", Qt::QueuedConnection); + } +private: + int signalCount; +}; + void tst_QNetworkReply::proxyChange() { + ProxyChangeHelper helper; MiniHttpServer proxyServer( "HTTP/1.0 200 OK\r\nProxy-Connection: keep-alive\r\n" "Content-Length: 1\r\n\r\n1"); @@ -4141,30 +4156,15 @@ void tst_QNetworkReply::proxyChange() manager.setProxy(dummyProxy); QNetworkReplyPtr reply1 = manager.get(req); - QSignalSpy finishedspy(reply1, SIGNAL(finished())); + connect(reply1, SIGNAL(finished()), &helper, SLOT(finishedSlot())); manager.setProxy(QNetworkProxy()); QNetworkReplyPtr reply2 = manager.get(req); + connect(reply2, SIGNAL(finished()), &helper, SLOT(finishedSlot())); - connect(reply2, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); -#ifdef Q_OS_SYMBIAN - // we need more time as: - // 1. running from the emulator - // 2. not perfect POSIX implementation - // 3. embedded device QTestEventLoop::instance().enterLoop(20); -#else - QTestEventLoop::instance().enterLoop(10); -#endif QVERIFY(!QTestEventLoop::instance().timeout()); - if (finishedspy.count() == 0) { - // wait for the second reply as well - connect(reply1, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); - QTestEventLoop::instance().enterLoop(1); - QVERIFY(!QTestEventLoop::instance().timeout()); - } - // verify that the replies succeeded QCOMPARE(reply1->error(), QNetworkReply::NoError); QCOMPARE(reply1->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(), 200); |