diff options
Diffstat (limited to 'tests/auto/network-settings.h')
-rw-r--r-- | tests/auto/network-settings.h | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/tests/auto/network-settings.h b/tests/auto/network-settings.h index f162c3ae9f..092830a51a 100644 --- a/tests/auto/network-settings.h +++ b/tests/auto/network-settings.h @@ -72,15 +72,20 @@ public: } #ifdef QT_NETWORK_LIB - static QHostAddress serverIP() + static QHostAddress getServerIpImpl(const QString &serverName) { - const QHostInfo info = QHostInfo::fromName(serverName()); + const QHostInfo info = QHostInfo::fromName(serverName); if (info.error()) { QTest::qFail(qPrintable(info.errorString()), __FILE__, __LINE__); return QHostAddress(); } return info.addresses().constFirst(); } + + static QHostAddress serverIP() + { + return getServerIpImpl(serverName()); + } #endif static bool compareReplyIMAP(QByteArray const& actual) @@ -214,4 +219,19 @@ public: return serverName(); #endif } + static QString imapServerName() + { +#ifdef QT_TEST_SERVER_NAME + return QString("cyrus.") % serverDomainName(); +#else + return serverName(); +#endif + } + +#ifdef QT_NETWORK_LIB + static QHostAddress imapServerIp() + { + return getServerIpImpl(imapServerName()); + } +#endif }; |