[PATCH] msvcr120/tests: wcstof() depends on the system locale.

Francois Gouget fgouget at codeweavers.com
Tue Jun 29 02:11:03 CDT 2021


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>
---
 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");
 }
-- 
2.20.1




More information about the wine-devel mailing list