Francois Gouget : msvcr120/tests: Wcstof() depends on the system locale.
Alexandre Julliard
julliard at winehq.org
Tue Jun 29 15:58:27 CDT 2021
Module: wine
Branch: master
Commit: 858f2bf268c380caea66cb83b834da15a328d10e
URL: https://source.winehq.org/git/wine.git/?a=commit;h=858f2bf268c380caea66cb83b834da15a328d10e
Author: Francois Gouget <fgouget at codeweavers.com>
Date: Tue Jun 29 09:11:03 2021 +0200
msvcr120/tests: Wcstof() depends on the system locale.
Arabic numerals are only recognized Arabic system locales.
Also test a mix of Arabic and Roman numerals.
Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/msvcr120/tests/msvcr120.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/dlls/msvcr120/tests/msvcr120.c b/dlls/msvcr120/tests/msvcr120.c
index e8002f6cb55..2a0e638be1b 100644
--- a/dlls/msvcr120/tests/msvcr120.c
+++ b/dlls/msvcr120/tests/msvcr120.c
@@ -601,6 +601,7 @@ static void test__strtof(void)
const char float3[] = "-3.402823466e+38";
const char float4[] = "1.7976931348623158e+308"; /* DBL_MAX */
+ BOOL is_arabic;
char *end;
float f;
@@ -638,8 +639,12 @@ static void test__strtof(void)
f = p_wcstof(L"12.0", NULL);
ok(f == 12.0, "f = %lf\n", f);
- f = p_wcstof(L"\x0662\x0663", NULL);
- ok(f == 0, "f = %lf\n", f);
+ f = p_wcstof(L"\x0662\x0663", NULL); /* 23 in Arabic numerals */
+ is_arabic = (PRIMARYLANGID(GetSystemDefaultLangID()) == LANG_ARABIC);
+ todo_wine_if(is_arabic) ok(f == (is_arabic ? 23.0 : 0.0), "f = %lf\n", f);
+
+ f = p_wcstof(L"\x0662\x34\x0663", NULL); /* Arabic + Roman numerals mix */
+ todo_wine_if(is_arabic) ok(f == (is_arabic ? 243.0 : 0.0), "f = %lf\n", f);
if(!p_setlocale(LC_ALL, "Arabic")) {
win_skip("Arabic locale not available\n");
@@ -649,8 +654,8 @@ static void test__strtof(void)
f = p_wcstof(L"12.0", NULL);
ok(f == 12.0, "f = %lf\n", f);
- f = p_wcstof(L"\x0662\x0663", NULL);
- ok(f == 0, "f = %lf\n", f);
+ f = p_wcstof(L"\x0662\x0663", NULL); /* 23 in Arabic numerals */
+ todo_wine_if(is_arabic) ok(f == (is_arabic ? 23.0 : 0.0), "f = %lf\n", f);
p_setlocale(LC_ALL, "C");
}
More information about the wine-cvs
mailing list