summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShane Kearns <shane.kearns@accenture.com>2011-06-08 14:01:33 (GMT)
committerShane Kearns <shane.kearns@accenture.com>2011-06-08 14:10:04 (GMT)
commitf2bfd1f7913e21f8946ea9aa2f96ee4e38a942eb (patch)
treee2d6e68b05a5ba9f899fa9e1c32d92308da96a76
parent437aa330b9ce7934200592fef0227997fbbe17b5 (diff)
downloadQt-f2bfd1f7913e21f8946ea9aa2f96ee4e38a942eb.zip
Qt-f2bfd1f7913e21f8946ea9aa2f96ee4e38a942eb.tar.gz
Qt-f2bfd1f7913e21f8946ea9aa2f96ee4e38a942eb.tar.bz2
Fix errors in qsocketnotifier test
Fixed the posixSockets test on linux Skipped the bogusFds test everywhere but symbian, as there is no behavioural consistency of QSocketNotifier with invalid fds between different OS. Reviewed-By: mread
-rw-r--r--tests/auto/qsocketnotifier/tst_qsocketnotifier.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/auto/qsocketnotifier/tst_qsocketnotifier.cpp b/tests/auto/qsocketnotifier/tst_qsocketnotifier.cpp
index 550cef9..eb9a260 100644
--- a/tests/auto/qsocketnotifier/tst_qsocketnotifier.cpp
+++ b/tests/auto/qsocketnotifier/tst_qsocketnotifier.cpp
@@ -57,7 +57,7 @@
#include <private/qnet_unix_p.h>
#endif
#include <limits>
-#include <select.h>
+#include <sys/select.h>
class tst_QSocketNotifier : public QObject
{
@@ -180,7 +180,7 @@ void tst_QSocketNotifier::unexpectedDisconnection()
// we have to wait until sequence value changes
// as any event can make us jump out processing
QCoreApplication::processEvents(QEventLoop::WaitForMoreEvents);
- QVERIFY(timer.isActive); //escape if test would hang
+ QVERIFY(timer.isActive()); //escape if test would hang
} while(tester.sequence <= 0);
QVERIFY(readEnd1.state() == QAbstractSocket::ConnectedState);
@@ -294,7 +294,7 @@ void tst_QSocketNotifier::posixSockets()
QTestEventLoop::instance().enterLoop(3);
QCOMPARE(readSpy.count(), 1);
- QCOMPARE(writeSpy.count(), 0);
+ writeSpy.clear(); //depending on OS, write notifier triggers on creation or not.
QCOMPARE(errorSpy.count(), 0);
char buffer[100];
@@ -315,18 +315,17 @@ void tst_QSocketNotifier::posixSockets()
void tst_QSocketNotifier::bogusFds()
{
-#ifndef Q_OS_WIN
+#ifndef Q_OS_SYMBIAN
+ //behaviour of QSocketNotifier with an invalid fd is totally different across OS
+ //main point of this test was to check symbian backend doesn't crash
+ QSKIP("test only for symbian", SkipAll);
+#else
QTest::ignoreMessage(QtWarningMsg, "QSocketNotifier: Internal error");
-#endif
QSocketNotifier max(std::numeric_limits<int>::max(), QSocketNotifier::Read);
QTest::ignoreMessage(QtWarningMsg, "QSocketNotifier: Invalid socket specified");
-#ifndef Q_OS_WIN
QTest::ignoreMessage(QtWarningMsg, "QSocketNotifier: Internal error");
-#endif
QSocketNotifier min(std::numeric_limits<int>::min(), QSocketNotifier::Write);
-#ifndef Q_OS_WIN
QTest::ignoreMessage(QtWarningMsg, "QSocketNotifier: Internal error");
-#endif
//bogus magic number is the first pseudo socket descriptor from symbian socket engine.
QSocketNotifier bogus(0x40000000, QSocketNotifier::Exception);
QSocketNotifier largestlegal(FD_SETSIZE - 1, QSocketNotifier::Read);
@@ -350,6 +349,7 @@ void tst_QSocketNotifier::bogusFds()
QCOMPARE(minspy.count(), 0);
QCOMPARE(bogspy.count(), 0);
QCOMPARE(llspy.count(), 0);
+#endif
}
QTEST_MAIN(tst_QSocketNotifier)