Enable qfile tests for platforms without network

Currently network is only required to gather the host info for one
test case. That does not justify to disable all other tests, which can
provide useful information on the state when doing a port. Hence
disable that testcase if no network is available.

Change-Id: I202ef49b3e07ae69ec85ee0432ae0a771a90e816
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
This commit is contained in:
Maurice Kalinowski 2013-11-11 15:37:49 +01:00 committed by The Qt Project
parent 459fb11481
commit 0de8370531
3 changed files with 6 additions and 4 deletions

View File

@ -43,7 +43,6 @@ SUBDIRS=\
qsettings
!qtHaveModule(network): SUBDIRS -= \
qfile \
qiodevice \
qprocess \
qtextstream

View File

@ -1,7 +1,10 @@
CONFIG += testcase
CONFIG += parallel_test
CONFIG -= app_bundle debug_and_release_target
QT = core-private core network testlib
QT = core-private core testlib
qtHaveModule(network): QT += network
else: DEFINES += QT_NO_NETWORK
TARGET = ../tst_qfile
SOURCES = ../tst_qfile.cpp
wince*: SOURCES += $$QT_SOURCE_TREE/src/corelib/kernel/qfunctions_wince.cpp

View File

@ -59,7 +59,7 @@ extern Q_CORE_EXPORT int qt_ntfs_permission_lookup;
QT_END_NAMESPACE
#endif
#if !defined(Q_OS_WINCE)
#if !defined(Q_OS_WINCE) && !defined(QT_NO_NETWORK)
#include <QHostInfo>
#endif
#include <QProcess>
@ -2245,7 +2245,7 @@ void tst_QFile::writeLargeDataBlock_data()
QTest::newRow("localfile-Fd") << "./largeblockfile.txt" << (int)OpenFd;
QTest::newRow("localfile-Stream") << "./largeblockfile.txt" << (int)OpenStream;
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(QT_NO_NETWORK)
// Some semi-randomness to avoid collisions.
QTest::newRow("unc file")
<< QString("//" + QtNetworkSettings::winServerName() + "/TESTSHAREWRITABLE/largefile-%1-%2.txt")