Make QLocale autotest pass for shadow builds.

For shadow builds where "make install" had not been run, the
tst_QLocale::emptyCtor test function would fail to find its helper
application because QFINDTESTDATA was not searching for it in the build
directory due to the test not instantiating QCoreApplication.

This commit fixes the test by instantiating a QCoreApplication using the
QTEST_MAIN macro, which also allows some special case code for Windows
CE to be removed.

Change-Id: Ic81d4699da2538c24b36b3d6bd52c4a02ad417f4
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
bb10
Jason McDonald 2012-02-20 11:39:31 +10:00 committed by Qt by Nokia
parent eb52d78e90
commit 7fbe7fd7b5
1 changed files with 1 additions and 7 deletions

View File

@ -59,7 +59,6 @@
#endif
#ifdef Q_OS_WINCE
#include <qcoreapplication.h>
#include <windows.h> // needed for GetUserDefaultLCID
#define _control87 _controlfp
extern "C" DWORD GetThreadLocale(void) {
@ -141,11 +140,6 @@ tst_QLocale::tst_QLocale()
void tst_QLocale::ctor()
{
#ifdef Q_OS_WINCE
int argc = 1;
char argv[20] = "tst_qlocale.exe";
QCoreApplication app(argc, (char**)&argv);
#endif
QLocale default_locale = QLocale::system();
QLocale::Language default_lang = default_locale.language();
QLocale::Country default_country = default_locale.country();
@ -1988,5 +1982,5 @@ void tst_QLocale::listPatterns()
QCOMPARE(zh_CN.createSeparatedList(sl5), QString::fromUtf8("aaa" "\xe3\x80\x81" "bbb" "\xe3\x80\x81" "ccc" "\xe5\x92\x8c" "ddd"));
}
QTEST_APPLESS_MAIN(tst_QLocale)
QTEST_MAIN(tst_QLocale)
#include "tst_qlocale.moc"