From: Janne Anttila Date: Tue, 19 Jun 2012 08:19:28 +0000 (+0300) Subject: Fix qstringlist autotest build for WinCE. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bf05abddfd542a0568138d533d1f401d32b65e8c;p=profile%2Fivi%2Fqtbase.git Fix qstringlist autotest build for WinCE. WinCE does not have setlocale, used SetUserDefaultLCID correspondingly as it is done in qstring autotest for WEC7. Change-Id: I7866bf0f365c7c6efbf3b439cdd9a281c6a1b2e0 Reviewed-by: Kevin Funk Reviewed-by: Andreas Holzammer Reviewed-by: Friedemann Kleint --- diff --git a/tests/auto/corelib/tools/qstringlist/tst_qstringlist.cpp b/tests/auto/corelib/tools/qstringlist/tst_qstringlist.cpp index 4763f11..2c4ec62 100644 --- a/tests/auto/corelib/tools/qstringlist/tst_qstringlist.cpp +++ b/tests/auto/corelib/tools/qstringlist/tst_qstringlist.cpp @@ -45,6 +45,9 @@ #include #include +#ifdef Q_OS_WINCE +#include // needed for GetUserDefaultLCID +#endif class tst_QStringList : public QObject { @@ -212,13 +215,23 @@ void tst_QStringList::sort() list2 << "BETA" << "Gamma" << "alpha" << "beta" << "epsilon" << "gAmma" << "gamma"; QCOMPARE( list1, list2 ); +#ifdef Q_OS_WINCE + DWORD oldLcid = GetUserDefaultLCID(); + // Assume c locale to be english + SetUserDefaultLCID(MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT)); +#else char *current_locale = setlocale(LC_ALL, "C"); +#endif QStringList list3, list4; list3 << "alpha" << "beta" << "BETA" << "gamma" << "Gamma" << "gAmma" << "epsilon"; list3.sort(Qt::CaseInsensitive); list4 << "alpha" << "beta" << "BETA" << "epsilon" << "Gamma" << "gAmma" << "gamma"; QCOMPARE( list3, list4 ); +#ifdef Q_OS_WINCE + SetUserDefaultLCID(oldLcid); +#else setlocale(LC_ALL, current_locale); +#endif } void tst_QStringList::replaceInStrings()