summaryrefslogtreecommitdiff
path: root/tests/auto/xmlpatterns/tst_xmlpatterns.cpp
diff options
context:
space:
mode:
authorJason McDonald <jason.mcdonald@nokia.com>2011-11-28 16:43:55 +1000
committerQt by Nokia <qt-info@nokia.com>2011-11-30 00:56:40 +0100
commit3857e14daf3787eb73a5c77e70b279d18764409f (patch)
treed526155886efd05ce605a38c9e68eef93cfcc704 /tests/auto/xmlpatterns/tst_xmlpatterns.cpp
parent762b52ccd0db719a53f79944a0f3b5120118eba2 (diff)
downloadqtxmlpatterns-3857e14daf3787eb73a5c77e70b279d18764409f.tar.gz
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: I1ae004cf7a10a02d34d7ec517ef5515eb722aecf Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Diffstat (limited to 'tests/auto/xmlpatterns/tst_xmlpatterns.cpp')
-rw-r--r--tests/auto/xmlpatterns/tst_xmlpatterns.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/auto/xmlpatterns/tst_xmlpatterns.cpp b/tests/auto/xmlpatterns/tst_xmlpatterns.cpp
index adb8111..d8559dc 100644
--- a/tests/auto/xmlpatterns/tst_xmlpatterns.cpp
+++ b/tests/auto/xmlpatterns/tst_xmlpatterns.cpp
@@ -108,6 +108,8 @@ tst_XmlPatterns::tst_XmlPatterns() : m_generatedTests(0)
void tst_XmlPatterns::initTestCase()
{
+ QVERIFY(QtNetworkSettings::verifyTestNetworkSettings());
+
QVERIFY(m_normalizeTestName.isValid());
QVERIFY(m_filenameInStderr.isValid());