aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2016-07-13 08:55:38 +0200
committerMontel Laurent <[email protected]>2016-07-13 08:55:38 +0200
commit2d0106b6db3a552d10249c9eb64e83c54a81594e (patch)
treea4bd7d276d5cf978cd0a3179d9c5c0f3269d2da5
parent4aba637f6b8f20c862c5e293b71d37cca6256a51 (diff)
Fix autotest even if lang is not "C"
-rw-r--r--autotests/addresstest.cpp8
-rw-r--r--autotests/phonenumbertest.cpp8
2 files changed, 15 insertions, 1 deletions
diff --git a/autotests/addresstest.cpp b/autotests/addresstest.cpp
index 6d7b1b0..0504f77 100644
--- a/autotests/addresstest.cpp
+++ b/autotests/addresstest.cpp
@@ -29,10 +29,16 @@
#include <QFileInfo>
QTEST_MAIN(AddressTest)
+#ifndef Q_OS_WIN
+void initLocale()
+{
+ setenv("LC_ALL", "en_US.utf-8", 1);
+}
+Q_CONSTRUCTOR_FUNCTION(initLocale)
+#endif
void AddressTest::initTestCase()
{
- setenv("LANG", "C", 1);
}
void AddressTest::emptyTest()
diff --git a/autotests/phonenumbertest.cpp b/autotests/phonenumbertest.cpp
index fead9b1..b149bb7 100644
--- a/autotests/phonenumbertest.cpp
+++ b/autotests/phonenumbertest.cpp
@@ -24,6 +24,14 @@
QTEST_MAIN(PhoneNumberTest)
+#ifndef Q_OS_WIN
+void initLocale()
+{
+ setenv("LC_ALL", "en_US.utf-8", 1);
+}
+Q_CONSTRUCTOR_FUNCTION(initLocale)
+#endif
+
void PhoneNumberTest::emptyTest()
{
KContacts::PhoneNumber number;