qt5base-lts/tests/auto/corelib/io
Jason McDonald e15548d3e4 Fix sanity check of network test server
Some of Qt's autotests depend on access to a test server.  For each test
that used the test server, tests/auto/network-settings.h created a
global object to verify at startup that host lookups to the test server
will succeed (and abort the test otherwise).

There are two problems with that approach:

First, the sanity check happens before main(), and thus before the test
framework has started logging test results.  This means that if the
sanity check aborts the test, the failure message will not be visible in
the test output if logging to a file or will cause the output to be
malformed if logging to the console in XML format.

Second, since Qt 4.7, the host lookup uses a class that connects to the
QCoreApplication instance, which doesn't exist before main(), and this
caused all tests that included network-settings.h to output an error
message from QObject::connect() at the beginning of the test.

Both of these problems are solved by removing the global object from
network-settings.h and instead performing the sanity check in the
initTestCase() function of each test.

Task-number: QTBUG-22876
Change-Id: Id49c1826906327bf571686cc11527f0265e5af44
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-11-28 08:13:41 +01:00
..
qabstractfileengine Cleanup corelib autotests 2011-11-11 02:45:05 +01:00
qbuffer Improve QBuffer autotest. 2011-11-18 04:51:09 +01:00
qdatastream Remove obsolete comment from QDataStream test. 2011-11-18 04:51:09 +01:00
qdebug Cleanup corelib autotests 2011-11-11 02:45:05 +01:00
qdir Correct usage of network-settings.h. 2011-11-28 08:13:41 +01:00
qdiriterator Cleanup corelib autotests 2011-11-25 07:56:16 +01:00
qfile Correct usage of network-settings.h. 2011-11-28 08:13:41 +01:00
qfileinfo Correct usage of network-settings.h. 2011-11-28 08:13:41 +01:00
qfilesystementry Cleanup corelib autotests 2011-11-11 02:45:05 +01:00
qfilesystemwatcher Cleanup corelib autotests 2011-11-25 07:56:16 +01:00
qiodevice Fix sanity check of network test server 2011-11-28 08:13:41 +01:00
qprocess Remove misleading comment. 2011-11-23 07:06:24 +01:00
qprocessenvironment Don't depend on moc to disable test functions. 2011-11-18 01:51:57 +01:00
qresourceengine Cleanup corelib autotests 2011-11-14 07:33:57 +01:00
qsettings Cleanup corelib autotests 2011-11-25 07:56:16 +01:00
qstandardpaths Cleanup corelib autotests 2011-11-14 07:33:57 +01:00
qtemporaryfile Cleanup corelib autotests 2011-11-11 02:45:05 +01:00
qtextstream Fix sanity check of network test server 2011-11-28 08:13:41 +01:00
qurl Cleanup corelib autotests 2011-11-25 07:56:16 +01:00
io.pro QStandardPaths: add Config and GenericData, add methods 2011-10-23 00:56:39 +02:00