summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/text/qlocale/tst_qlocale.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/corelib/text/qlocale/tst_qlocale.cpp')
-rw-r--r--tests/auto/corelib/text/qlocale/tst_qlocale.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/tests/auto/corelib/text/qlocale/tst_qlocale.cpp b/tests/auto/corelib/text/qlocale/tst_qlocale.cpp
index 2dd4620718..010dfddd01 100644
--- a/tests/auto/corelib/text/qlocale/tst_qlocale.cpp
+++ b/tests/auto/corelib/text/qlocale/tst_qlocale.cpp
@@ -1443,9 +1443,14 @@ void tst_QLocale::fpExceptions()
// check that double-to-string conversion doesn't throw floating point exceptions when they are
// enabled
#ifdef Q_OS_WIN
- _clear87();
- unsigned int oldbits = _control87(0, 0);
- _control87( 0 | _EM_INEXACT, _MCW_EM );
+# ifndef _MCW_EM
+# define _MCW_EM 0x0008001F
+# endif
+# ifndef _EM_INEXACT
+# define _EM_INEXACT 0x00000001
+# endif
+ _clearfp();
+ unsigned int oldbits = _controlfp(0 | _EM_INEXACT, _MCW_EM);
#endif
#ifdef QT_USE_FENV
@@ -1462,8 +1467,8 @@ void tst_QLocale::fpExceptions()
QVERIFY(true);
#ifdef Q_OS_WIN
- _clear87();
- _control87(oldbits, 0xFFFFF);
+ _clearfp();
+ _controlfp(oldbits, _MCW_EM);
#endif
#ifdef QT_USE_FENV
@@ -2206,7 +2211,7 @@ void tst_QLocale::windowsDefaultLocale()
locale.toString(QDate(1974, 12, 1), QLocale::ShortFormat));
QCOMPARE(locale.toString(QDate(1974, 12, 1), QLocale::LongFormat),
QStringView(u"\u3021@\u3021\u3022@\u3021\u3029\u3027\u3024"));
- const QString expectedFormattedShortTime = QStringView(u"\u3021^\u3022").toString();
+ const QString expectedFormattedShortTime = QStringView(u"\u3021^\u3022^\u3023").toString();
QCOMPARE(locale.toString(QTime(1,2,3), QLocale::ShortFormat), expectedFormattedShortTime);
QCOMPARE(locale.toString(QTime(1,2,3), QLocale::NarrowFormat),
locale.toString(QTime(1,2,3), QLocale::ShortFormat));