test: Don't fail if the network test server is not set up

Not having access to a network test server is not a failure per se
but rather an enviromental condition not met at run-time.

Change-Id: Ie7d10ca5fbf2df45fb1fd1ac19718c9fae855c03
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
bb10
Sergio Ahumada 2012-10-22 12:17:48 +02:00 committed by The Qt Project
parent ed19c0875e
commit 704a4e4747
6 changed files with 12 additions and 6 deletions

View File

@ -138,7 +138,8 @@ Q_DECLARE_METATYPE(QNetworkRequest::CacheLoadControl)
void tst_QAbstractNetworkCache::initTestCase()
{
QVERIFY(QtNetworkSettings::verifyTestNetworkSettings());
if (!QtNetworkSettings::verifyTestNetworkSettings())
QSKIP("No network test server available");
#ifndef QT_NO_BEARERMANAGEMENT
netConfMan = new QNetworkConfigurationManager(this);
networkConfiguration = netConfMan->defaultConfiguration();

View File

@ -87,7 +87,8 @@ tst_QNetworkInterface::~tst_QNetworkInterface()
void tst_QNetworkInterface::initTestCase()
{
QVERIFY(QtNetworkSettings::verifyTestNetworkSettings());
if (!QtNetworkSettings::verifyTestNetworkSettings())
QSKIP("No network test server available");
#ifndef QT_NO_BEARERMANAGEMENT
netConfMan = new QNetworkConfigurationManager(this);
networkConfiguration = netConfMan->defaultConfiguration();

View File

@ -167,7 +167,8 @@ void tst_QTcpServer::initTestCase_data()
void tst_QTcpServer::initTestCase()
{
QVERIFY(QtNetworkSettings::verifyTestNetworkSettings());
if (!QtNetworkSettings::verifyTestNetworkSettings())
QSKIP("No network test server available");
#ifndef QT_NO_BEARERMANAGEMENT
QNetworkConfigurationManager man;
networkSession = new QNetworkSession(man.defaultConfiguration(), this);

View File

@ -166,7 +166,8 @@ void tst_QUdpSocket::initTestCase_data()
void tst_QUdpSocket::initTestCase()
{
QVERIFY(QtNetworkSettings::verifyTestNetworkSettings());
if (!QtNetworkSettings::verifyTestNetworkSettings())
QSKIP("No network test server available");
}
void tst_QUdpSocket::init()

View File

@ -362,7 +362,8 @@ QHostAddress tst_NetworkSelfTest::serverIpAddress()
void tst_NetworkSelfTest::initTestCase()
{
QVERIFY(QtNetworkSettings::verifyTestNetworkSettings());
if (!QtNetworkSettings::verifyTestNetworkSettings())
QSKIP("No network test server available");
#ifndef QT_NO_BEARERMANAGEMENT
netConfMan = new QNetworkConfigurationManager(this);
networkConfiguration = netConfMan->defaultConfiguration();

View File

@ -128,7 +128,8 @@ tst_QNetworkAccessManager_And_QProgressDialog::tst_QNetworkAccessManager_And_QPr
void tst_QNetworkAccessManager_And_QProgressDialog::initTestCase()
{
QVERIFY(QtNetworkSettings::verifyTestNetworkSettings());
if (!QtNetworkSettings::verifyTestNetworkSettings())
QSKIP("No network test server available");
}
void tst_QNetworkAccessManager_And_QProgressDialog::downloadCheck_data()