diff options
author | hjk <qtc-committer@nokia.com> | 2009-10-30 11:15:11 (GMT) |
---|---|---|
committer | hjk <qtc-committer@nokia.com> | 2009-10-30 11:15:11 (GMT) |
commit | 7c04935b278db196b3e67a6b501ec14d852acabd (patch) | |
tree | 2424c1a9c90757947cb13e67a4a61ad3473fdd7a /tests/auto/networkselftest/tst_networkselftest.cpp | |
parent | 1bed105d048531e3e260eff0ef2533d7cc8ba7fb (diff) | |
parent | 83fff2f970b9a7b41861336c7dca0eadbda28099 (diff) | |
download | Qt-7c04935b278db196b3e67a6b501ec14d852acabd.zip Qt-7c04935b278db196b3e67a6b501ec14d852acabd.tar.gz Qt-7c04935b278db196b3e67a6b501ec14d852acabd.tar.bz2 |
Merge commit 'mainline/4.6' into 4.6
Diffstat (limited to 'tests/auto/networkselftest/tst_networkselftest.cpp')
-rw-r--r-- | tests/auto/networkselftest/tst_networkselftest.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/auto/networkselftest/tst_networkselftest.cpp b/tests/auto/networkselftest/tst_networkselftest.cpp index d58402b..a09d998 100644 --- a/tests/auto/networkselftest/tst_networkselftest.cpp +++ b/tests/auto/networkselftest/tst_networkselftest.cpp @@ -333,6 +333,11 @@ QHostAddress tst_NetworkSelfTest::serverIpAddress() if (cachedIpAddress.protocol() == QAbstractSocket::UnknownNetworkLayerProtocol) { // need resolving QHostInfo resolved = QHostInfo::fromName(QtNetworkSettings::serverName()); + if(resolved.error() != QHostInfo::NoError || + !resolved.addresses().isEmpty()) { + qWarning("QHostInfo::fromName failed (%d).", resolved.error()); + return QHostAddress(QHostAddress::Null); + } cachedIpAddress = resolved.addresses().first(); } return cachedIpAddress; |