summaryrefslogtreecommitdiffstats
path: root/tests/auto/network-settings.h
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/network-settings.h')
-rw-r--r--tests/auto/network-settings.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/tests/auto/network-settings.h b/tests/auto/network-settings.h
index 1281d74..059d7b8 100644
--- a/tests/auto/network-settings.h
+++ b/tests/auto/network-settings.h
@@ -46,6 +46,7 @@
#ifdef Q_OS_SYMBIAN
+#include <e32base.h>
#include <sys/socket.h>
#include <net/if.h>
#include <QSharedPointer>
@@ -333,13 +334,31 @@ QByteArray QtNetworkSettings::imapExpectedReplySsl;
class QtNetworkSettingsInitializerCode {
public:
QtNetworkSettingsInitializerCode() {
+#ifdef Q_OS_SYMBIAN
+ // We have a non-trivial constructor in global static.
+ // The QtNetworkSettings::serverName() uses native API which assumes
+ // Cleanup-stack to exist. That's why we create it here and install
+ // top level TRAP harness.
+ CTrapCleanup *cleanupStack = q_check_ptr(CTrapCleanup::New());
+ TRAPD(err,
+ QHostInfo testServerResult = QHostInfo::fromName(QtNetworkSettings::serverName());
+ if (testServerResult.error() != QHostInfo::NoError) {
+ qWarning() << "Could not lookup" << QtNetworkSettings::serverName();
+ qWarning() << "Please configure the test environment!";
+ qWarning() << "See /etc/hosts or network-settings.h";
+ qFatal("Exiting");
+ }
+ )
+ delete cleanupStack;
+#else
QHostInfo testServerResult = QHostInfo::fromName(QtNetworkSettings::serverName());
if (testServerResult.error() != QHostInfo::NoError) {
qWarning() << "Could not lookup" << QtNetworkSettings::serverName();
qWarning() << "Please configure the test environment!";
qWarning() << "See /etc/hosts or network-settings.h";
qFatal("Exiting");
- }
+ }
+#endif
}
};
QtNetworkSettingsInitializerCode qtNetworkSettingsInitializer;