tst_qlocale::macDefaultLocale - remove flaky/incorrect test

currencySymbol == "$" does not mean negative currency values will be formatted
as "($value)". With all locales I have on my mac machines (10.11/10.12) the
result is different from what this test expects. Also, the results are very
different for different locales.  Apparently, we never saw this problem before
since in our CI "macs" we never have US Dollar/en_US selected in System Preferences.

Task-number: QTBUG-58784
Change-Id: Ic2c3a3172bf1e715e99092ddee8f461b216d995a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This commit is contained in:
Timur Pocheptsov 2017-02-13 15:45:00 +01:00 committed by Liang Qi
parent 0b30a6e6aa
commit 5542e772d6

View File

@ -1589,9 +1589,7 @@ void tst_QLocale::macDefaultLocale()
// To run this test make sure "Curreny" is US Dollar in System Preferences->Language & Region->Advanced.
if (locale.currencySymbol() == QString("$")) {
QCOMPARE(locale.toCurrencyString(qulonglong(1234)), systemLocaleFormatNumber(QString("$1,234.00")));
QCOMPARE(locale.toCurrencyString(qlonglong(-1234)), systemLocaleFormatNumber(QString("($1,234.00)")));
QCOMPARE(locale.toCurrencyString(double(1234.56)), systemLocaleFormatNumber(QString("$1,234.56")));
QCOMPARE(locale.toCurrencyString(double(-1234.56)), systemLocaleFormatNumber(QString("($1,234.56)")));
}
// Depending on the configured time zone, the time string might not