Akihiro Sagawa : msvcrt/tests: Restore the multibyte codepage after the tests.

Alexandre Julliard julliard at winehq.org
Mon Sep 2 14:50:19 CDT 2019


Module: wine
Branch: master
Commit: 996cb72c8e654d2421fcdc7ca70651f68d2f7db5
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=996cb72c8e654d2421fcdc7ca70651f68d2f7db5

Author: Akihiro Sagawa <sagawa.aki at gmail.com>
Date:   Mon Sep  2 19:50:12 2019 +0200

msvcrt/tests: Restore the multibyte codepage after the tests.

N.B. _setmbcp() doesn't return the previous codepage.

Signed-off-by: Akihiro Sagawa <sagawa.aki at gmail.com>
Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/msvcrt/tests/string.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/dlls/msvcrt/tests/string.c b/dlls/msvcrt/tests/string.c
index 59f9e1d..53e76f1 100644
--- a/dlls/msvcrt/tests/string.c
+++ b/dlls/msvcrt/tests/string.c
@@ -2707,7 +2707,7 @@ static void test__ultoa_s(void)
 
 static void test_wctob(void)
 {
-    int ret;
+    int ret, cp = _getmbcp();
 
     if(!p_wctob || !setlocale(LC_ALL, "chinese-traditional")) {
         win_skip("Skipping wctob tests\n");
@@ -2739,7 +2739,10 @@ static void test_wctob(void)
 
     ret = p_wctob(0xe0);
     ok(ret == (int)(char)0xe0, "ret = %x\n", ret);
+
+    _setmbcp(cp);
 }
+
 static void test_wctomb(void)
 {
     mbstate_t state;
@@ -3337,7 +3340,7 @@ static void test__mbscmp(void)
 
 static void test__ismbclx(void)
 {
-    int cp, ret;
+    int ret, cp = _getmbcp();
 
     ret = _ismbcl0(0);
     ok(!ret, "got %d\n", ret);
@@ -3348,7 +3351,7 @@ static void test__ismbclx(void)
     ret = _ismbcl2(0);
     ok(!ret, "got %d\n", ret);
 
-    cp = _setmbcp(1252);
+    _setmbcp(1252);
 
     ret = _ismbcl0(0x8140);
     ok(!ret, "got %d\n", ret);




More information about the wine-cvs mailing list