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 <kevin.funk@kdab.com> Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>bb10
parent
5fe1574725
commit
bf05abddfd
|
|
@ -45,6 +45,9 @@
|
|||
#include <qstringlist.h>
|
||||
|
||||
#include <locale.h>
|
||||
#ifdef Q_OS_WINCE
|
||||
#include <windows.h> // 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()
|
||||
|
|
|
|||
Loading…
Reference in New Issue