Akihiro Sagawa : kernel32/tests: Add more LCMapString tests.

Alexandre Julliard julliard at winehq.org
Thu Sep 13 03:49:16 CDT 2018


Module: wine
Branch: stable
Commit: f33783ce5f20c4ae8c3cb579367e6fe81e6d92b2
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=f33783ce5f20c4ae8c3cb579367e6fe81e6d92b2

Author: Akihiro Sagawa <sagawa.aki at gmail.com>
Date:   Thu Jul 12 23:30:28 2018 +0900

kernel32/tests: Add more LCMapString tests.

Especially combined with LCMAP_HALFWIDTH and LCMAP_UPPERCASE.

Signed-off-by: Akihiro Sagawa <sagawa.aki at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit ef2df8ed3681a55a66382164227f8a5a1ae4bf51)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>

---

 dlls/kernel32/tests/locale.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/dlls/kernel32/tests/locale.c b/dlls/kernel32/tests/locale.c
index d686e12..dea22df 100644
--- a/dlls/kernel32/tests/locale.c
+++ b/dlls/kernel32/tests/locale.c
@@ -2519,6 +2519,27 @@ static void test_lcmapstring_unicode(lcmapstring_wrapper func_ptr, const char *f
     ok(!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER,
        "%s should return 0 and ERROR_INSUFFICIENT_BUFFER, got %d\n", func_name, ret);
 
+    buf[0] = 'a';
+    buf[1] = 0x30ac;
+    ret = func_ptr(LCMAP_HALFWIDTH | LCMAP_UPPERCASE, buf, 2, buf2, 0);
+    ok(ret == 3, "%s ret %d, expected value 3\n", func_name, ret);
+
+    SetLastError(0xdeadbeef);
+    ret = func_ptr(LCMAP_HALFWIDTH | LCMAP_UPPERCASE, buf, 2, buf2, 1);
+    todo_wine ok(!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER,
+       "%s should return 0 and ERROR_INSUFFICIENT_BUFFER, got %d\n", func_name, ret);
+
+    SetLastError(0xdeadbeef);
+    ret = func_ptr(LCMAP_HALFWIDTH | LCMAP_UPPERCASE, buf, 2, buf2, 2);
+    ok(!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER,
+       "%s should return 0 and ERROR_INSUFFICIENT_BUFFER, got %d\n", func_name, ret);
+
+    ret = func_ptr(LCMAP_HALFWIDTH | LCMAP_UPPERCASE, buf, 2, buf2, 3);
+    todo_wine ok(ret == 3, "%s ret %d, expected value 3\n", func_name, ret);
+
+    ret = func_ptr(LCMAP_HALFWIDTH | LCMAP_UPPERCASE, buf, 2, buf2, 4);
+    ok(ret == 3, "%s ret %d, expected value 3\n", func_name, ret);
+
     /* LCMAP_UPPERCASE or LCMAP_LOWERCASE should accept src == dst */
     lstrcpyW(buf, lower_case);
     ret = func_ptr(LCMAP_UPPERCASE,




More information about the wine-cvs mailing list