From: Jactry Zeng Subject: [PATCH 3/4] riched20/tests: Add UTF8 BOM tests for EM_SETTEXTEX. (try 4) Message-Id: <5229ABC2.80600@gmail.com> Date: Fri, 06 Sep 2013 18:17:38 +0800 From 79342ece3170647982ccf7f521f8a905a1a57f43 Mon Sep 17 00:00:00 2001 From: Jactry Zeng Date: Fri, 6 Sep 2013 11:01:31 +0800 Subject: [PATCH 3/4] riched20/tests: Add UTF8 BOM tests for EM_SETTEXTEX. To: wine-patches Reply-To: wine-devel --- dlls/riched20/tests/editor.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/dlls/riched20/tests/editor.c b/dlls/riched20/tests/editor.c index fed9b95..15e1132 100644 --- a/dlls/riched20/tests/editor.c +++ b/dlls/riched20/tests/editor.c @@ -3913,6 +3913,23 @@ static void test_EM_SETTEXTEX(void) SendMessage(hwndRichEdit, EM_GETTEXTEX, (WPARAM)&getText, (LPARAM) bufACP); ok(!strcmp(bufACP, "morerichtext"), "expected 'morerichtext' but got '%s'\n", bufACP); + /* test for utf8 text with BOM */ + setText.flags = 0; + setText.codepage = CP_ACP; + SendMessage(hwndRichEdit, EM_SETTEXTEX, (WPARAM)&setText, (LPARAM)"\xef\xbb\xbfTestUTF8WithBOM"); + result = SendMessage(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM)bufACP); + todo_wine ok(result == 15, "EM_SETTEXTEX: Test UTF8 with BOM returned %d, expected 15\n", result); + result = strcmp(bufACP, "TestUTF8WithBOM"); + todo_wine ok(result == 0, "EM_SETTEXTEX: Test UTF8 with BOM set wrong text: Result: %s\n", bufACP); + + setText.flags = 0; + setText.codepage = CP_UTF8; + SendMessage(hwndRichEdit, EM_SETTEXTEX, (WPARAM)&setText, (LPARAM)"\xef\xbb\xbfTestUTF8WithBOM"); + result = SendMessage(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM)bufACP); + todo_wine ok(result == 15, "EM_SETTEXTEX: Test UTF8 with BOM returned %d, expected 15\n", result); + result = strcmp(bufACP, "TestUTF8WithBOM"); + todo_wine ok(result == 0, "EM_SETTEXTEX: Test UTF8 with BOM set wrong text: Result: %s\n", bufACP); + DestroyWindow(hwndRichEdit); } -- 1.7.10.4