ReactOS 0.4.16-dev-755-g88f105e
editor.c File Reference
#include <stdarg.h>
#include <stdio.h>
#include <assert.h>
#include <windef.h>
#include <winbase.h>
#include <wingdi.h>
#include <winuser.h>
#include <winnls.h>
#include <ole2.h>
#include <richedit.h>
#include <richole.h>
#include <imm.h>
#include <textserv.h>
#include <commdlg.h>
#include <time.h>
#include <wine/test.h>
Include dependency graph for editor.c:

Go to the source code of this file.

Classes

struct  find_s
 
struct  getline_s
 
struct  exsetsel_s
 
struct  StringWithLength
 
struct  dialog_mode_messages
 

Macros

#define COBJMACROS
 
#define ID_RICHEDITTESTDBUTTON   0x123
 
#define ok_w3(format, szString1, szString2, szString3)
 
#define ITextServices_OnTxPropertyBitsChange(This, a, b)   (This)->lpVtbl->OnTxPropertyBitsChange(This,a,b)
 
#define ENABLE_WS_VSCROLL(hwnd)    SetWindowLongA(hwnd, GWL_STYLE, GetWindowLongA(hwnd, GWL_STYLE) | WS_VSCROLL)
 
#define DISABLE_WS_VSCROLL(hwnd)    SetWindowLongA(hwnd, GWL_STYLE, GetWindowLongA(hwnd, GWL_STYLE) & ~WS_VSCROLL)
 
#define TEST_SETTEXT(a, b)
 
#define TEST_SETTEXTW(a, b)
 
#define MAX_BUF_LEN   1024
 
#define set_textA(hwnd, wm_set_text, txt)
 
#define expect_textA(hwnd, wm_get_text, txt)
 
#define set_textW(hwnd, wm_set_text, txt)
 
#define expect_textW(hwnd, wm_get_text, txt)
 
#define expect_empty(hwnd, wm_get_text)
 
#define CURSOR_CLIENT_X   5
 
#define CURSOR_CLIENT_Y   5
 
#define WP_PARENT   1
 
#define WP_CHILD   2
 
#define test_dm_messages(wmclose, wmgetdefid, wmnextdlgctl)
 
#define TEST_EM_SETFONTSIZE(hwnd, size, expected_size, expected_res, expected_undo)    _test_font_size(__LINE__,hwnd,size,expected_size,expected_res,expected_undo)
 

Functions

static void disable_beep (HWND hwnd)
 
static HWND new_window (LPCSTR lpClassName, DWORD dwStyle, HWND parent)
 
static HWND new_windowW (LPCWSTR lpClassName, DWORD dwStyle, HWND parent)
 
static HWND new_richedit (HWND parent)
 
static HWND new_richedit_with_style (HWND parent, DWORD style)
 
static HWND new_richeditW (HWND parent)
 
static void keep_responsive (time_t delay_time)
 
static void simulate_typing_characters (HWND hwnd, const char *szChars)
 
static BOOL hold_key (int vk)
 
static BOOL release_key (int vk)
 
static WCHARatowstr (const char *str)
 
static void check_EM_FINDTEXT (HWND hwnd, const char *name, struct find_s *f, int id, BOOL unicode)
 
static void check_EM_FINDTEXTEX (HWND hwnd, const char *name, struct find_s *f, int id, BOOL unicode)
 
static void run_tests_EM_FINDTEXT (HWND hwnd, const char *name, struct find_s *find, int num_tests, BOOL unicode)
 
static void test_EM_FINDTEXT (BOOL unicode)
 
static void test_EM_GETLINE (void)
 
static void test_EM_LINELENGTH (void)
 
static int get_scroll_pos_y (HWND hwnd)
 
static void move_cursor (HWND hwnd, LONG charindex)
 
static void line_scroll (HWND hwnd, int amount)
 
static void test_EM_SCROLLCARET (void)
 
static void test_EM_POSFROMCHAR (void)
 
static void test_EM_SETCHARFORMAT (void)
 
static void test_EM_SETTEXTMODE (void)
 
static void test_SETPARAFORMAT (void)
 
static void test_TM_PLAINTEXT (void)
 
static void test_WM_GETTEXT (void)
 
static void test_EM_GETTEXTRANGE (void)
 
static void test_EM_GETSELTEXT (void)
 
static void test_EM_SETOPTIONS (void)
 
static BOOL check_CFE_LINK_selection (HWND hwnd, int sel_start, int sel_end)
 
static void check_CFE_LINK_rcvd (HWND hwnd, BOOL is_url, const char *url)
 
static HWND new_static_wnd (HWND parent)
 
static void test_EM_AUTOURLDETECT (void)
 
static void test_EM_SCROLL (void)
 
static LRESULT (WINAPI *richeditProc)(HWND hwnd
 
static LRESULT WINAPI RicheditStupidOverrideProcA (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
static void test_scrollbar_visibility (void)
 
static void test_EM_SETUNDOLIMIT (void)
 
static void test_ES_PASSWORD (void)
 
static DWORD CALLBACK test_WM_SETTEXT_esCallback (DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)
 
static void test_WM_SETTEXT (void)
 
static DWORD CALLBACK test_esCallback_written_1 (DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)
 
static int count_pars (const char *buf)
 
static void test_EM_STREAMOUT (void)
 
static void test_EM_STREAMOUT_FONTTBL (void)
 
static void test_EM_STREAMOUT_empty_para (void)
 
static void test_EM_SETTEXTEX (void)
 
static void test_EM_LIMITTEXT (void)
 
static void test_EM_EXLIMITTEXT (void)
 
static void test_EM_GETLIMITTEXT (void)
 
static void test_WM_SETFONT (void)
 
static DWORD CALLBACK test_EM_GETMODIFY_esCallback (DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)
 
static void test_EM_GETMODIFY (void)
 
static void check_EM_EXSETSEL (HWND hwnd, const struct exsetsel_s *setsel, int id)
 
static void test_EM_EXSETSEL (void)
 
static void check_EM_SETSEL (HWND hwnd, const struct exsetsel_s *setsel, int id)
 
static void test_EM_SETSEL (void)
 
static void test_EM_REPLACESEL (int redraw)
 
static LRESULT send_ctrl_key (HWND hwnd, UINT key)
 
static void test_WM_PASTE (void)
 
static void test_EM_FORMATRANGE (void)
 
static DWORD CALLBACK EditStreamCallback (DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)
 
static DWORD CALLBACK test_EM_STREAMIN_esCallback (DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)
 
static DWORD CALLBACK test_EM_STREAMIN_esCallback_UTF8Split (DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)
 
static DWORD CALLBACK test_EM_STREAMIN_null_bytes (DWORD_PTR cookie, BYTE *buf, LONG size, LONG *written)
 
static DWORD CALLBACK test_EM_STREAMIN_esCallback2 (DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)
 
static void test_EM_STREAMIN (void)
 
static void test_EM_StreamIn_Undo (void)
 
static BOOL is_em_settextex_supported (HWND hwnd)
 
static void test_unicode_conversions (void)
 
static void test_WM_CHAR (void)
 
static void test_EM_GETTEXTLENGTHEX (void)
 
static LRESULT WINAPI ParentMsgCheckProcA (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
static void test_eventMask (void)
 
static LRESULT WINAPI WM_NOTIFY_ParentMsgCheckProcA (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
static void test_WM_NOTIFY (void)
 
static LRESULT WINAPI EN_LINK_ParentMsgCheckProcA (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
static void link_notify_test (const char *desc, int i, HWND hwnd, HWND parent, UINT msg, WPARAM wParam, LPARAM lParam, BOOL notifies)
 
static void test_EN_LINK (void)
 
static void test_undo_coalescing (void)
 
static LONG CALLBACK customWordBreakProc (WCHAR *text, int pos, int bytes, int code)
 
static void test_word_movement (void)
 
static void test_EM_CHARFROMPOS (void)
 
static void test_word_wrap (void)
 
static void test_autoscroll (void)
 
static void test_format_rect (void)
 
static void test_WM_GETDLGCODE (void)
 
static void test_zoom (void)
 
static LRESULT CALLBACK dialog_mode_wnd_proc (HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
 
static void test_dialogmode (void)
 
static void test_EM_FINDWORDBREAK_W (void)
 
static void test_EM_FINDWORDBREAK_A (void)
 
static void format_test_result (char *target, const char *src)
 
static void test_enter (void)
 
static void test_WM_CREATE (void)
 
static void test_reset_default_para_fmt (void)
 
static void test_EM_SETREADONLY (void)
 
static LONG twips2points (LONG value)
 
static void _test_font_size (unsigned line, HWND hwnd, LONG size, LONG expected_size, LRESULT expected_res, BOOL expected_undo)
 
static void test_EM_SETFONTSIZE (void)
 
static void test_alignment_style (void)
 
static void test_WM_GETTEXTLENGTH (void)
 
static void test_rtf (void)
 
static void test_background (void)
 
static void test_eop_char_fmt (void)
 
static void test_para_numbering (void)
 
static void fill_reobject_struct (REOBJECT *reobj, LONG cp, LPOLEOBJECT poleobj, LPSTORAGE pstg, LPOLECLIENTSITE polesite, LONG sizel_cx, LONG sizel_cy, DWORD aspect, DWORD flags, DWORD user)
 
static void test_EM_SELECTIONTYPE (void)
 
static void test_window_classes (void)
 
 START_TEST (editor)
 

Variables

static CHAR string1 [MAX_PATH]
 
static CHAR string2 [MAX_PATH]
 
static CHAR string3 [MAX_PATH]
 
static HMODULE hmoduleRichEdit
 
static BOOL is_lang_japanese
 
static const char haystack [] = "WINEWine wineWine wine WineWine"
 
static struct find_s find_tests []
 
static struct find_s find_tests2 []
 
static const struct getline_s gl []
 
static unsigned int recursionLevel = 0
 
static unsigned int WM_SIZE_recursionLevel = 0
 
static BOOL bailedOutOfRecursion = FALSE
 
static UINT message
 
static UINT WPARAM wParam
 
static UINT WPARAM LPARAM lParam
 
LONG streamout_written = 0
 
static const struct exsetsel_s exsetsel_tests []
 
static int nCallbackCount = 0
 
static HWND eventMaskEditHwnd = 0
 
static int queriedEventMask
 
static int watchForEventMask = 0
 
static int received_WM_NOTIFY = 0
 
static int modify_at_WM_NOTIFY = 0
 
static BOOL filter_on_WM_NOTIFY = FALSE
 
static HWND hwndRichedit_WM_NOTIFY
 
static ENLINK enlink
 
static struct dialog_mode_messages dm_messages
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 23 of file editor.c.

◆ CURSOR_CLIENT_X

#define CURSOR_CLIENT_X   5

Definition at line 6764 of file editor.c.

◆ CURSOR_CLIENT_Y

#define CURSOR_CLIENT_Y   5

Definition at line 6765 of file editor.c.

◆ DISABLE_WS_VSCROLL

#define DISABLE_WS_VSCROLL (   hwnd)     SetWindowLongA(hwnd, GWL_STYLE, GetWindowLongA(hwnd, GWL_STYLE) & ~WS_VSCROLL)

◆ ENABLE_WS_VSCROLL

◆ expect_empty

#define expect_empty (   hwnd,
  wm_get_text 
)
Value:
do { \
GETTEXTEX gtex = { 64, GT_DEFAULT, CP_ACP, NULL, NULL }; \
WPARAM wparam = (wm_get_text == WM_GETTEXT) ? 64 : (WPARAM)&gtex; \
assert(wm_get_text == WM_GETTEXT || wm_get_text == EM_GETTEXTEX); \
memset(bufA, 0xAA, sizeof(bufA)); \
ret = SendMessageA(hwnd, wm_get_text, wparam, (LPARAM)bufA); \
ok(!ret, "empty richedit should return 0, got %d\n", ret); \
ok(!*bufA, "empty richedit should return empty string, got %s\n", bufA); \
} while(0)
@ wparam
Definition: SystemMenu.c:30
#define NULL
Definition: types.h:112
#define CP_ACP
Definition: compat.h:109
#define GT_DEFAULT
Definition: richedit.h:1036
#define EM_GETTEXTEX
Definition: richedit.h:128
int ret
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
LONG_PTR LPARAM
Definition: windef.h:208
UINT_PTR WPARAM
Definition: windef.h:207
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_GETTEXT
Definition: winuser.h:1621

◆ expect_textA

#define expect_textA (   hwnd,
  wm_get_text,
  txt 
)
Value:
do { \
GETTEXTEX gtex = { 64, GT_DEFAULT, CP_ACP, NULL, NULL }; \
WPARAM wparam = (wm_get_text == WM_GETTEXT) ? 64 : (WPARAM)&gtex; \
assert(wm_get_text == WM_GETTEXT || wm_get_text == EM_GETTEXTEX); \
memset(bufA, 0xAA, sizeof(bufA)); \
ret = SendMessageA(hwnd, wm_get_text, wparam, (LPARAM)bufA); \
ok(ret, "SendMessageA(%02x) error %u\n", wm_get_text, GetLastError()); \
ret = lstrcmpA(bufA, txt); \
ok(!ret, "%02x: strings do not match: expected %s got %s\n", wm_get_text, txt, bufA); \
} while(0)
int WINAPI lstrcmpA(LPCSTR str1, LPCSTR str2)
Definition: locale.c:4195
DWORD WINAPI GetLastError(void)
Definition: except.c:1042

◆ expect_textW

#define expect_textW (   hwnd,
  wm_get_text,
  txt 
)
Value:
do { \
GETTEXTEX gtex = { 64, GT_DEFAULT, 1200, NULL, NULL }; \
WPARAM wparam = (wm_get_text == WM_GETTEXT) ? 64 : (WPARAM)&gtex; \
assert(wm_get_text == WM_GETTEXT || wm_get_text == EM_GETTEXTEX); \
memset(bufW, 0xAA, sizeof(bufW)); \
ret = SendMessageW(hwnd, wm_get_text, wparam, (LPARAM)bufW); \
ok(ret, "SendMessageW(%02x) error %u\n", wm_get_text, GetLastError()); \
ret = lstrcmpW(bufW, txt); \
ok(!ret, "%02x: strings do not match: expected[0] %x got[0] %x\n", wm_get_text, txt[0], bufW[0]); \
} while(0)
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4243
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

◆ ID_RICHEDITTESTDBUTTON

#define ID_RICHEDITTESTDBUTTON   0x123

Definition at line 42 of file editor.c.

◆ ITextServices_OnTxPropertyBitsChange

#define ITextServices_OnTxPropertyBitsChange (   This,
  a,
  b 
)    (This)->lpVtbl->OnTxPropertyBitsChange(This,a,b)

Definition at line 62 of file editor.c.

◆ MAX_BUF_LEN

#define MAX_BUF_LEN   1024

◆ ok_w3

#define ok_w3 (   format,
  szString1,
  szString2,
  szString3 
)
Value:
WideCharToMultiByte(CP_ACP, 0, szString1, -1, string1, MAX_PATH, NULL, NULL); \
WideCharToMultiByte(CP_ACP, 0, szString2, -1, string2, MAX_PATH, NULL, NULL); \
WideCharToMultiByte(CP_ACP, 0, szString3, -1, string3, MAX_PATH, NULL, NULL); \
ok(!lstrcmpW(szString3, szString1) || !lstrcmpW(szString3, szString2), \
#define MAX_PATH
Definition: compat.h:34
#define WideCharToMultiByte
Definition: compat.h:111
static CHAR string2[MAX_PATH]
Definition: editor.c:44
static CHAR string1[MAX_PATH]
Definition: editor.c:44
static CHAR string3[MAX_PATH]
Definition: editor.c:44
Definition: format.c:58

Definition at line 46 of file editor.c.

◆ set_textA

#define set_textA (   hwnd,
  wm_set_text,
  txt 
)
Value:
do { \
SETTEXTEX stex = { ST_DEFAULT, CP_ACP }; \
WPARAM wparam = (wm_set_text == WM_SETTEXT) ? 0 : (WPARAM)&stex; \
assert(wm_set_text == WM_SETTEXT || wm_set_text == EM_SETTEXTEX); \
ret = SendMessageA(hwnd, wm_set_text, wparam, (LPARAM)txt); \
ok(ret, "SendMessageA(%02x) error %u\n", wm_set_text, GetLastError()); \
} while(0)
#define ST_DEFAULT
Definition: richedit.h:1070
#define EM_SETTEXTEX
Definition: richedit.h:131
#define WM_SETTEXT
Definition: winuser.h:1620

◆ set_textW

#define set_textW (   hwnd,
  wm_set_text,
  txt 
)
Value:
do { \
SETTEXTEX stex = { ST_DEFAULT, 1200 }; \
WPARAM wparam = (wm_set_text == WM_SETTEXT) ? 0 : (WPARAM)&stex; \
assert(wm_set_text == WM_SETTEXT || wm_set_text == EM_SETTEXTEX); \
ret = SendMessageW(hwnd, wm_set_text, wparam, (LPARAM)txt); \
ok(ret, "SendMessageW(%02x) error %u\n", wm_set_text, GetLastError()); \
} while(0)

◆ test_dm_messages

#define test_dm_messages (   wmclose,
  wmgetdefid,
  wmnextdlgctl 
)
Value:
ok(dm_messages.wm_close == wmclose, "expected %d WM_CLOSE message, " \
"got %d\n", wmclose, dm_messages.wm_close); \
ok(dm_messages.wm_getdefid == wmgetdefid, "expected %d WM_GETDIFID message, " \
"got %d\n", wmgetdefid, dm_messages.wm_getdefid);\
ok(dm_messages.wm_nextdlgctl == wmnextdlgctl, "expected %d WM_NEXTDLGCTL message, " \
"got %d\n", wmnextdlgctl, dm_messages.wm_nextdlgctl)
#define ok(value,...)
Definition: atltest.h:57
static struct dialog_mode_messages dm_messages
Definition: editor.c:7921

Definition at line 7923 of file editor.c.

◆ TEST_EM_SETFONTSIZE

#define TEST_EM_SETFONTSIZE (   hwnd,
  size,
  expected_size,
  expected_res,
  expected_undo 
)     _test_font_size(__LINE__,hwnd,size,expected_size,expected_res,expected_undo)

Definition at line 8540 of file editor.c.

◆ TEST_SETTEXT

#define TEST_SETTEXT (   a,
  b 
)
Value:
result = SendMessageA(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)a); \
ok (result == 1, "WM_SETTEXT returned %ld instead of 1\n", result); \
result = SendMessageA(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM)buf); \
ok (result == lstrlenA(buf), \
"WM_GETTEXT returned %ld instead of expected %u\n", \
result = strcmp(b, buf); \
ok(result == 0, \
"WM_SETTEXT round trip: strcmp = %ld, text=\"%s\"\n", result, buf);
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLuint64EXT * result
Definition: glext.h:11304
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
int WINAPI lstrlenA(LPCSTR lpString)
Definition: lstring.c:145

◆ TEST_SETTEXTW

#define TEST_SETTEXTW (   a,
  b 
)
Value:
result = SendMessageW(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)a); \
ok (result == 1, "WM_SETTEXT returned %ld instead of 1\n", result); \
result = SendMessageW(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM)bufW); \
ok (result == lstrlenW(bufW), \
"WM_GETTEXT returned %ld instead of expected %u\n", \
result, lstrlenW(bufW)); \
result = lstrcmpW(b, bufW); \
ok(result == 0, "WM_SETTEXT round trip: strcmp = %ld\n", result);
#define lstrlenW
Definition: compat.h:750

◆ WP_CHILD

#define WP_CHILD   2

Definition at line 6767 of file editor.c.

◆ WP_PARENT

#define WP_PARENT   1

Definition at line 6766 of file editor.c.

Function Documentation

◆ _test_font_size()

static void _test_font_size ( unsigned  line,
HWND  hwnd,
LONG  size,
LONG  expected_size,
LRESULT  expected_res,
BOOL  expected_undo 
)
static

Definition at line 8542 of file editor.c.

8544{
8546 LRESULT res;
8547 BOOL isundo;
8548
8549 cf.cbSize = sizeof(cf);
8550 cf.dwMask = CFM_SIZE;
8551
8554 isundo = SendMessageA(hwnd, EM_CANUNDO, 0, 0);
8555 ok_(__FILE__,line)(res == expected_res, "EM_SETFONTSIZE unexpected return value: %lx.\n", res);
8556 ok_(__FILE__,line)(twips2points(cf.yHeight) == expected_size, "got wrong font size: %d, expected: %d\n",
8557 twips2points(cf.yHeight), expected_size);
8558 ok_(__FILE__,line)(isundo == expected_undo, "get wrong undo mark: %d, expected: %d.\n",
8559 isundo, expected_undo);
8560}
#define ok_(x1, x2)
Definition: atltest.h:61
unsigned int BOOL
Definition: ntddk_ex.h:94
GLuint res
Definition: glext.h:9613
GLsizeiptr size
Definition: glext.h:5919
static LONG twips2points(LONG value)
Definition: editor.c:8535
#define SCF_SELECTION
Definition: richedit.h:235
#define EM_GETCHARFORMAT
Definition: richedit.h:91
#define EM_SETFONTSIZE
Definition: richedit.h:168
#define CFM_SIZE
Definition: richedit.h:362
Definition: parser.c:49
LONG_PTR LRESULT
Definition: windef.h:209
#define EM_CANUNDO
Definition: winuser.h:1986

◆ atowstr()

static WCHAR * atowstr ( const char str)
static

Definition at line 258 of file editor.c.

259{
260 WCHAR *ret;
261 DWORD len;
262 len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
263 ret = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
265 return ret;
266}
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define MultiByteToWideChar
Definition: compat.h:110
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum GLsizei len
Definition: glext.h:6722
const WCHAR * str
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by check_EM_FINDTEXT(), and check_EM_FINDTEXTEX().

◆ check_CFE_LINK_rcvd()

static void check_CFE_LINK_rcvd ( HWND  hwnd,
BOOL  is_url,
const char url 
)
static

Definition at line 1951 of file editor.c.

1952{
1953 BOOL link_present = FALSE;
1954
1955 link_present = check_CFE_LINK_selection(hwnd, 0, 1);
1956 if (is_url)
1957 { /* control text is url; should get CFE_LINK */
1958 ok(link_present, "URL Case: CFE_LINK not set for [%s].\n", url);
1959 }
1960 else
1961 {
1962 ok(!link_present, "Non-URL Case: CFE_LINK set for [%s].\n", url);
1963 }
1964}
#define FALSE
Definition: types.h:117
static const WCHAR url[]
Definition: encode.c:1432
static BOOL check_CFE_LINK_selection(HWND hwnd, int sel_start, int sel_end)
Definition: editor.c:1942

Referenced by test_EM_AUTOURLDETECT().

◆ check_CFE_LINK_selection()

static BOOL check_CFE_LINK_selection ( HWND  hwnd,
int  sel_start,
int  sel_end 
)
static

Definition at line 1942 of file editor.c.

1943{
1944 CHARFORMAT2A text_format;
1945 text_format.cbSize = sizeof(text_format);
1946 SendMessageA(hwnd, EM_SETSEL, sel_start, sel_end);
1948 return (text_format.dwEffects & CFE_LINK) != 0;
1949}
#define CFE_LINK
Definition: richedit.h:411
DWORD dwEffects
Definition: richedit.h:284
#define EM_SETSEL
Definition: winuser.h:2021

Referenced by check_CFE_LINK_rcvd(), and test_EM_AUTOURLDETECT().

◆ check_EM_EXSETSEL()

static void check_EM_EXSETSEL ( HWND  hwnd,
const struct exsetsel_s setsel,
int  id 
)
static

Definition at line 4950 of file editor.c.

4950 {
4951 CHARRANGE cr;
4953 int start, end;
4954
4955 cr.cpMin = setsel->min;
4956 cr.cpMax = setsel->max;
4958
4959 ok(result == setsel->expected_retval, "EM_EXSETSEL(%d): expected: %ld actual: %ld\n", id, setsel->expected_retval, result);
4960
4962
4963 todo_wine_if (setsel->todo)
4964 ok(start == setsel->expected_getsel_start && end == setsel->expected_getsel_end, "EM_EXSETSEL(%d): expected (%d,%d) actual:(%d,%d)\n",
4965 id, setsel->expected_getsel_start, setsel->expected_getsel_end, start, end);
4966}
GLuint start
Definition: gl.h:1545
GLuint GLuint end
Definition: gl.h:1545
GLdouble n
Definition: glext.h:7729
#define d
Definition: ke_i.h:81
BOOL expected
Definition: store.c:2063
#define todo_wine_if(is_todo)
Definition: custom.c:86
#define EM_EXSETSEL
Definition: richedit.h:88
LONG cpMax
Definition: richedit.h:501
LONG cpMin
Definition: richedit.h:500
LRESULT expected_retval
Definition: editor.c:4915
LONG max
Definition: editor.c:4914
BOOL todo
Definition: editor.c:4918
LONG min
Definition: editor.c:4913
#define EM_GETSEL
Definition: winuser.h:2000

Referenced by test_EM_EXSETSEL().

◆ check_EM_FINDTEXT()

static void check_EM_FINDTEXT ( HWND  hwnd,
const char name,
struct find_s f,
int  id,
BOOL  unicode 
)
static

Definition at line 268 of file editor.c.

269{
270 int findloc;
271
272 if(unicode){
273 FINDTEXTW ftw;
274 memset(&ftw, 0, sizeof(ftw));
275 ftw.chrg.cpMin = f->start;
276 ftw.chrg.cpMax = f->end;
277 ftw.lpstrText = atowstr(f->needle);
278
279 findloc = SendMessageA(hwnd, EM_FINDTEXT, f->flags, (LPARAM)&ftw);
280 ok(findloc == f->expected_loc,
281 "EM_FINDTEXT(%s,%d,%u) '%s' in range(%d,%d), flags %08x, got start at %d, expected %d\n",
282 name, id, unicode, f->needle, f->start, f->end, f->flags, findloc, f->expected_loc);
283
284 findloc = SendMessageA(hwnd, EM_FINDTEXTW, f->flags, (LPARAM)&ftw);
285 ok(findloc == f->expected_loc,
286 "EM_FINDTEXTW(%s,%d,%u) '%s' in range(%d,%d), flags %08x, got start at %d, expected %d\n",
287 name, id, unicode, f->needle, f->start, f->end, f->flags, findloc, f->expected_loc);
288
289 HeapFree(GetProcessHeap(), 0, (void*)ftw.lpstrText);
290 }else{
291 FINDTEXTA fta;
292 memset(&fta, 0, sizeof(fta));
293 fta.chrg.cpMin = f->start;
294 fta.chrg.cpMax = f->end;
295 fta.lpstrText = f->needle;
296
297 findloc = SendMessageA(hwnd, EM_FINDTEXT, f->flags, (LPARAM)&fta);
298 ok(findloc == f->expected_loc,
299 "EM_FINDTEXT(%s,%d,%u) '%s' in range(%d,%d), flags %08x, got start at %d, expected %d\n",
300 name, id, unicode, f->needle, f->start, f->end, f->flags, findloc, f->expected_loc);
301 }
302}
#define HeapFree(x, y, z)
Definition: compat.h:735
GLfloat f
Definition: glext.h:7540
static WCHAR * atowstr(const char *str)
Definition: editor.c:258
#define EM_FINDTEXTW
Definition: richedit.h:147
#define EM_FINDTEXT
Definition: richedit.h:89
#define memset(x, y, z)
Definition: compat.h:39
CHARRANGE chrg
Definition: richedit.h:581
LPCSTR lpstrText
Definition: richedit.h:582
CHARRANGE chrg
Definition: richedit.h:586
LPCWSTR lpstrText
Definition: richedit.h:587
Definition: name.c:39

Referenced by run_tests_EM_FINDTEXT().

◆ check_EM_FINDTEXTEX()

static void check_EM_FINDTEXTEX ( HWND  hwnd,
const char name,
struct find_s f,
int  id,
BOOL  unicode 
)
static

Definition at line 304 of file editor.c.

306{
307 int findloc;
308 int expected_end_loc;
309
310 if(unicode){
311 FINDTEXTEXW ftw;
312 memset(&ftw, 0, sizeof(ftw));
313 ftw.chrg.cpMin = f->start;
314 ftw.chrg.cpMax = f->end;
315 ftw.lpstrText = atowstr(f->needle);
316 findloc = SendMessageA(hwnd, EM_FINDTEXTEX, f->flags, (LPARAM)&ftw);
317 ok(findloc == f->expected_loc,
318 "EM_FINDTEXTEX(%s,%d) '%s' in range(%d,%d), flags %08x, start at %d\n",
319 name, id, f->needle, f->start, f->end, f->flags, findloc);
320 ok(ftw.chrgText.cpMin == f->expected_loc,
321 "EM_FINDTEXTEX(%s,%d) '%s' in range(%d,%d), flags %08x, start at %d\n",
322 name, id, f->needle, f->start, f->end, f->flags, ftw.chrgText.cpMin);
323 expected_end_loc = ((f->expected_loc == -1) ? -1
324 : f->expected_loc + strlen(f->needle));
325 ok(ftw.chrgText.cpMax == expected_end_loc,
326 "EM_FINDTEXTEX(%s,%d) '%s' in range(%d,%d), flags %08x, end at %d, expected %d\n",
327 name, id, f->needle, f->start, f->end, f->flags, ftw.chrgText.cpMax, expected_end_loc);
328 HeapFree(GetProcessHeap(), 0, (void*)ftw.lpstrText);
329 }else{
330 FINDTEXTEXA fta;
331 memset(&fta, 0, sizeof(fta));
332 fta.chrg.cpMin = f->start;
333 fta.chrg.cpMax = f->end;
334 fta.lpstrText = f->needle;
335 findloc = SendMessageA(hwnd, EM_FINDTEXTEX, f->flags, (LPARAM)&fta);
336 ok(findloc == f->expected_loc,
337 "EM_FINDTEXTEX(%s,%d) '%s' in range(%d,%d), flags %08x, start at %d\n",
338 name, id, f->needle, f->start, f->end, f->flags, findloc);
339 ok(fta.chrgText.cpMin == f->expected_loc,
340 "EM_FINDTEXTEX(%s,%d) '%s' in range(%d,%d), flags %08x, start at %d\n",
341 name, id, f->needle, f->start, f->end, f->flags, fta.chrgText.cpMin);
342 expected_end_loc = ((f->expected_loc == -1) ? -1
343 : f->expected_loc + strlen(f->needle));
344 ok(fta.chrgText.cpMax == expected_end_loc,
345 "EM_FINDTEXTEX(%s,%d) '%s' in range(%d,%d), flags %08x, end at %d, expected %d\n",
346 name, id, f->needle, f->start, f->end, f->flags, fta.chrgText.cpMax, expected_end_loc);
347 }
348}
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define EM_FINDTEXTEX
Definition: richedit.h:112
LPCSTR lpstrText
Definition: richedit.h:594
CHARRANGE chrg
Definition: richedit.h:593
CHARRANGE chrgText
Definition: richedit.h:595
CHARRANGE chrg
Definition: richedit.h:599
CHARRANGE chrgText
Definition: richedit.h:601
LPCWSTR lpstrText
Definition: richedit.h:600

Referenced by run_tests_EM_FINDTEXT().

◆ check_EM_SETSEL()

static void check_EM_SETSEL ( HWND  hwnd,
const struct exsetsel_s setsel,
int  id 
)
static

Definition at line 5007 of file editor.c.

5007 {
5009 int start, end;
5010
5011 result = SendMessageA(hwnd, EM_SETSEL, setsel->min, setsel->max);
5012
5013 ok(result == setsel->expected_retval, "EM_SETSEL(%d): expected: %ld actual: %ld\n", id, setsel->expected_retval, result);
5014
5016
5017 todo_wine_if (setsel->todo)
5018 ok(start == setsel->expected_getsel_start && end == setsel->expected_getsel_end, "EM_SETSEL(%d): expected (%d,%d) actual:(%d,%d)\n",
5019 id, setsel->expected_getsel_start, setsel->expected_getsel_end, start, end);
5020}

Referenced by test_EM_SETSEL().

◆ count_pars()

static int count_pars ( const char buf)
static

Definition at line 3828 of file editor.c.

3829{
3830 const char *p = buf;
3831 int count = 0;
3832 while ((p = strstr( p, "\\par" )) != NULL)
3833 {
3834 if (!isalpha( p[4] ))
3835 count++;
3836 p++;
3837 }
3838 return count;
3839}
#define isalpha(c)
Definition: acclib.h:74
char * strstr(char *String1, char *String2)
Definition: utclib.c:653
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLfloat GLfloat p
Definition: glext.h:8902

Referenced by test_EM_STREAMOUT().

◆ customWordBreakProc()

static LONG CALLBACK customWordBreakProc ( WCHAR text,
int  pos,
int  bytes,
int  code 
)
static

Definition at line 7083 of file editor.c.

7084{
7085 int length;
7086
7087 /* MSDN lied, length is actually the number of bytes. */
7088 length = bytes / sizeof(WCHAR);
7089 switch(code)
7090 {
7091 case WB_ISDELIMITER:
7092 return text[pos] == 'X';
7093 case WB_LEFT:
7094 case WB_MOVEWORDLEFT:
7096 return pos-1;
7098 case WB_LEFTBREAK:
7099 pos--;
7101 pos--;
7102 return pos;
7103 case WB_RIGHT:
7104 case WB_MOVEWORDRIGHT:
7106 return pos+1;
7108 case WB_RIGHTBREAK:
7109 pos++;
7111 pos++;
7112 return pos;
7113 default:
7114 ok(FALSE, "Unexpected code %d\n", code);
7115 break;
7116 }
7117 return 0;
7118}
static unsigned char bytes[4]
Definition: adnsresfilter.c:74
const WCHAR * text
Definition: package.c:1794
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
static LONG CALLBACK customWordBreakProc(WCHAR *text, int pos, int bytes, int code)
Definition: editor.c:7083
#define min(a, b)
Definition: monoChain.cc:55
#define WB_MOVEWORDRIGHT
Definition: richedit.h:1002
#define WB_RIGHTBREAK
Definition: richedit.h:1006
#define WB_MOVEWORDLEFT
Definition: richedit.h:1000
#define WB_LEFTBREAK
Definition: richedit.h:1004
Definition: inflate.c:139
#define WB_ISDELIMITER
Definition: winuser.h:549
#define WB_LEFT
Definition: winuser.h:550
#define WB_RIGHT
Definition: winuser.h:551

Referenced by customWordBreakProc(), and test_word_movement().

◆ dialog_mode_wnd_proc()

static LRESULT CALLBACK dialog_mode_wnd_proc ( HWND  hwnd,
UINT  iMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 7931 of file editor.c.

7932{
7933 switch (iMsg)
7934 {
7935 case DM_GETDEFID:
7936 dm_messages.wm_getdefid++;
7938 case WM_NEXTDLGCTL:
7939 dm_messages.wm_nextdlgctl++;
7940 break;
7941 case WM_CLOSE:
7942 dm_messages.wm_close++;
7943 break;
7944 }
7945
7946 return DefWindowProcA(hwnd, iMsg, wParam, lParam);
7947}
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define ID_RICHEDITTESTDBUTTON
Definition: editor.c:42
#define MAKELONG(a, b)
Definition: typedefs.h:249
#define WM_CLOSE
Definition: winuser.h:1624
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define DC_HASDEFID
Definition: winuser.h:2612
#define WM_NEXTDLGCTL
Definition: winuser.h:1646
#define DM_GETDEFID
Definition: winuser.h:2101

Referenced by test_dialogmode().

◆ disable_beep()

static void disable_beep ( HWND  hwnd)
static

Definition at line 63 of file editor.c.

64{
65 IRichEditOle *richole;
66 ITextServices *services;
67 IID *pIID_ITextServices = (IID *)GetProcAddress( hmoduleRichEdit, "IID_ITextServices" );
68
69 if (SendMessageW( hwnd, EM_GETOLEINTERFACE, 0, (LPARAM)&richole ))
70 {
71 if (SUCCEEDED( IRichEditOle_QueryInterface( richole, pIID_ITextServices, (void **)&services ) ))
72 {
74 ITextServices_Release( services );
75 }
76 IRichEditOle_Release( richole );
77 }
78}
#define GetProcAddress(x, y)
Definition: compat.h:753
#define SUCCEEDED(hr)
Definition: intsafe.h:50
static HMODULE hmoduleRichEdit
Definition: editor.c:53
#define ITextServices_OnTxPropertyBitsChange(This, a, b)
Definition: editor.c:62
static IID * pIID_ITextServices
Definition: txtsrv.c:42
#define EM_GETOLEINTERFACE
Definition: richedit.h:93
#define TXTBIT_ALLOWBEEP
Definition: textserv.h:196

Referenced by new_window(), new_windowW(), test_EM_SETOPTIONS(), test_undo_coalescing(), and test_WM_CHAR().

◆ EditStreamCallback()

static DWORD CALLBACK EditStreamCallback ( DWORD_PTR  dwCookie,
LPBYTE  pbBuff,
LONG  cb,
LONG pcb 
)
static

Definition at line 5732 of file editor.c.

5734{
5735 const char text[] = {'t','e','s','t'};
5736
5737 if (sizeof(text) <= cb)
5738 {
5739 if ((int)dwCookie != nCallbackCount)
5740 {
5741 *pcb = 0;
5742 return 0;
5743 }
5744
5745 memcpy (pbBuff, text, sizeof(text));
5746 *pcb = sizeof(text);
5747
5749
5750 return 0;
5751 }
5752 else
5753 return 1; /* indicates callback failed */
5754}
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static HMODULE MODULEINFO DWORD cb
Definition: module.c:33
static int nCallbackCount
Definition: editor.c:5730

Referenced by test_EM_StreamIn_Undo().

◆ EN_LINK_ParentMsgCheckProcA()

static LRESULT WINAPI EN_LINK_ParentMsgCheckProcA ( HWND  hwnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 6769 of file editor.c.

6770{
6771 if(message == WM_NOTIFY && ((NMHDR*)lParam)->code == EN_LINK)
6772 {
6773 enlink = *(ENLINK*)lParam;
6774 }
6776}
static ENLINK enlink
Definition: editor.c:6763
#define EN_LINK
Definition: richedit.h:202
#define WM_NOTIFY
Definition: richedit.h:61
Definition: tftpd.h:60

Referenced by test_EN_LINK().

◆ fill_reobject_struct()

static void fill_reobject_struct ( REOBJECT reobj,
LONG  cp,
LPOLEOBJECT  poleobj,
LPSTORAGE  pstg,
LPOLECLIENTSITE  polesite,
LONG  sizel_cx,
LONG  sizel_cy,
DWORD  aspect,
DWORD  flags,
DWORD  user 
)
static

Definition at line 8937 of file editor.c.

8940{
8941 reobj->cbStruct = sizeof(*reobj);
8942 reobj->clsid = CLSID_NULL;
8943 reobj->cp = cp;
8944 reobj->poleobj = poleobj;
8945 reobj->pstg = pstg;
8946 reobj->polesite = polesite;
8947 reobj->sizel.cx = sizel_cx;
8948 reobj->sizel.cy = sizel_cy;
8949 reobj->dvaspect = aspect;
8950 reobj->dwFlags = flags;
8951 reobj->dwUser = user;
8952}
void user(int argc, const char *argv[])
Definition: cmds.c:1350
GLbitfield flags
Definition: glext.h:7161
POINT cp
Definition: magnifier.c:59
#define CLSID_NULL
Definition: guiddef.h:99
LONG cx
Definition: kdterminal.h:27
LONG cy
Definition: kdterminal.h:28
DWORD dwUser
Definition: richole.idl:67
CLSID clsid
Definition: richole.idl:60
DWORD dwFlags
Definition: richole.idl:66
LPSTORAGE pstg
Definition: richole.idl:62
LPOLEOBJECT poleobj
Definition: richole.idl:61
DWORD dvaspect
Definition: richole.idl:65
LPOLECLIENTSITE polesite
Definition: richole.idl:63
DWORD cbStruct
Definition: richole.idl:58
LONG cp
Definition: richole.idl:59
SIZEL sizel
Definition: richole.idl:64

Referenced by test_EM_SELECTIONTYPE().

◆ format_test_result()

static void format_test_result ( char target,
const char src 
)
static

Definition at line 8317 of file editor.c.

8318{
8319 int i;
8320 for (i = 0; i < strlen(src); i++)
8321 sprintf(target + 2*i, "%02x", src[i] & 0xFF);
8322 target[2*i] = 0;
8323}
GLenum src
Definition: glext.h:6340
GLenum target
Definition: glext.h:7315
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define sprintf(buf, format,...)
Definition: sprintf.c:55

Referenced by test_enter().

◆ get_scroll_pos_y()

static int get_scroll_pos_y ( HWND  hwnd)
static

Definition at line 547 of file editor.c.

548{
549 POINT p = {-1, -1};
551 ok(p.x != -1 && p.y != -1, "p.x:%d p.y:%d\n", p.x, p.y);
552 return p.y;
553}
#define EM_GETSCROLLPOS
Definition: richedit.h:165

Referenced by test_EM_SCROLLCARET().

◆ hold_key()

static BOOL hold_key ( int  vk)
static

Definition at line 146 of file editor.c.

147{
148 BYTE key_state[256];
149 BOOL result;
150
151 result = GetKeyboardState(key_state);
152 ok(result, "GetKeyboardState failed.\n");
153 if (!result) return FALSE;
154 key_state[vk] |= 0x80;
155 result = SetKeyboardState(key_state);
156 ok(result, "SetKeyboardState failed.\n");
157 return result != 0;
158}
WORD vk
Definition: input.c:77
BOOL WINAPI SetKeyboardState(_In_reads_(256) LPBYTE)
_Check_return_ BOOL WINAPI GetKeyboardState(_Out_writes_(256) PBYTE lpKeyState)
unsigned char BYTE
Definition: xxhash.c:193

Referenced by send_ctrl_key(), test_WM_GETDLGCODE(), test_WM_PASTE(), and test_zoom().

◆ is_em_settextex_supported()

static BOOL is_em_settextex_supported ( HWND  hwnd)
static

Definition at line 6193 of file editor.c.

6194{
6195 SETTEXTEX stex = { ST_DEFAULT, CP_ACP };
6196 return SendMessageA(hwnd, EM_SETTEXTEX, (WPARAM)&stex, 0) != 0;
6197}

Referenced by test_unicode_conversions().

◆ keep_responsive()

static void keep_responsive ( time_t  delay_time)
static

Definition at line 115 of file editor.c.

116{
117 MSG msg;
118 time_t end;
119
120 /* The message pump uses PeekMessage() to empty the queue and then
121 * sleeps for 50ms before retrying the queue. */
122 end = time(NULL) + delay_time;
123 while (time(NULL) < end) {
124 if (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) {
127 } else {
128 Sleep(50);
129 }
130 }
131}
#define msg(x)
Definition: auth_time.c:54
__kernel_time_t time_t
Definition: linux.h:252
__u16 time
Definition: mkdosfs.c:8
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
Definition: synch.c:790
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
LRESULT WINAPI DispatchMessageA(_In_ const MSG *)
BOOL WINAPI TranslateMessage(_In_ const MSG *)
#define PM_REMOVE
Definition: winuser.h:1199
BOOL WINAPI PeekMessageA(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT, _In_ UINT)

Referenced by START_TEST().

◆ line_scroll()

static void line_scroll ( HWND  hwnd,
int  amount 
)
static

Definition at line 563 of file editor.c.

564{
565 SendMessageA(hwnd, EM_LINESCROLL, 0, amount);
566}
#define EM_LINESCROLL
Definition: winuser.h:2007

Referenced by test_EM_SCROLLCARET().

◆ link_notify_test()

static void link_notify_test ( const char desc,
int  i,
HWND  hwnd,
HWND  parent,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam,
BOOL  notifies 
)
static

Definition at line 6778 of file editor.c.

6780{
6781 ENLINK junk_enlink;
6782
6783 switch (msg)
6784 {
6785 case WM_LBUTTONDBLCLK:
6786 case WM_LBUTTONDOWN:
6787 case WM_LBUTTONUP:
6788 case WM_MOUSEHOVER:
6789 case WM_MOUSEMOVE:
6790 case WM_MOUSEWHEEL:
6791 case WM_RBUTTONDBLCLK:
6792 case WM_RBUTTONDOWN:
6793 case WM_RBUTTONUP:
6795 break;
6796 case WM_SETCURSOR:
6797 if (wParam == WP_PARENT)
6798 wParam = (WPARAM)parent;
6799 else if (wParam == WP_CHILD)
6800 wParam = (WPARAM)hwnd;
6801 break;
6802 }
6803
6804 memset(&junk_enlink, 0x23, sizeof(junk_enlink));
6805 enlink = junk_enlink;
6806
6808
6809 if (notifies)
6810 {
6812 "%s test %i: Expected hwnd %p got %p\n", desc, i, hwnd, enlink.nmhdr.hwndFrom);
6813 ok(enlink.nmhdr.idFrom == 0,
6814 "%s test %i: Expected idFrom 0 got 0x%lx\n", desc, i, enlink.nmhdr.idFrom);
6815 ok(enlink.msg == msg,
6816 "%s test %i: Expected msg 0x%x got 0x%x\n", desc, i, msg, enlink.msg);
6817 if (msg == WM_SETCURSOR)
6818 {
6819 ok(enlink.wParam == 0,
6820 "%s test %i: Expected wParam 0 got 0x%lx\n", desc, i, enlink.wParam);
6821 }
6822 else
6823 {
6825 "%s test %i: Expected wParam 0x%lx got 0x%lx\n", desc, i, wParam, enlink.wParam);
6826 }
6828 "%s test %i: Expected lParam 0x%lx got 0x%lx\n",
6830 ok(enlink.chrg.cpMin == 0 && enlink.chrg.cpMax == 31,
6831 "%s test %i: Expected link range [0,31) got [%i,%i)\n", desc, i, enlink.chrg.cpMin, enlink.chrg.cpMax);
6832 }
6833 else
6834 {
6835 ok(memcmp(&enlink, &junk_enlink, sizeof(enlink)) == 0,
6836 "%s test %i: Expected enlink to remain unmodified\n", desc, i);
6837 }
6838}
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
r parent
Definition: btrfs.c:3010
static const WCHAR desc[]
Definition: protectdata.c:36
#define CURSOR_CLIENT_Y
Definition: editor.c:6765
#define WP_PARENT
Definition: editor.c:6766
#define CURSOR_CLIENT_X
Definition: editor.c:6764
#define WP_CHILD
Definition: editor.c:6767
#define WM_MOUSEHOVER
Definition: commctrl.h:4979
UINT_PTR idFrom
Definition: winuser.h:3161
HWND hwndFrom
Definition: winuser.h:3160
#define WM_MOUSEWHEEL
Definition: treelist.c:96
#define MAKELPARAM(l, h)
Definition: winuser.h:4011
#define WM_LBUTTONDBLCLK
Definition: winuser.h:1781
#define WM_RBUTTONUP
Definition: winuser.h:1783
#define WM_RBUTTONDBLCLK
Definition: winuser.h:1784
#define WM_MOUSEMOVE
Definition: winuser.h:1778
#define WM_LBUTTONDOWN
Definition: winuser.h:1779
#define WM_RBUTTONDOWN
Definition: winuser.h:1782
#define WM_LBUTTONUP
Definition: winuser.h:1780
#define WM_SETCURSOR
Definition: winuser.h:1639

Referenced by test_EN_LINK().

◆ LRESULT()

static LRESULT ( WINAPI richeditProc)
static

◆ move_cursor()

static void move_cursor ( HWND  hwnd,
LONG  charindex 
)
static

Definition at line 555 of file editor.c.

556{
557 CHARRANGE cr;
558 cr.cpMax = charindex;
559 cr.cpMin = charindex;
561}

Referenced by test_EM_SCROLLCARET().

◆ new_richedit()

◆ new_richedit_with_style()

static HWND new_richedit_with_style ( HWND  parent,
DWORD  style 
)
static

Definition at line 105 of file editor.c.

105 {
107}
Arabic default style
Definition: afstyles.h:94

Referenced by test_EM_REPLACESEL(), test_EM_SETTEXTEX(), test_EM_STREAMIN(), test_WM_PASTE(), and test_WM_SETTEXT().

◆ new_richeditW()

static HWND new_richeditW ( HWND  parent)
static

Definition at line 109 of file editor.c.

109 {
111}
static HWND new_windowW(LPCWSTR lpClassName, DWORD dwStyle, HWND parent)
Definition: editor.c:91
static const WCHAR RICHEDIT_CLASS20W[]
Definition: richedit.h:50

Referenced by test_EM_FINDTEXT(), test_EM_FINDWORDBREAK_W(), test_EM_SETREADONLY(), test_para_numbering(), test_reset_default_para_fmt(), and test_rtf().

◆ new_static_wnd()

static HWND new_static_wnd ( HWND  parent)
static

Definition at line 1966 of file editor.c.

1966 {
1967 return new_window("Static", 0, parent);
1968}

Referenced by test_EM_AUTOURLDETECT().

◆ new_window()

static HWND new_window ( LPCSTR  lpClassName,
DWORD  dwStyle,
HWND  parent 
)
static

Definition at line 81 of file editor.c.

81 {
82 HWND hwnd;
83 hwnd = CreateWindowA(lpClassName, NULL, dwStyle|WS_POPUP|WS_HSCROLL|WS_VSCROLL
84 |WS_VISIBLE, 0, 0, 200, 60, parent, NULL,
86 ok(hwnd != NULL, "class: %s, error: %d\n", lpClassName, (int) GetLastError());
88 return hwnd;
89}
static void disable_beep(HWND hwnd)
Definition: editor.c:63
#define WS_POPUP
Definition: pedump.c:616
#define WS_VSCROLL
Definition: pedump.c:627
#define WS_VISIBLE
Definition: pedump.c:620
#define WS_HSCROLL
Definition: pedump.c:628
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4318

Referenced by MDIMainFrame::go_to(), navigate_new_window(), new_richedit(), new_richedit_with_style(), new_static_wnd(), MainFrameBase::Notify(), test_dialogmode(), test_open_window(), and test_scrollbar_visibility().

◆ new_windowW()

static HWND new_windowW ( LPCWSTR  lpClassName,
DWORD  dwStyle,
HWND  parent 
)
static

Definition at line 91 of file editor.c.

91 {
92 HWND hwnd;
93 hwnd = CreateWindowW(lpClassName, NULL, dwStyle|WS_POPUP|WS_HSCROLL|WS_VSCROLL
94 |WS_VISIBLE, 0, 0, 200, 60, parent, NULL,
96 ok(hwnd != NULL, "class: %s, error: %d\n", wine_dbgstr_w(lpClassName), (int) GetLastError());
98 return hwnd;
99}
#define wine_dbgstr_w
Definition: kernel32.h:34
#define CreateWindowW(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4319

Referenced by new_richeditW(), and test_alignment_style().

◆ ParentMsgCheckProcA()

static LRESULT WINAPI ParentMsgCheckProcA ( HWND  hwnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 6565 of file editor.c.

6566{
6567 if(message == WM_COMMAND && (watchForEventMask & (wParam >> 16)))
6568 {
6570 }
6572}
static int queriedEventMask
Definition: editor.c:6561
static HWND eventMaskEditHwnd
Definition: editor.c:6560
static int watchForEventMask
Definition: editor.c:6562
#define EM_GETEVENTMASK
Definition: richedit.h:92
#define WM_COMMAND
Definition: winuser.h:1743

Referenced by test_eventMask().

◆ release_key()

static BOOL release_key ( int  vk)
static

Definition at line 160 of file editor.c.

161{
162 BYTE key_state[256];
163 BOOL result;
164
165 result = GetKeyboardState(key_state);
166 ok(result, "GetKeyboardState failed.\n");
167 if (!result) return FALSE;
168 key_state[vk] &= ~0x80;
169 result = SetKeyboardState(key_state);
170 ok(result, "SetKeyboardState failed.\n");
171 return result != 0;
172}

Referenced by send_ctrl_key(), test_WM_GETDLGCODE(), test_WM_PASTE(), and test_zoom().

◆ RicheditStupidOverrideProcA()

static LRESULT WINAPI RicheditStupidOverrideProcA ( HWND  hwnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 2899 of file editor.c.

2900{
2901 LRESULT r;
2902
2903 if (bailedOutOfRecursion) return 0;
2904 if (recursionLevel >= 32) {
2906 return 0;
2907 }
2908
2910 switch (message) {
2911 case WM_SIZE:
2913 r = richeditProc(hwnd, message, wParam, lParam);
2914 /* Because, uhhhh... I never heard of ES_DISABLENOSCROLL */
2917 break;
2918 default:
2919 r = richeditProc(hwnd, message, wParam, lParam);
2920 break;
2921 }
2923 return r;
2924}
#define TRUE
Definition: types.h:120
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
static unsigned int recursionLevel
Definition: editor.c:2894
static unsigned int WM_SIZE_recursionLevel
Definition: editor.c:2895
static BOOL bailedOutOfRecursion
Definition: editor.c:2896
#define WM_SIZE
Definition: winuser.h:1614
#define SB_VERT
Definition: winuser.h:553
BOOL WINAPI ShowScrollBar(_In_ HWND, _In_ int, _In_ BOOL)

Referenced by test_scrollbar_visibility().

◆ run_tests_EM_FINDTEXT()

static void run_tests_EM_FINDTEXT ( HWND  hwnd,
const char name,
struct find_s find,
int  num_tests,
BOOL  unicode 
)
static

Definition at line 350 of file editor.c.

352{
353 int i;
354
355 for (i = 0; i < num_tests; i++) {
356 check_EM_FINDTEXT(hwnd, name, &find[i], i, unicode);
357 check_EM_FINDTEXTEX(hwnd, name, &find[i], i, unicode);
358 }
359}
static TAGID TAGID find
Definition: db.cpp:155
static void check_EM_FINDTEXT(HWND hwnd, const char *name, struct find_s *f, int id, BOOL unicode)
Definition: editor.c:268
static void check_EM_FINDTEXTEX(HWND hwnd, const char *name, struct find_s *f, int id, BOOL unicode)
Definition: editor.c:304

Referenced by test_EM_FINDTEXT().

◆ send_ctrl_key()

static LRESULT send_ctrl_key ( HWND  hwnd,
UINT  key 
)
static

Definition at line 5440 of file editor.c.

5441{
5446 return result;
5447}
static BOOL hold_key(int vk)
Definition: editor.c:146
static BOOL release_key(int vk)
Definition: editor.c:160
Definition: copy.c:22
#define VK_CONTROL
Definition: winuser.h:2206
#define WM_KEYDOWN
Definition: winuser.h:1718

Referenced by test_WM_PASTE(), and test_word_movement().

◆ simulate_typing_characters()

static void simulate_typing_characters ( HWND  hwnd,
const char szChars 
)
static

Definition at line 133 of file editor.c.

134{
135 int ret;
136
137 while (*szChars != '\0') {
138 SendMessageA(hwnd, WM_KEYDOWN, *szChars, 1);
139 ret = SendMessageA(hwnd, WM_CHAR, *szChars, 1);
140 ok(ret == 0, "WM_CHAR('%c') ret=%d\n", *szChars, ret);
141 SendMessageA(hwnd, WM_KEYUP, *szChars, 1);
142 szChars++;
143 }
144}
#define WM_KEYUP
Definition: winuser.h:1719
#define WM_CHAR
Definition: winuser.h:1720

Referenced by test_alignment_style(), test_EM_AUTOURLDETECT(), test_enter(), test_reset_default_para_fmt(), and test_undo_coalescing().

◆ START_TEST()

START_TEST ( editor  )

Definition at line 9057 of file editor.c.

9058{
9059 BOOL ret;
9060 /* Must explicitly LoadLibrary(). The test has no references to functions in
9061 * RICHED20.DLL, so the linker doesn't actually link to it. */
9062 hmoduleRichEdit = LoadLibraryA("riched20.dll");
9063 ok(hmoduleRichEdit != NULL, "error: %d\n", (int) GetLastError());
9065
9067 test_WM_CHAR();
9094 test_WM_PASTE();
9107 test_EN_LINK();
9118 test_zoom();
9122 test_enter();
9128 test_rtf();
9133
9134 /* Set the environment variable WINETEST_RICHED20 to keep windows
9135 * responsive and open for 30 seconds. This is useful for debugging.
9136 */
9137 if (getenv( "WINETEST_RICHED20" )) {
9138 keep_responsive(30);
9139 }
9140
9143 ok(ret, "error: %d\n", (int) GetLastError());
9144}
#define FreeLibrary(x)
Definition: compat.h:748
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
Definition: loader.c:111
LANGID WINAPI GetSystemDefaultLangID(void)
Definition: locale.c:1194
HRESULT WINAPI OleFlushClipboard(void)
Definition: clipboard.c:2293
_Check_return_ char *__cdecl getenv(_In_z_ const char *_VarName)
static void test_EM_SELECTIONTYPE(void)
Definition: editor.c:8954
static void test_EM_FORMATRANGE(void)
Definition: editor.c:5614
static void test_SETPARAFORMAT(void)
Definition: editor.c:1535
static void test_WM_PASTE(void)
Definition: editor.c:5449
static void test_EM_EXSETSEL(void)
Definition: editor.c:4968
static void test_EM_GETSELTEXT(void)
Definition: editor.c:1830
static void test_WM_GETTEXT(void)
Definition: editor.c:1679
static void test_EM_StreamIn_Undo(void)
Definition: editor.c:6120
static void test_EM_SETOPTIONS(void)
Definition: editor.c:1869
static void test_EM_FINDWORDBREAK_W(void)
Definition: editor.c:8240
static void test_WM_SETFONT(void)
Definition: editor.c:4665
static void test_undo_coalescing(void)
Definition: editor.c:6965
static void test_EM_GETTEXTLENGTHEX(void)
Definition: editor.c:6409
static void test_EM_STREAMOUT_FONTTBL(void)
Definition: editor.c:3943
static void test_EM_GETLINE(void)
Definition: editor.c:419
static void test_WM_GETTEXTLENGTH(void)
Definition: editor.c:8728
static void test_EM_SCROLL(void)
Definition: editor.c:2760
static void test_EM_GETLIMITTEXT(void)
Definition: editor.c:4650
static void test_EN_LINK(void)
Definition: editor.c:6840
static void test_unicode_conversions(void)
Definition: editor.c:6199
static void test_EM_STREAMIN(void)
Definition: editor.c:5846
static void test_EM_STREAMOUT(void)
Definition: editor.c:3841
static void test_EM_AUTOURLDETECT(void)
Definition: editor.c:1970
static void test_EM_REPLACESEL(int redraw)
Definition: editor.c:5065
static void test_WM_CREATE(void)
Definition: editor.c:8443
static void test_WM_SETTEXT(void)
Definition: editor.c:3713
static void test_EM_SETCHARFORMAT(void)
Definition: editor.c:779
static void test_background(void)
Definition: editor.c:8821
static BOOL is_lang_japanese
Definition: editor.c:54
static void test_dialogmode(void)
Definition: editor.c:7949
static void test_EM_SETTEXTMODE(void)
Definition: editor.c:1393
static void test_format_rect(void)
Definition: editor.c:7417
static void test_eventMask(void)
Definition: editor.c:6575
static void test_EM_LINELENGTH(void)
Definition: editor.c:491
static void test_scrollbar_visibility(void)
Definition: editor.c:2926
static void keep_responsive(time_t delay_time)
Definition: editor.c:115
static void test_EM_CHARFROMPOS(void)
Definition: editor.c:7209
static void test_EM_SETFONTSIZE(void)
Definition: editor.c:8562
static void test_EM_SETSEL(void)
Definition: editor.c:5022
static void test_rtf(void)
Definition: editor.c:8759
static void test_WM_GETDLGCODE(void)
Definition: editor.c:7593
static void test_EM_SCROLLCARET(void)
Definition: editor.c:568
static void test_EM_SETUNDOLIMIT(void)
Definition: editor.c:3606
static void test_EM_STREAMOUT_empty_para(void)
Definition: editor.c:3996
static void test_EM_LIMITTEXT(void)
Definition: editor.c:4479
static void test_autoscroll(void)
Definition: editor.c:7358
static void test_word_wrap(void)
Definition: editor.c:7262
static void test_enter(void)
Definition: editor.c:8333
static void test_EM_FINDWORDBREAK_A(void)
Definition: editor.c:8284
static void test_reset_default_para_fmt(void)
Definition: editor.c:8484
static void test_window_classes(void)
Definition: editor.c:9025
static void test_EM_POSFROMCHAR(void)
Definition: editor.c:626
static void test_zoom(void)
Definition: editor.c:7774
static void test_ES_PASSWORD(void)
Definition: editor.c:3670
static void test_EM_EXLIMITTEXT(void)
Definition: editor.c:4519
static void test_WM_CHAR(void)
Definition: editor.c:6357
static void test_eop_char_fmt(void)
Definition: editor.c:8833
static void test_word_movement(void)
Definition: editor.c:7120
static void test_para_numbering(void)
Definition: editor.c:8869
static void test_EM_GETTEXTRANGE(void)
Definition: editor.c:1746
static void test_alignment_style(void)
Definition: editor.c:8629
static void test_EM_SETTEXTEX(void)
Definition: editor.c:4016
static void test_WM_NOTIFY(void)
Definition: editor.c:6669
static void test_EM_SETREADONLY(void)
Definition: editor.c:8516
static void test_TM_PLAINTEXT(void)
Definition: editor.c:1569
static void test_EM_GETMODIFY(void)
Definition: editor.c:4747
static void test_EM_FINDTEXT(void)
Definition: editor.c:779
#define LANG_JAPANESE
Definition: nls.h:76
#define PRIMARYLANGID(l)
Definition: nls.h:16

◆ test_alignment_style()

static void test_alignment_style ( void  )
static

Definition at line 8629 of file editor.c.

8630{
8631 HWND richedit = NULL;
8632 PARAFORMAT2 pf;
8633 DWORD align_style[] = {ES_LEFT, ES_CENTER, ES_RIGHT, ES_RIGHT | ES_CENTER,
8638 const char * streamtext =
8639 "{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang12298{\\fonttbl{\\f0\\fswiss\\fprq2\\fcharset0 System;}}\r\n"
8640 "\\viewkind4\\uc1\\pard\\f0\\fs17 TestSomeText\\par\r\n"
8641 "}\r\n";
8642 EDITSTREAM es;
8643 int i;
8644
8645 for (i = 0; i < ARRAY_SIZE(align_style); i++)
8646 {
8647 DWORD dwStyle, new_align;
8648
8649 richedit = new_windowW(RICHEDIT_CLASS20W, align_style[i], NULL);
8650 memset(&pf, 0, sizeof(pf));
8651 pf.cbSize = sizeof(PARAFORMAT2);
8652 pf.dwMask = -1;
8653
8654 SendMessageW(richedit, EM_GETPARAFORMAT, 0, (LPARAM)&pf);
8655 ok(pf.wAlignment == align_mask[i], "(i = %d) got %d expected %d\n",
8656 i, pf.wAlignment, align_mask[i]);
8657 dwStyle = GetWindowLongW(richedit, GWL_STYLE);
8658 ok((i ? (dwStyle & align_style[i]) : (!(dwStyle & 0x0000000f))) ,
8659 "(i = %d) didn't set right align style: 0x%x\n", i, dwStyle);
8660
8661
8662 /* Based on test_reset_default_para_fmt() */
8663 new_align = (align_mask[i] == PFA_LEFT) ? PFA_RIGHT : PFA_LEFT;
8664 simulate_typing_characters(richedit, "123");
8665
8666 SendMessageW(richedit, EM_SETSEL, 0, -1);
8667 pf.dwMask = PFM_ALIGNMENT;
8668 pf.wAlignment = new_align;
8669 SendMessageW(richedit, EM_SETPARAFORMAT, 0, (LPARAM)&pf);
8670
8671 SendMessageW(richedit, EM_GETPARAFORMAT, 0, (LPARAM)&pf);
8672 ok(pf.wAlignment == new_align, "got %d expect %d\n", pf.wAlignment, new_align);
8673
8674 SendMessageW(richedit, EM_SETSEL, 0, -1);
8675 SendMessageW(richedit, WM_CUT, 0, 0);
8676
8677 SendMessageW(richedit, EM_GETPARAFORMAT, 0, (LPARAM)&pf);
8678 ok(pf.wAlignment == align_mask[i], "got %d expect %d\n", pf.wAlignment, align_mask[i]);
8679
8680 /* Test out of bounds tab count */
8681 pf.dwMask = PFM_TABSTOPS;
8682 pf.cTabCount = -25000;
8683 SendMessageW(richedit, EM_SETPARAFORMAT, 0, (LPARAM)&pf);
8684 ok(pf.cTabCount == -25000, "Got %d\n", pf.cTabCount);
8685 SendMessageW(richedit, EM_GETPARAFORMAT, 0, (LPARAM)&pf);
8686 ok(pf.cTabCount == 0, "Got %d\n", pf.cTabCount);
8687 pf.dwMask = PFM_TABSTOPS;
8688 pf.cTabCount = 25000;
8689 SendMessageW(richedit, EM_SETPARAFORMAT, 0, (LPARAM)&pf);
8690 ok(pf.cTabCount == 25000, "Got %d\n", pf.cTabCount);
8691 SendMessageW(richedit, EM_GETPARAFORMAT, 0, (LPARAM)&pf);
8692 ok(pf.cTabCount == 32, "Got %d\n", pf.cTabCount);
8693 pf.dwMask = PFM_TABSTOPS;
8694 pf.cTabCount = 32;
8695 SendMessageW(richedit, EM_SETPARAFORMAT, 0, (LPARAM)&pf);
8696 SendMessageW(richedit, EM_GETPARAFORMAT, 0, (LPARAM)&pf);
8697 ok(pf.cTabCount == 32, "Got %d\n", pf.cTabCount);
8698 pf.dwMask = PFM_TABSTOPS;
8699 pf.cTabCount = 33;
8700 SendMessageW(richedit, EM_SETPARAFORMAT, 0, (LPARAM)&pf);
8701 SendMessageW(richedit, EM_GETPARAFORMAT, 0, (LPARAM)&pf);
8702 ok(pf.cTabCount == 32, "Got %d\n", pf.cTabCount);
8703 pf.dwMask = PFM_TABSTOPS;
8704 pf.cTabCount = 1;
8705 SendMessageW(richedit, EM_SETPARAFORMAT, 0, (LPARAM)&pf);
8706 SendMessageW(richedit, EM_GETPARAFORMAT, 0, (LPARAM)&pf);
8707 ok(pf.cTabCount == 1, "Got %d\n", pf.cTabCount);
8708
8709 DestroyWindow(richedit);
8710 }
8711
8712 /* test with EM_STREAMIN */
8714 simulate_typing_characters(richedit, "abc");
8715 es.dwCookie = (DWORD_PTR)&streamtext;
8716 es.dwError = 0;
8717 es.pfnCallback = test_EM_STREAMIN_esCallback;
8718 SendMessageW(richedit, EM_STREAMIN, SF_RTF, (LPARAM)&es);
8719 SendMessageW(richedit, EM_SETSEL, 0, -1);
8720 memset(&pf, 0, sizeof(pf));
8721 pf.cbSize = sizeof(PARAFORMAT2);
8722 pf.dwMask = -1;
8724 ok(pf.wAlignment == PFA_LEFT, "got %d expected PFA_LEFT\n", pf.wAlignment);
8725 DestroyWindow(richedit);
8726}
#define ARRAY_SIZE(A)
Definition: main.h:20
#define es
Definition: i386-dis.c:440
static void simulate_typing_characters(HWND hwnd, const char *szChars)
Definition: editor.c:133
static DWORD CALLBACK test_EM_STREAMIN_esCallback(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)
Definition: editor.c:5756
#define ES_LEFT
Definition: pedump.c:664
#define ES_CENTER
Definition: pedump.c:665
#define ES_RIGHT
Definition: pedump.c:666
#define PFA_RIGHT
Definition: richedit.h:922
#define PFA_CENTER
Definition: richedit.h:923
#define PFA_LEFT
Definition: richedit.h:921
#define EM_STREAMIN
Definition: richedit.h:106
#define SF_RTF
Definition: richedit.h:721
#define EM_GETPARAFORMAT
Definition: richedit.h:94
struct _paraformat2 PARAFORMAT2
#define PFM_ALIGNMENT
Definition: richedit.h:841
#define PFM_TABSTOPS
Definition: richedit.h:842
#define EM_SETPARAFORMAT
Definition: richedit.h:104
WORD wAlignment
Definition: richedit.h:673
DWORD dwMask
Definition: richedit.h:667
UINT cbSize
Definition: richedit.h:666
SHORT cTabCount
Definition: richedit.h:674
#define DWORD_PTR
Definition: treelist.c:76
LONG WINAPI GetWindowLongW(_In_ HWND, _In_ int)
#define WM_CUT
Definition: winuser.h:1864
#define GWL_STYLE
Definition: winuser.h:855
BOOL WINAPI DestroyWindow(_In_ HWND)

Referenced by START_TEST().

◆ test_autoscroll()

static void test_autoscroll ( void  )
static

Definition at line 7358 of file editor.c.

7359{
7361 int lines, ret, redraw;
7362 POINT pt;
7363
7364 for (redraw = 0; redraw <= 1; redraw++) {
7365 trace("testing with WM_SETREDRAW=%d\n", redraw);
7367 SendMessageA(hwnd, EM_REPLACESEL, 0, (LPARAM)"1\n2\n3\n4\n5\n6\n7\n8");
7369 ok(lines == 8, "%d lines instead of 8\n", lines);
7371 ok(ret == 1, "EM_GETSCROLLPOS returned %d instead of 1\n", ret);
7372 ok(pt.y != 0, "Didn't scroll down after replacing text.\n");
7374 ok(ret & WS_VSCROLL, "Scrollbar was not shown yet (style=%x).\n", (UINT)ret);
7375
7378 ok(lines == 1, "%d lines instead of 1\n", lines);
7380 ok(ret == 1, "EM_GETSCROLLPOS returned %d instead of 1\n", ret);
7381 ok(pt.y == 0, "y scroll position is %d after clearing text.\n", pt.y);
7383 ok(!(ret & WS_VSCROLL), "Scrollbar is still shown (style=%x).\n", (UINT)ret);
7384 }
7385
7388
7389 /* The WS_VSCROLL and WS_HSCROLL styles implicitly set
7390 * auto vertical/horizontal scrolling options. */
7393 0, 0, 200, 60, NULL, NULL, hmoduleRichEdit, NULL);
7394 ok(hwnd != NULL, "class: %s, error: %d\n", RICHEDIT_CLASS20A, (int) GetLastError());
7396 ok(ret & ECO_AUTOVSCROLL, "ECO_AUTOVSCROLL isn't set.\n");
7397 ok(ret & ECO_AUTOHSCROLL, "ECO_AUTOHSCROLL isn't set.\n");
7399 ok(!(ret & ES_AUTOVSCROLL), "ES_AUTOVSCROLL is set.\n");
7400 ok(!(ret & ES_AUTOHSCROLL), "ES_AUTOHSCROLL is set.\n");
7402
7405 0, 0, 200, 60, NULL, NULL, hmoduleRichEdit, NULL);
7406 ok(hwnd != NULL, "class: %s, error: %d\n", RICHEDIT_CLASS20A, (int) GetLastError());
7408 ok(!(ret & ECO_AUTOVSCROLL), "ECO_AUTOVSCROLL is set.\n");
7409 ok(!(ret & ECO_AUTOHSCROLL), "ECO_AUTOHSCROLL is set.\n");
7411 ok(!(ret & ES_AUTOVSCROLL), "ES_AUTOVSCROLL is set.\n");
7412 ok(!(ret & ES_AUTOHSCROLL), "ES_AUTOHSCROLL is set.\n");
7414}
#define trace
Definition: atltest.h:70
#define pt(x, y)
Definition: drawing.c:79
static HWND new_richedit(HWND parent)
Definition: editor.c:101
unsigned int UINT
Definition: ndis.h:50
#define ES_AUTOVSCROLL
Definition: pedump.c:671
#define ES_AUTOHSCROLL
Definition: pedump.c:672
void redraw(int x, int y, int cx, int cy)
Definition: qtewin.cpp:1248
#define EM_GETOPTIONS
Definition: richedit.h:111
#define ECO_AUTOHSCROLL
Definition: richedit.h:458
#define ECO_AUTOVSCROLL
Definition: richedit.h:457
eMaj lines
Definition: tritemp.h:206
HWND WINAPI CreateWindowExA(_In_ DWORD dwExStyle, _In_opt_ LPCSTR lpClassName, _In_opt_ LPCSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
LONG WINAPI GetWindowLongA(_In_ HWND, _In_ int)
#define EM_REPLACESEL
Definition: winuser.h:2009
#define EM_GETLINECOUNT
Definition: winuser.h:1995
#define WM_SETREDRAW
Definition: winuser.h:1619

Referenced by START_TEST().

◆ test_background()

static void test_background ( void  )
static

Definition at line 8821 of file editor.c.

8822{
8823 HWND hwndRichEdit = new_richedit(NULL);
8824
8825 /* set the background color to black */
8826 ValidateRect(hwndRichEdit, NULL);
8827 SendMessageA(hwndRichEdit, EM_SETBKGNDCOLOR, FALSE, RGB(0, 0, 0));
8828 ok(GetUpdateRect(hwndRichEdit, NULL, FALSE), "Update rectangle is empty!\n");
8829
8830 DestroyWindow(hwndRichEdit);
8831}
#define RGB(r, g, b)
Definition: precomp.h:71
#define EM_SETBKGNDCOLOR
Definition: richedit.h:100
BOOL WINAPI ValidateRect(_In_opt_ HWND, _In_opt_ LPCRECT)
BOOL WINAPI GetUpdateRect(_In_ HWND, _Out_opt_ LPRECT, _In_ BOOL)

Referenced by START_TEST().

◆ test_dialogmode()

static void test_dialogmode ( void  )
static

Definition at line 7949 of file editor.c.

7950{
7951 HWND hwRichEdit, hwParent, hwButton;
7952 MSG msg= {0};
7953 int lcount, r;
7954 WNDCLASSA cls;
7955
7956 cls.style = 0;
7958 cls.cbClsExtra = 0;
7959 cls.cbWndExtra = 0;
7960 cls.hInstance = GetModuleHandleA(0);
7961 cls.hIcon = 0;
7964 cls.lpszMenuName = NULL;
7965 cls.lpszClassName = "DialogModeParentClass";
7966 if(!RegisterClassA(&cls)) assert(0);
7967
7968 hwParent = CreateWindowA("DialogModeParentClass", NULL, WS_OVERLAPPEDWINDOW,
7969 CW_USEDEFAULT, 0, 200, 120, NULL, NULL, GetModuleHandleA(0), NULL);
7970
7971 /* Test richedit(ES_MULTILINE) */
7972
7973 hwRichEdit = new_window(RICHEDIT_CLASS20A, ES_MULTILINE, hwParent);
7974
7975 r = SendMessageA(hwRichEdit, WM_KEYDOWN, VK_RETURN, 0x1c0001);
7976 ok(0 == r, "expected 0, got %d\n", r);
7977 lcount = SendMessageA(hwRichEdit, EM_GETLINECOUNT, 0, 0);
7978 ok(2 == lcount, "expected 2, got %d\n", lcount);
7979
7980 r = SendMessageA(hwRichEdit, WM_GETDLGCODE, 0, 0);
7981 ok(0x8f == r, "expected 0x8f, got 0x%x\n", r);
7982
7983 r = SendMessageA(hwRichEdit, WM_KEYDOWN, VK_RETURN, 0x1c0001);
7984 ok(0 == r, "expected 0, got %d\n", r);
7985 lcount = SendMessageA(hwRichEdit, EM_GETLINECOUNT, 0, 0);
7986 ok(3 == lcount, "expected 3, got %d\n", lcount);
7987
7988 r = SendMessageA(hwRichEdit, WM_GETDLGCODE, 0, (LPARAM)&msg);
7989 ok(0x8f == r, "expected 0x8f, got 0x%x\n", r);
7990 r = SendMessageA(hwRichEdit, WM_KEYDOWN, VK_RETURN, 0x1c0001);
7991 ok(0 == r, "expected 0, got %d\n", r);
7992 lcount = SendMessageA(hwRichEdit, EM_GETLINECOUNT, 0, 0);
7993 ok(3 == lcount, "expected 3, got %d\n", lcount);
7994
7995 DestroyWindow(hwRichEdit);
7996
7997 /* Test standalone richedit(ES_MULTILINE) */
7998
8000
8001 r = SendMessageA(hwRichEdit, WM_KEYDOWN, VK_RETURN, 0x1c0001);
8002 ok(0 == r, "expected 0, got %d\n", r);
8003 lcount = SendMessageA(hwRichEdit, EM_GETLINECOUNT, 0, 0);
8004 ok(2 == lcount, "expected 2, got %d\n", lcount);
8005
8006 r = SendMessageA(hwRichEdit, WM_GETDLGCODE, 0, (LPARAM)&msg);
8007 ok(0x8f == r, "expected 0x8f, got 0x%x\n", r);
8008
8009 r = SendMessageA(hwRichEdit, WM_KEYDOWN, VK_RETURN, 0x1c0001);
8010 ok(0 == r, "expected 0, got %d\n", r);
8011 lcount = SendMessageA(hwRichEdit, EM_GETLINECOUNT, 0, 0);
8012 ok(2 == lcount, "expected 2, got %d\n", lcount);
8013
8014 DestroyWindow(hwRichEdit);
8015
8016 /* Check a destination for messages */
8017
8018 hwRichEdit = new_window(RICHEDIT_CLASS20A, ES_MULTILINE, hwParent);
8019
8020 SetWindowLongA(hwRichEdit, GWL_STYLE, GetWindowLongA(hwRichEdit, GWL_STYLE)& ~WS_POPUP);
8021 SetParent( hwRichEdit, NULL);
8022
8023 r = SendMessageA(hwRichEdit, WM_GETDLGCODE, 0, (LPARAM)&msg);
8024 ok(0x8f == r, "expected 0x8f, got 0x%x\n", r);
8025
8026 memset(&dm_messages, 0, sizeof(dm_messages));
8027 r = SendMessageA(hwRichEdit, WM_KEYDOWN, VK_RETURN, 0x1c0001);
8028 ok(0 == r, "expected 0, got %d\n", r);
8029 test_dm_messages(0, 1, 0);
8030
8031 memset(&dm_messages, 0, sizeof(dm_messages));
8032 r = SendMessageA(hwRichEdit, WM_KEYDOWN, VK_TAB, 0xf0001);
8033 ok(0 == r, "expected 0, got %d\n", r);
8034 test_dm_messages(0, 0, 1);
8035
8036 DestroyWindow(hwRichEdit);
8037
8038 /* Check messages from richedit(ES_MULTILINE) */
8039
8040 hwRichEdit = new_window(RICHEDIT_CLASS20A, ES_MULTILINE, hwParent);
8041
8042 memset(&dm_messages, 0, sizeof(dm_messages));
8043 r = SendMessageA(hwRichEdit, WM_KEYDOWN, VK_RETURN, 0x1c0001);
8044 ok(0 == r, "expected 0, got %d\n", r);
8045 test_dm_messages(0, 0, 0);
8046
8047 lcount = SendMessageA(hwRichEdit, EM_GETLINECOUNT, 0, 0);
8048 ok(2 == lcount, "expected 2, got %d\n", lcount);
8049
8050 memset(&dm_messages, 0, sizeof(dm_messages));
8051 r = SendMessageA(hwRichEdit, WM_KEYDOWN, VK_ESCAPE, 0x10001);
8052 ok(0 == r, "expected 0, got %d\n", r);
8053 test_dm_messages(0, 0, 0);
8054
8055 memset(&dm_messages, 0, sizeof(dm_messages));
8056 r = SendMessageA(hwRichEdit, WM_KEYDOWN, VK_TAB, 0xf0001);
8057 ok(0 == r, "expected 0, got %d\n", r);
8058 test_dm_messages(0, 0, 0);
8059
8060 memset(&dm_messages, 0, sizeof(dm_messages));
8061 r = SendMessageA(hwRichEdit, WM_GETDLGCODE, 0, (LPARAM)&msg);
8062 ok(0x8f == r, "expected 0x8f, got 0x%x\n", r);
8063 test_dm_messages(0, 0, 0);
8064
8065 memset(&dm_messages, 0, sizeof(dm_messages));
8066 r = SendMessageA(hwRichEdit, WM_KEYDOWN, VK_RETURN, 0x1c0001);
8067 ok(0 == r, "expected 0, got %d\n", r);
8068 test_dm_messages(0, 1, 0);
8069
8070 lcount = SendMessageA(hwRichEdit, EM_GETLINECOUNT, 0, 0);
8071 ok(2 == lcount, "expected 2, got %d\n", lcount);
8072
8073 memset(&dm_messages, 0, sizeof(dm_messages));
8074 r = SendMessageA(hwRichEdit, WM_KEYDOWN, VK_ESCAPE, 0x10001);
8075 ok(0 == r, "expected 0, got %d\n", r);
8076 test_dm_messages(0, 0, 0);
8077
8078 memset(&dm_messages, 0, sizeof(dm_messages));
8079 r = SendMessageA(hwRichEdit, WM_KEYDOWN, VK_TAB, 0xf0001);
8080 ok(0 == r, "expected 0, got %d\n", r);
8081 test_dm_messages(0, 0, 1);
8082
8083 hwButton = CreateWindowA("BUTTON", "OK", WS_VISIBLE|WS_CHILD|BS_PUSHBUTTON,
8084 100, 100, 50, 20, hwParent, (HMENU)ID_RICHEDITTESTDBUTTON, GetModuleHandleA(0), NULL);
8085 ok(hwButton!=NULL, "CreateWindow failed with error code %d\n", GetLastError());
8086
8087 memset(&dm_messages, 0, sizeof(dm_messages));
8088 r = SendMessageA(hwRichEdit, WM_KEYDOWN, VK_RETURN, 0x1c0001);
8089 ok(0 == r, "expected 0, got %d\n", r);
8090 test_dm_messages(0, 1, 1);
8091
8092 lcount = SendMessageA(hwRichEdit, EM_GETLINECOUNT, 0, 0);
8093 ok(2 == lcount, "expected 2, got %d\n", lcount);
8094
8095 DestroyWindow(hwButton);
8096 DestroyWindow(hwRichEdit);
8097
8098 /* Check messages from richedit(ES_MULTILINE|ES_WANTRETURN) */
8099
8100 hwRichEdit = new_window(RICHEDIT_CLASS20A, ES_MULTILINE|ES_WANTRETURN, hwParent);
8101
8102 memset(&dm_messages, 0, sizeof(dm_messages));
8103 r = SendMessageA(hwRichEdit, WM_KEYDOWN, VK_RETURN, 0x1c0001);
8104 ok(0 == r, "expected 0, got %d\n", r);
8105 test_dm_messages(0, 0, 0);
8106
8107 lcount = SendMessageA(hwRichEdit, EM_GETLINECOUNT, 0, 0);
8108 ok(2 == lcount, "expected 2, got %d\n", lcount);
8109
8110 memset(&dm_messages, 0, sizeof(dm_messages));
8111 r = SendMessageA(hwRichEdit, WM_KEYDOWN, VK_ESCAPE, 0x10001);
8112 ok(0 == r, "expected 0, got %d\n", r);
8113 test_dm_messages(0, 0, 0);
8114
8115 memset(&dm_messages, 0, sizeof(dm_messages));
8116 r = SendMessageA(hwRichEdit, WM_KEYDOWN, VK_TAB, 0xf0001);
8117 ok(0 == r, "expected 0, got %d\n", r);
8118 test_dm_messages(0, 0, 0);
8119
8120 memset(&dm_messages, 0, sizeof(dm_messages));
8121 r = SendMessageA(hwRichEdit, WM_GETDLGCODE, 0, (LPARAM)&msg);
8122 ok(0x8f == r, "expected 0x8f, got 0x%x\n", r);
8123 test_dm_messages(0, 0, 0);
8124
8125 memset(&dm_messages, 0, sizeof(dm_messages));
8126 r = SendMessageA(hwRichEdit, WM_KEYDOWN, VK_RETURN, 0x1c0001);
8127 ok(0 == r, "expected 0, got %d\n", r);
8128 test_dm_messages(0, 0, 0);
8129
8130 lcount = SendMessageA(hwRichEdit, EM_GETLINECOUNT, 0, 0);
8131 ok(3 == lcount, "expected 3, got %d\n", lcount);
8132
8133 memset(&dm_messages, 0, sizeof(dm_messages));
8134 r = SendMessageA(hwRichEdit, WM_KEYDOWN, VK_ESCAPE, 0x10001);
8135 ok(0 == r, "expected 0, got %d\n", r);
8136 test_dm_messages(0, 0, 0);
8137
8138 memset(&dm_messages, 0, sizeof(dm_messages));
8139 r = SendMessageA(hwRichEdit, WM_KEYDOWN, VK_TAB, 0xf0001);
8140 ok(0 == r, "expected 0, got %d\n", r);
8141 test_dm_messages(0, 0, 1);
8142
8143 hwButton = CreateWindowA("BUTTON", "OK", WS_VISIBLE|WS_CHILD|BS_PUSHBUTTON,
8144 100, 100, 50, 20, hwParent, (HMENU)ID_RICHEDITTESTDBUTTON, GetModuleHandleA(0), NULL);
8145 ok(hwButton!=NULL, "CreateWindow failed with error code %d\n", GetLastError());
8146
8147 memset(&dm_messages, 0, sizeof(dm_messages));
8148 r = SendMessageA(hwRichEdit, WM_KEYDOWN, VK_RETURN, 0x1c0001);
8149 ok(0 == r, "expected 0, got %d\n", r);
8150 test_dm_messages(0, 0, 0);
8151
8152 lcount = SendMessageA(hwRichEdit, EM_GETLINECOUNT, 0, 0);
8153 ok(4 == lcount, "expected 4, got %d\n", lcount);
8154
8155 DestroyWindow(hwButton);
8156 DestroyWindow(hwRichEdit);
8157
8158 /* Check messages from richedit(0) */
8159
8160 hwRichEdit = new_window(RICHEDIT_CLASS20A, 0, hwParent);
8161
8162 memset(&dm_messages, 0, sizeof(dm_messages));
8163 r = SendMessageA(hwRichEdit, WM_KEYDOWN, VK_RETURN, 0x1c0001);
8164 ok(0 == r, "expected 0, got %d\n", r);
8165 test_dm_messages(0, 0, 0);
8166
8167 memset(&dm_messages, 0, sizeof(dm_messages));
8168 r = SendMessageA(hwRichEdit, WM_KEYDOWN, VK_ESCAPE, 0x10001);
8169 ok(0 == r, "expected 0, got %d\n", r);
8170 test_dm_messages(0, 0, 0);
8171
8172 memset(&dm_messages, 0, sizeof(dm_messages));
8173 r = SendMessageA(hwRichEdit, WM_KEYDOWN, VK_TAB, 0xf0001);
8174 ok(0 == r, "expected 0, got %d\n", r);
8175 test_dm_messages(0, 0, 0);
8176
8177 memset(&dm_messages, 0, sizeof(dm_messages));
8178 r = SendMessageA(hwRichEdit, WM_GETDLGCODE, 0, (LPARAM)&msg);
8179 ok(0x8b == r, "expected 0x8b, got 0x%x\n", r);
8180 test_dm_messages(0, 0, 0);
8181
8182 memset(&dm_messages, 0, sizeof(dm_messages));
8183 r = SendMessageA(hwRichEdit, WM_KEYDOWN, VK_RETURN, 0x1c0001);
8184 ok(0 == r, "expected 0, got %d\n", r);
8185 test_dm_messages(0, 1, 0);
8186
8187 memset(&dm_messages, 0, sizeof(dm_messages));
8188 r = SendMessageA(hwRichEdit, WM_KEYDOWN, VK_ESCAPE, 0x10001);
8189 ok(0 == r, "expected 0, got %d\n", r);
8190 test_dm_messages(0, 0, 0);
8191
8192 memset(&dm_messages, 0, sizeof(dm_messages));
8193 r = SendMessageA(hwRichEdit, WM_KEYDOWN, VK_TAB, 0xf0001);
8194 ok(0 == r, "expected 0, got %d\n", r);
8195 test_dm_messages(0, 0, 1);
8196
8197 hwButton = CreateWindowA("BUTTON", "OK", WS_VISIBLE|WS_CHILD|BS_PUSHBUTTON,
8198 100, 100, 50, 20, hwParent, (HMENU)ID_RICHEDITTESTDBUTTON, GetModuleHandleA(0), NULL);
8199 ok(hwButton!=NULL, "CreateWindow failed with error code %d\n", GetLastError());
8200
8201 memset(&dm_messages, 0, sizeof(dm_messages));
8202 r = SendMessageA(hwRichEdit, WM_KEYDOWN, VK_RETURN, 0x1c0001);
8203 ok(0 == r, "expected 0, got %d\n", r);
8204 test_dm_messages(0, 1, 1);
8205
8206 DestroyWindow(hwRichEdit);
8207
8208 /* Check messages from richedit(ES_WANTRETURN) */
8209
8210 hwRichEdit = new_window(RICHEDIT_CLASS20A, ES_WANTRETURN, hwParent);
8211
8212 memset(&dm_messages, 0, sizeof(dm_messages));
8213 r = SendMessageA(hwRichEdit, WM_KEYDOWN, VK_RETURN, 0x1c0001);
8214 ok(0 == r, "expected 0, got %d\n", r);
8215 test_dm_messages(0, 0, 0);
8216
8217 memset(&dm_messages, 0, sizeof(dm_messages));
8218 r = SendMessageA(hwRichEdit, WM_GETDLGCODE, 0, (LPARAM)&msg);
8219 ok(0x8b == r, "expected 0x8b, got 0x%x\n", r);
8220 test_dm_messages(0, 0, 0);
8221
8222 memset(&dm_messages, 0, sizeof(dm_messages));
8223 r = SendMessageA(hwRichEdit, WM_KEYDOWN, VK_RETURN, 0x1c0001);
8224 ok(0 == r, "expected 0, got %d\n", r);
8225 test_dm_messages(0, 0, 0);
8226
8227 hwButton = CreateWindowA("BUTTON", "OK", WS_VISIBLE|WS_CHILD|BS_PUSHBUTTON,
8228 100, 100, 50, 20, hwParent, (HMENU)ID_RICHEDITTESTDBUTTON, GetModuleHandleA(0), NULL);
8229 ok(hwButton!=NULL, "CreateWindow failed with error code %d\n", GetLastError());
8230
8231 memset(&dm_messages, 0, sizeof(dm_messages));
8232 r = SendMessageA(hwRichEdit, WM_KEYDOWN, VK_RETURN, 0x1c0001);
8233 ok(0 == r, "expected 0, got %d\n", r);
8234 test_dm_messages(0, 0, 0);
8235
8236 DestroyWindow(hwRichEdit);
8237 DestroyWindow(hwParent);
8238}
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:812
#define assert(x)
Definition: debug.h:53
static LRESULT CALLBACK dialog_mode_wnd_proc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
Definition: editor.c:7931
#define test_dm_messages(wmclose, wmgetdefid, wmnextdlgctl)
Definition: editor.c:7923
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:63
#define WS_CHILD
Definition: pedump.c:617
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
#define ES_WANTRETURN
Definition: pedump.c:676
#define BS_PUSHBUTTON
Definition: pedump.c:651
HBRUSH hbrBackground
Definition: winuser.h:3173
HICON hIcon
Definition: winuser.h:3171
HINSTANCE hInstance
Definition: winuser.h:3170
HCURSOR hCursor
Definition: winuser.h:3172
int cbWndExtra
Definition: winuser.h:3169
UINT style
Definition: winuser.h:3166
LPCSTR lpszMenuName
Definition: winuser.h:3174
LPCSTR lpszClassName
Definition: winuser.h:3175
WNDPROC lpfnWndProc
Definition: winuser.h:3167
int cbClsExtra
Definition: winuser.h:3168
HGDIOBJ WINAPI GetStockObject(_In_ int)
#define WHITE_BRUSH
Definition: wingdi.h:902
#define VK_TAB
Definition: winuser.h:2202
LONG WINAPI SetWindowLongA(_In_ HWND, _In_ int, _In_ LONG)
HWND WINAPI SetParent(_In_ HWND, _In_opt_ HWND)
#define IDC_ARROW
Definition: winuser.h:687
ATOM WINAPI RegisterClassA(_In_ CONST WNDCLASSA *)
#define VK_RETURN
Definition: winuser.h:2204
#define CW_USEDEFAULT
Definition: winuser.h:225
#define VK_ESCAPE
Definition: winuser.h:2217
#define WM_GETDLGCODE
Definition: winuser.h:1692
HCURSOR WINAPI LoadCursorA(_In_opt_ HINSTANCE, _In_ LPCSTR)
Definition: cursoricon.c:2176
const char * LPCSTR
Definition: xmlstorage.h:183

Referenced by START_TEST().

◆ test_EM_AUTOURLDETECT()

static void test_EM_AUTOURLDETECT ( void  )
static

Definition at line 1970 of file editor.c.

1971{
1972 /* DO NOT change the properties of the first two elements. To shorten the
1973 tests, all tests after WM_SETTEXT test just the first two elements -
1974 one non-URL and one URL */
1975 struct urls_s {
1976 const char *text;
1977 BOOL is_url;
1978 } urls[12] = {
1979 {"winehq.org", FALSE},
1980 {"http://www.winehq.org", TRUE},
1981 {"http//winehq.org", FALSE},
1982 {"ww.winehq.org", FALSE},
1983 {"www.winehq.org", TRUE},
1984 {"ftp://192.168.1.1", TRUE},
1985 {"ftp//192.168.1.1", FALSE},
1986 {"mailto:your@email.com", TRUE},
1987 {"prospero:prosperoserver", TRUE},
1988 {"telnet:test", TRUE},
1989 {"news:newserver", TRUE},
1990 {"wais:waisserver", TRUE}
1991 };
1992
1993 int i, j;
1994 int urlRet=-1;
1995 HWND hwndRichEdit, parent;
1996
1997 /* All of the following should cause the URL to be detected */
1998 const char * templates_delim[] = {
1999 "This is some text with X on it",
2000 "This is some text with (X) on it",
2001 "This is some text with X\r on it",
2002 "This is some text with ---X--- on it",
2003 "This is some text with \"X\" on it",
2004 "This is some text with 'X' on it",
2005 "This is some text with 'X' on it",
2006 "This is some text with :X: on it",
2007
2008 "This text ends with X",
2009
2010 "This is some text with X) on it",
2011 "This is some text with X--- on it",
2012 "This is some text with X\" on it",
2013 "This is some text with X' on it",
2014 "This is some text with X: on it",
2015
2016 "This is some text with (X on it",
2017 "This is some text with \rX on it",
2018 "This is some text with ---X on it",
2019 "This is some text with \"X on it",
2020 "This is some text with 'X on it",
2021 "This is some text with :X on it",
2022 };
2023 /* None of these should cause the URL to be detected */
2024 const char * templates_non_delim[] = {
2025 "This is some text with |X| on it",
2026 "This is some text with *X* on it",
2027 "This is some text with /X/ on it",
2028 "This is some text with +X+ on it",
2029 "This is some text with %X% on it",
2030 "This is some text with #X# on it",
2031 "This is some text with @X@ on it",
2032 "This is some text with \\X\\ on it",
2033 "This is some text with |X on it",
2034 "This is some text with *X on it",
2035 "This is some text with /X on it",
2036 "This is some text with +X on it",
2037 "This is some text with %X on it",
2038 "This is some text with #X on it",
2039 "This is some text with @X on it",
2040 "This is some text with \\X on it",
2041 "This is some text with _X on it",
2042 };
2043 /* All of these cause the URL detection to be extended by one more byte,
2044 thus demonstrating that the tested character is considered as part
2045 of the URL. */
2046 const char * templates_xten_delim[] = {
2047 "This is some text with X| on it",
2048 "This is some text with X* on it",
2049 "This is some text with X/ on it",
2050 "This is some text with X+ on it",
2051 "This is some text with X% on it",
2052 "This is some text with X# on it",
2053 "This is some text with X@ on it",
2054 "This is some text with X\\ on it",
2055 "This is some text with X_ on it",
2056 };
2057 /* These delims act as neutral breaks. Whether the url is ended
2058 or not depends on the next non-neutral character. We'll test
2059 with Y unchanged, in which case the url should include the
2060 deliminator and the Y. We'll also test with the Y changed
2061 to a space, in which case the url stops before the
2062 deliminator. */
2063 const char * templates_neutral_delim[] = {
2064 "This is some text with X-Y on it",
2065 "This is some text with X--Y on it",
2066 "This is some text with X!Y on it",
2067 "This is some text with X[Y on it",
2068 "This is some text with X]Y on it",
2069 "This is some text with X{Y on it",
2070 "This is some text with X}Y on it",
2071 "This is some text with X(Y on it",
2072 "This is some text with X)Y on it",
2073 "This is some text with X\"Y on it",
2074 "This is some text with X;Y on it",
2075 "This is some text with X:Y on it",
2076 "This is some text with X'Y on it",
2077 "This is some text with X?Y on it",
2078 "This is some text with X<Y on it",
2079 "This is some text with X>Y on it",
2080 "This is some text with X.Y on it",
2081 "This is some text with X,Y on it",
2082 };
2083 char buffer[1024];
2084
2086 hwndRichEdit = new_richedit(parent);
2087 /* Try and pass EM_AUTOURLDETECT some test wParam values */
2088 urlRet=SendMessageA(hwndRichEdit, EM_AUTOURLDETECT, FALSE, 0);
2089 ok(urlRet==0, "Good wParam: urlRet is: %d\n", urlRet);
2090 urlRet=SendMessageA(hwndRichEdit, EM_AUTOURLDETECT, 1, 0);
2091 ok(urlRet==0, "Good wParam2: urlRet is: %d\n", urlRet);
2092 /* Windows returns -2147024809 (0x80070057) on bad wParam values */
2093 urlRet=SendMessageA(hwndRichEdit, EM_AUTOURLDETECT, 8, 0);
2094 ok(urlRet==E_INVALIDARG, "Bad wParam: urlRet is: %d\n", urlRet);
2095 urlRet=SendMessageA(hwndRichEdit, EM_AUTOURLDETECT, (WPARAM)"h", (LPARAM)"h");
2096 ok(urlRet==E_INVALIDARG, "Bad wParam2: urlRet is: %d\n", urlRet);
2097 /* for each url, check the text to see if CFE_LINK effect is present */
2098 for (i = 0; i < ARRAY_SIZE(urls); i++) {
2099
2100 SendMessageA(hwndRichEdit, EM_AUTOURLDETECT, FALSE, 0);
2101 SendMessageA(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)urls[i].text);
2102 check_CFE_LINK_rcvd(hwndRichEdit, FALSE, urls[i].text);
2103
2104 /* Link detection should happen immediately upon WM_SETTEXT */
2105 SendMessageA(hwndRichEdit, EM_AUTOURLDETECT, TRUE, 0);
2106 SendMessageA(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)urls[i].text);
2107 check_CFE_LINK_rcvd(hwndRichEdit, urls[i].is_url, urls[i].text);
2108 }
2109 DestroyWindow(hwndRichEdit);
2110
2111 /* Test detection of URLs within normal text - WM_SETTEXT case. */
2112 for (i = 0; i < ARRAY_SIZE(urls); i++) {
2113 hwndRichEdit = new_richedit(parent);
2114
2115 for (j = 0; j < ARRAY_SIZE(templates_delim); j++) {
2116 char * at_pos;
2117 int at_offset;
2118 int end_offset;
2119
2120 at_pos = strchr(templates_delim[j], 'X');
2121 at_offset = at_pos - templates_delim[j];
2122 memcpy(buffer, templates_delim[j], at_offset);
2123 buffer[at_offset] = '\0';
2124 strcat(buffer, urls[i].text);
2125 strcat(buffer, templates_delim[j] + at_offset + 1);
2126 end_offset = at_offset + strlen(urls[i].text);
2127
2128 SendMessageA(hwndRichEdit, EM_AUTOURLDETECT, TRUE, 0);
2129 SendMessageA(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)buffer);
2130
2131 /* This assumes no templates start with the URL itself, and that they
2132 have at least two characters before the URL text */
2133 ok(!check_CFE_LINK_selection(hwndRichEdit, 0, 1),
2134 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", 0, 1, buffer);
2135 ok(!check_CFE_LINK_selection(hwndRichEdit, at_offset -2, at_offset -1),
2136 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -2, at_offset -1, buffer);
2137 ok(!check_CFE_LINK_selection(hwndRichEdit, at_offset -1, at_offset),
2138 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -1, at_offset, buffer);
2139
2140 if (urls[i].is_url)
2141 {
2142 ok(check_CFE_LINK_selection(hwndRichEdit, at_offset, at_offset +1),
2143 "CFE_LINK not set in (%d-%d), text: %s\n", at_offset, at_offset +1, buffer);
2144 ok(check_CFE_LINK_selection(hwndRichEdit, end_offset -1, end_offset),
2145 "CFE_LINK not set in (%d-%d), text: %s\n", end_offset -1, end_offset, buffer);
2146 }
2147 else
2148 {
2149 ok(!check_CFE_LINK_selection(hwndRichEdit, at_offset, at_offset +1),
2150 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset, at_offset + 1, buffer);
2151 ok(!check_CFE_LINK_selection(hwndRichEdit, end_offset -1, end_offset),
2152 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset -1, end_offset, buffer);
2153 }
2154 if (buffer[end_offset] != '\0')
2155 {
2156 ok(!check_CFE_LINK_selection(hwndRichEdit, end_offset, end_offset +1),
2157 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset, end_offset + 1, buffer);
2158 if (buffer[end_offset +1] != '\0')
2159 {
2160 ok(!check_CFE_LINK_selection(hwndRichEdit, end_offset +1, end_offset +2),
2161 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset +1, end_offset +2, buffer);
2162 }
2163 }
2164 }
2165
2166 for (j = 0; j < ARRAY_SIZE(templates_non_delim); j++) {
2167 char * at_pos;
2168 int at_offset;
2169 int end_offset;
2170
2171 at_pos = strchr(templates_non_delim[j], 'X');
2172 at_offset = at_pos - templates_non_delim[j];
2173 memcpy(buffer, templates_non_delim[j], at_offset);
2174 buffer[at_offset] = '\0';
2175 strcat(buffer, urls[i].text);
2176 strcat(buffer, templates_non_delim[j] + at_offset + 1);
2177 end_offset = at_offset + strlen(urls[i].text);
2178
2179 SendMessageA(hwndRichEdit, EM_AUTOURLDETECT, TRUE, 0);
2180 SendMessageA(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)buffer);
2181
2182 /* This assumes no templates start with the URL itself, and that they
2183 have at least two characters before the URL text */
2184 ok(!check_CFE_LINK_selection(hwndRichEdit, 0, 1),
2185 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", 0, 1, buffer);
2186 ok(!check_CFE_LINK_selection(hwndRichEdit, at_offset -2, at_offset -1),
2187 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -2, at_offset -1, buffer);
2188 ok(!check_CFE_LINK_selection(hwndRichEdit, at_offset -1, at_offset),
2189 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -1, at_offset, buffer);
2190
2191 ok(!check_CFE_LINK_selection(hwndRichEdit, at_offset, at_offset +1),
2192 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset, at_offset + 1, buffer);
2193 ok(!check_CFE_LINK_selection(hwndRichEdit, end_offset -1, end_offset),
2194 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset -1, end_offset, buffer);
2195 if (buffer[end_offset] != '\0')
2196 {
2197 ok(!check_CFE_LINK_selection(hwndRichEdit, end_offset, end_offset +1),
2198 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset, end_offset + 1, buffer);
2199 if (buffer[end_offset +1] != '\0')
2200 {
2201 ok(!check_CFE_LINK_selection(hwndRichEdit, end_offset +1, end_offset +2),
2202 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset +1, end_offset +2, buffer);
2203 }
2204 }
2205 }
2206
2207 for (j = 0; j < ARRAY_SIZE(templates_xten_delim); j++) {
2208 char * at_pos;
2209 int at_offset;
2210 int end_offset;
2211
2212 at_pos = strchr(templates_xten_delim[j], 'X');
2213 at_offset = at_pos - templates_xten_delim[j];
2214 memcpy(buffer, templates_xten_delim[j], at_offset);
2215 buffer[at_offset] = '\0';
2216 strcat(buffer, urls[i].text);
2217 strcat(buffer, templates_xten_delim[j] + at_offset + 1);
2218 end_offset = at_offset + strlen(urls[i].text);
2219
2220 SendMessageA(hwndRichEdit, EM_AUTOURLDETECT, TRUE, 0);
2221 SendMessageA(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)buffer);
2222
2223 /* This assumes no templates start with the URL itself, and that they
2224 have at least two characters before the URL text */
2225 ok(!check_CFE_LINK_selection(hwndRichEdit, 0, 1),
2226 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", 0, 1, buffer);
2227 ok(!check_CFE_LINK_selection(hwndRichEdit, at_offset -2, at_offset -1),
2228 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -2, at_offset -1, buffer);
2229 ok(!check_CFE_LINK_selection(hwndRichEdit, at_offset -1, at_offset),
2230 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -1, at_offset, buffer);
2231
2232 if (urls[i].is_url)
2233 {
2234 ok(check_CFE_LINK_selection(hwndRichEdit, at_offset, at_offset +1),
2235 "CFE_LINK not set in (%d-%d), text: %s\n", at_offset, at_offset +1, buffer);
2236 ok(check_CFE_LINK_selection(hwndRichEdit, end_offset -1, end_offset),
2237 "CFE_LINK not set in (%d-%d), text: %s\n", end_offset -1, end_offset, buffer);
2238 ok(check_CFE_LINK_selection(hwndRichEdit, end_offset, end_offset +1),
2239 "CFE_LINK not set in (%d-%d), text: %s\n", end_offset, end_offset +1, buffer);
2240 }
2241 else
2242 {
2243 ok(!check_CFE_LINK_selection(hwndRichEdit, at_offset, at_offset +1),
2244 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset, at_offset + 1, buffer);
2245 ok(!check_CFE_LINK_selection(hwndRichEdit, end_offset -1, end_offset),
2246 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset -1, end_offset, buffer);
2247 ok(!check_CFE_LINK_selection(hwndRichEdit, end_offset, end_offset +1),
2248 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset, end_offset +1, buffer);
2249 }
2250 if (buffer[end_offset +1] != '\0')
2251 {
2252 ok(!check_CFE_LINK_selection(hwndRichEdit, end_offset +1, end_offset +2),
2253 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset +1, end_offset + 2, buffer);
2254 if (buffer[end_offset +2] != '\0')
2255 {
2256 ok(!check_CFE_LINK_selection(hwndRichEdit, end_offset +2, end_offset +3),
2257 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset +2, end_offset +3, buffer);
2258 }
2259 }
2260 }
2261
2262 for (j = 0; j < ARRAY_SIZE(templates_neutral_delim); j++) {
2263 char * at_pos, * end_pos;
2264 int at_offset;
2265 int end_offset;
2266
2267 if (!urls[i].is_url) continue;
2268
2269 at_pos = strchr(templates_neutral_delim[j], 'X');
2270 at_offset = at_pos - templates_neutral_delim[j];
2271 memcpy(buffer, templates_neutral_delim[j], at_offset);
2272 buffer[at_offset] = '\0';
2273 strcat(buffer, urls[i].text);
2274 strcat(buffer, templates_neutral_delim[j] + at_offset + 1);
2275
2276 end_pos = strchr(buffer, 'Y');
2277 end_offset = end_pos - buffer;
2278
2279 SendMessageA(hwndRichEdit, EM_AUTOURLDETECT, TRUE, 0);
2280 SendMessageA(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)buffer);
2281
2282 /* This assumes no templates start with the URL itself, and that they
2283 have at least two characters before the URL text */
2284 ok(!check_CFE_LINK_selection(hwndRichEdit, 0, 1),
2285 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", 0, 1, buffer);
2286 ok(!check_CFE_LINK_selection(hwndRichEdit, at_offset -2, at_offset -1),
2287 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -2, at_offset -1, buffer);
2288 ok(!check_CFE_LINK_selection(hwndRichEdit, at_offset -1, at_offset),
2289 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -1, at_offset, buffer);
2290
2291 ok(check_CFE_LINK_selection(hwndRichEdit, at_offset, at_offset +1),
2292 "CFE_LINK not set in (%d-%d), text: %s\n", at_offset, at_offset +1, buffer);
2293 ok(check_CFE_LINK_selection(hwndRichEdit, end_offset -1, end_offset),
2294 "CFE_LINK not set in (%d-%d), text: %s\n", end_offset -1, end_offset, buffer);
2295 ok(check_CFE_LINK_selection(hwndRichEdit, end_offset, end_offset +1),
2296 "CFE_LINK not set in (%d-%d), text: %s\n", end_offset, end_offset +1, buffer);
2297
2298 *end_pos = ' ';
2299
2300 SendMessageA(hwndRichEdit, EM_AUTOURLDETECT, TRUE, 0);
2301 SendMessageA(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)buffer);
2302
2303 ok(check_CFE_LINK_selection(hwndRichEdit, at_offset, at_offset +1),
2304 "CFE_LINK not set in (%d-%d), text: %s\n", at_offset, at_offset +1, buffer);
2305 ok(!check_CFE_LINK_selection(hwndRichEdit, end_offset -1, end_offset),
2306 "CFE_LINK set in (%d-%d), text: %s\n", end_offset -1, end_offset, buffer);
2307 ok(!check_CFE_LINK_selection(hwndRichEdit, end_offset, end_offset +1),
2308 "CFE_LINK set in (%d-%d), text: %s\n", end_offset, end_offset +1, buffer);
2309 }
2310
2311 DestroyWindow(hwndRichEdit);
2312 hwndRichEdit = NULL;
2313 }
2314
2315 /* Test detection of URLs within normal text - WM_CHAR case. */
2316 /* Test only the first two URL examples for brevity */
2317 for (i = 0; i < 2; i++) {
2318 hwndRichEdit = new_richedit(parent);
2319
2320 /* Also for brevity, test only the first three delimiters */
2321 for (j = 0; j < 3; j++) {
2322 char * at_pos;
2323 int at_offset;
2324 int end_offset;
2325 int u, v;
2326
2327 at_pos = strchr(templates_delim[j], 'X');
2328 at_offset = at_pos - templates_delim[j];
2329 end_offset = at_offset + strlen(urls[i].text);
2330
2331 SendMessageA(hwndRichEdit, EM_AUTOURLDETECT, TRUE, 0);
2332 SendMessageA(hwndRichEdit, WM_SETTEXT, 0, 0);
2333 for (u = 0; templates_delim[j][u]; u++) {
2334 if (templates_delim[j][u] == '\r') {
2335 simulate_typing_characters(hwndRichEdit, "\r");
2336 } else if (templates_delim[j][u] != 'X') {
2337 SendMessageA(hwndRichEdit, WM_CHAR, templates_delim[j][u], 1);
2338 } else {
2339 for (v = 0; urls[i].text[v]; v++) {
2340 SendMessageA(hwndRichEdit, WM_CHAR, urls[i].text[v], 1);
2341 }
2342 }
2343 }
2344 SendMessageA(hwndRichEdit, WM_GETTEXT, sizeof(buffer), (LPARAM)buffer);
2345
2346 /* This assumes no templates start with the URL itself, and that they
2347 have at least two characters before the URL text */
2348 ok(!check_CFE_LINK_selection(hwndRichEdit, 0, 1),
2349 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", 0, 1, buffer);
2350 ok(!check_CFE_LINK_selection(hwndRichEdit, at_offset -2, at_offset -1),
2351 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -2, at_offset -1, buffer);
2352 ok(!check_CFE_LINK_selection(hwndRichEdit, at_offset -1, at_offset),
2353 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -1, at_offset, buffer);
2354
2355 if (urls[i].is_url)
2356 {
2357 ok(check_CFE_LINK_selection(hwndRichEdit, at_offset, at_offset +1),
2358 "CFE_LINK not set in (%d-%d), text: %s\n", at_offset, at_offset +1, buffer);
2359 ok(check_CFE_LINK_selection(hwndRichEdit, end_offset -1, end_offset),
2360 "CFE_LINK not set in (%d-%d), text: %s\n", end_offset -1, end_offset, buffer);
2361 }
2362 else
2363 {
2364 ok(!check_CFE_LINK_selection(hwndRichEdit, at_offset, at_offset +1),
2365 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset, at_offset + 1, buffer);
2366 ok(!check_CFE_LINK_selection(hwndRichEdit, end_offset -1, end_offset),
2367 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset -1, end_offset, buffer);
2368 }
2369 if (buffer[end_offset] != '\0')
2370 {
2371 ok(!check_CFE_LINK_selection(hwndRichEdit, end_offset, end_offset +1),
2372 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset, end_offset + 1, buffer);
2373 if (buffer[end_offset +1] != '\0')
2374 {
2375 ok(!check_CFE_LINK_selection(hwndRichEdit, end_offset +1, end_offset +2),
2376 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset +1, end_offset +2, buffer);
2377 }
2378 }
2379
2380 /* The following will insert a paragraph break after the first character
2381 of the URL candidate, thus breaking the URL. It is expected that the
2382 CFE_LINK attribute should break across both pieces of the URL */
2383 SendMessageA(hwndRichEdit, EM_SETSEL, at_offset+1, at_offset+1);
2384 simulate_typing_characters(hwndRichEdit, "\r");
2385 SendMessageA(hwndRichEdit, WM_GETTEXT, sizeof(buffer), (LPARAM)buffer);
2386
2387 ok(!check_CFE_LINK_selection(hwndRichEdit, 0, 1),
2388 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", 0, 1, buffer);
2389 ok(!check_CFE_LINK_selection(hwndRichEdit, at_offset -2, at_offset -1),
2390 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -2, at_offset -1, buffer);
2391 ok(!check_CFE_LINK_selection(hwndRichEdit, at_offset -1, at_offset),
2392 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -1, at_offset, buffer);
2393
2394 ok(!check_CFE_LINK_selection(hwndRichEdit, at_offset, at_offset +1),
2395 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset, at_offset + 1, buffer);
2396 /* end_offset moved because of paragraph break */
2397 ok(!check_CFE_LINK_selection(hwndRichEdit, end_offset -1, end_offset),
2398 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset, end_offset+1, buffer);
2399 ok(buffer[end_offset], "buffer \"%s\" ended prematurely. Is it missing a newline character?\n", buffer);
2400 if (buffer[end_offset] != 0 && buffer[end_offset+1] != '\0')
2401 {
2402 ok(!check_CFE_LINK_selection(hwndRichEdit, end_offset+1, end_offset +2),
2403 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset+1, end_offset +2, buffer);
2404 if (buffer[end_offset +2] != '\0')
2405 {
2406 ok(!check_CFE_LINK_selection(hwndRichEdit, end_offset +2, end_offset +3),
2407 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset +2, end_offset +3, buffer);
2408 }
2409 }
2410
2411 /* The following will remove the just-inserted paragraph break, thus
2412 restoring the URL */
2413 SendMessageA(hwndRichEdit, EM_SETSEL, at_offset+2, at_offset+2);
2414 simulate_typing_characters(hwndRichEdit, "\b");
2415 SendMessageA(hwndRichEdit, WM_GETTEXT, sizeof(buffer), (LPARAM)buffer);
2416
2417 ok(!check_CFE_LINK_selection(hwndRichEdit, 0, 1),
2418 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", 0, 1, buffer);
2419 ok(!check_CFE_LINK_selection(hwndRichEdit, at_offset -2, at_offset -1),
2420 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -2, at_offset -1, buffer);
2421 ok(!check_CFE_LINK_selection(hwndRichEdit, at_offset -1, at_offset),
2422 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -1, at_offset, buffer);
2423
2424 if (urls[i].is_url)
2425 {
2426 ok(check_CFE_LINK_selection(hwndRichEdit, at_offset, at_offset +1),
2427 "CFE_LINK not set in (%d-%d), text: %s\n", at_offset, at_offset +1, buffer);
2428 ok(check_CFE_LINK_selection(hwndRichEdit, end_offset -1, end_offset),
2429 "CFE_LINK not set in (%d-%d), text: %s\n", end_offset -1, end_offset, buffer);
2430 }
2431 else
2432 {
2433 ok(!check_CFE_LINK_selection(hwndRichEdit, at_offset, at_offset +1),
2434 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset, at_offset + 1, buffer);
2435 ok(!check_CFE_LINK_selection(hwndRichEdit, end_offset -1, end_offset),
2436 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset -1, end_offset, buffer);
2437 }
2438 if (buffer[end_offset] != '\0')
2439 {
2440 ok(!check_CFE_LINK_selection(hwndRichEdit, end_offset, end_offset +1),
2441 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset, end_offset + 1, buffer);
2442 if (buffer[end_offset +1] != '\0')
2443 {
2444 ok(!check_CFE_LINK_selection(hwndRichEdit, end_offset +1, end_offset +2),
2445 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset +1, end_offset +2, buffer);
2446 }
2447 }
2448 }
2449 DestroyWindow(hwndRichEdit);
2450 hwndRichEdit = NULL;
2451 }
2452
2453 /* Test detection of URLs within normal text - EM_SETTEXTEX case. */
2454 /* Test just the first two URL examples for brevity */
2455 for (i = 0; i < 2; i++) {
2456 SETTEXTEX st;
2457
2458 hwndRichEdit = new_richedit(parent);
2459
2460 /* There are at least three ways in which EM_SETTEXTEX must cause URLs to
2461 be detected:
2462 1) Set entire text, a la WM_SETTEXT
2463 2) Set a selection of the text to the URL
2464 3) Set a portion of the text at a time, which eventually results in
2465 an URL
2466 All of them should give equivalent results
2467 */
2468
2469 /* Set entire text in one go, like WM_SETTEXT */
2470 for (j = 0; j < ARRAY_SIZE(templates_delim); j++) {
2471 char * at_pos;
2472 int at_offset;
2473 int end_offset;
2474
2475 st.codepage = CP_ACP;
2476 st.flags = ST_DEFAULT;
2477
2478 at_pos = strchr(templates_delim[j], 'X');
2479 at_offset = at_pos - templates_delim[j];
2480 memcpy(buffer, templates_delim[j], at_offset);
2481 buffer[at_offset] = '\0';
2482 strcat(buffer, urls[i].text);
2483 strcat(buffer, templates_delim[j] + at_offset + 1);
2484 end_offset = at_offset + strlen(urls[i].text);
2485
2486 SendMessageA(hwndRichEdit, EM_AUTOURLDETECT, TRUE, 0);
2487 SendMessageA(hwndRichEdit, EM_SETTEXTEX, (WPARAM)&st, (LPARAM)buffer);
2488
2489 /* This assumes no templates start with the URL itself, and that they
2490 have at least two characters before the URL text */
2491 ok(!check_CFE_LINK_selection(hwndRichEdit, 0, 1),
2492 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", 0, 1, buffer);
2493 ok(!check_CFE_LINK_selection(hwndRichEdit, at_offset -2, at_offset -1),
2494 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -2, at_offset -1, buffer);
2495 ok(!check_CFE_LINK_selection(hwndRichEdit, at_offset -1, at_offset),
2496 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -1, at_offset, buffer);
2497
2498 if (urls[i].is_url)
2499 {
2500 ok(check_CFE_LINK_selection(hwndRichEdit, at_offset, at_offset +1),
2501 "CFE_LINK not set in (%d-%d), text: %s\n", at_offset, at_offset +1, buffer);
2502 ok(check_CFE_LINK_selection(hwndRichEdit, end_offset -1, end_offset),
2503 "CFE_LINK not set in (%d-%d), text: %s\n", end_offset -1, end_offset, buffer);
2504 }
2505 else
2506 {
2507 ok(!check_CFE_LINK_selection(hwndRichEdit, at_offset, at_offset +1),
2508 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset, at_offset + 1, buffer);
2509 ok(!check_CFE_LINK_selection(hwndRichEdit, end_offset -1, end_offset),
2510 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset -1, end_offset, buffer);
2511 }
2512 if (buffer[end_offset] != '\0')
2513 {
2514 ok(!check_CFE_LINK_selection(hwndRichEdit, end_offset, end_offset +1),
2515 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset, end_offset + 1, buffer);
2516 if (buffer[end_offset +1] != '\0')
2517 {
2518 ok(!check_CFE_LINK_selection(hwndRichEdit, end_offset +1, end_offset +2),
2519 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset +1, end_offset +2, buffer);
2520 }
2521 }
2522 }
2523
2524 /* Set selection with X to the URL */
2525 for (j = 0; j < ARRAY_SIZE(templates_delim); j++) {
2526 char * at_pos;
2527 int at_offset;
2528 int end_offset;
2529
2530 at_pos = strchr(templates_delim[j], 'X');
2531 at_offset = at_pos - templates_delim[j];
2532 end_offset = at_offset + strlen(urls[i].text);
2533
2534 st.codepage = CP_ACP;
2535 st.flags = ST_DEFAULT;
2536 SendMessageA(hwndRichEdit, EM_AUTOURLDETECT, TRUE, 0);
2537 SendMessageA(hwndRichEdit, EM_SETTEXTEX, (WPARAM)&st, (LPARAM)templates_delim[j]);
2538 st.flags = ST_SELECTION;
2539 SendMessageA(hwndRichEdit, EM_SETSEL, at_offset, at_offset+1);
2540 SendMessageA(hwndRichEdit, EM_SETTEXTEX, (WPARAM)&st, (LPARAM)urls[i].text);
2541 SendMessageA(hwndRichEdit, WM_GETTEXT, sizeof(buffer), (LPARAM)buffer);
2542
2543 /* This assumes no templates start with the URL itself, and that they
2544 have at least two characters before the URL text */
2545 ok(!check_CFE_LINK_selection(hwndRichEdit, 0, 1),
2546 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", 0, 1, buffer);
2547 ok(!check_CFE_LINK_selection(hwndRichEdit, at_offset -2, at_offset -1),
2548 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -2, at_offset -1, buffer);
2549 ok(!check_CFE_LINK_selection(hwndRichEdit, at_offset -1, at_offset),
2550 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -1, at_offset, buffer);
2551
2552 if (urls[i].is_url)
2553 {
2554 ok(check_CFE_LINK_selection(hwndRichEdit, at_offset, at_offset +1),
2555 "CFE_LINK not set in (%d-%d), text: %s\n", at_offset, at_offset +1, buffer);
2556 ok(check_CFE_LINK_selection(hwndRichEdit, end_offset -1, end_offset),
2557 "CFE_LINK not set in (%d-%d), text: %s\n", end_offset -1, end_offset, buffer);
2558 }
2559 else
2560 {
2561 ok(!check_CFE_LINK_selection(hwndRichEdit, at_offset, at_offset +1),
2562 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset, at_offset + 1, buffer);
2563 ok(!check_CFE_LINK_selection(hwndRichEdit, end_offset -1, end_offset),
2564 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset -1, end_offset, buffer);
2565 }
2566 if (buffer[end_offset] != '\0')
2567 {
2568 ok(!check_CFE_LINK_selection(hwndRichEdit, end_offset, end_offset +1),
2569 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset, end_offset + 1, buffer);
2570 if (buffer[end_offset +1] != '\0')
2571 {
2572 ok(!check_CFE_LINK_selection(hwndRichEdit, end_offset +1, end_offset +2),
2573 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset +1, end_offset +2, buffer);
2574 }
2575 }
2576 }
2577
2578 /* Set selection with X to the first character of the URL, then the rest */
2579 for (j = 0; j < ARRAY_SIZE(templates_delim); j++) {
2580 char * at_pos;
2581 int at_offset;
2582 int end_offset;
2583
2584 at_pos = strchr(templates_delim[j], 'X');
2585 at_offset = at_pos - templates_delim[j];
2586 end_offset = at_offset + strlen(urls[i].text);
2587
2588 strcpy(buffer, "YY");
2589 buffer[0] = urls[i].text[0];
2590
2591 st.codepage = CP_ACP;
2592 st.flags = ST_DEFAULT;
2593 SendMessageA(hwndRichEdit, EM_AUTOURLDETECT, TRUE, 0);
2594 SendMessageA(hwndRichEdit, EM_SETTEXTEX, (WPARAM)&st, (LPARAM)templates_delim[j]);
2595 st.flags = ST_SELECTION;
2596 SendMessageA(hwndRichEdit, EM_SETSEL, at_offset, at_offset+1);
2597 SendMessageA(hwndRichEdit, EM_SETTEXTEX, (WPARAM)&st, (LPARAM)buffer);
2598 SendMessageA(hwndRichEdit, EM_SETSEL, at_offset+1, at_offset+2);
2599 SendMessageA(hwndRichEdit, EM_SETTEXTEX, (WPARAM)&st, (LPARAM)(urls[i].text + 1));
2600 SendMessageA(hwndRichEdit, WM_GETTEXT, sizeof(buffer), (LPARAM)buffer);
2601
2602 /* This assumes no templates start with the URL itself, and that they
2603 have at least two characters before the URL text */
2604 ok(!check_CFE_LINK_selection(hwndRichEdit, 0, 1),
2605 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", 0, 1, buffer);
2606 ok(!check_CFE_LINK_selection(hwndRichEdit, at_offset -2, at_offset -1),
2607 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -2, at_offset -1, buffer);
2608 ok(!check_CFE_LINK_selection(hwndRichEdit, at_offset -1, at_offset),
2609 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -1, at_offset, buffer);
2610
2611 if (urls[i].is_url)
2612 {
2613 ok(check_CFE_LINK_selection(hwndRichEdit, at_offset, at_offset +1),
2614 "CFE_LINK not set in (%d-%d), text: %s\n", at_offset, at_offset +1, buffer);
2615 ok(check_CFE_LINK_selection(hwndRichEdit, end_offset -1, end_offset),
2616 "CFE_LINK not set in (%d-%d), text: %s\n", end_offset -1, end_offset, buffer);
2617 }
2618 else
2619 {
2620 ok(!check_CFE_LINK_selection(hwndRichEdit, at_offset, at_offset +1),
2621 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset, at_offset + 1, buffer);
2622 ok(!check_CFE_LINK_selection(hwndRichEdit, end_offset -1, end_offset),
2623 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset -1, end_offset, buffer);
2624 }
2625 if (buffer[end_offset] != '\0')
2626 {
2627 ok(!check_CFE_LINK_selection(hwndRichEdit, end_offset, end_offset +1),
2628 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset, end_offset + 1, buffer);
2629 if (buffer[end_offset +1] != '\0')
2630 {
2631 ok(!check_CFE_LINK_selection(hwndRichEdit, end_offset +1, end_offset +2),
2632 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset +1, end_offset +2, buffer);
2633 }
2634 }
2635 }
2636
2637 DestroyWindow(hwndRichEdit);
2638 hwndRichEdit = NULL;
2639 }
2640
2641 /* Test detection of URLs within normal text - EM_REPLACESEL case. */
2642 /* Test just the first two URL examples for brevity */
2643 for (i = 0; i < 2; i++) {
2644 hwndRichEdit = new_richedit(parent);
2645
2646 /* Set selection with X to the URL */
2647 for (j = 0; j < ARRAY_SIZE(templates_delim); j++) {
2648 char * at_pos;
2649 int at_offset;
2650 int end_offset;
2651
2652 at_pos = strchr(templates_delim[j], 'X');
2653 at_offset = at_pos - templates_delim[j];
2654 end_offset = at_offset + strlen(urls[i].text);
2655
2656 SendMessageA(hwndRichEdit, EM_AUTOURLDETECT, TRUE, 0);
2657 SendMessageA(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)templates_delim[j]);
2658 SendMessageA(hwndRichEdit, EM_SETSEL, at_offset, at_offset+1);
2659 SendMessageA(hwndRichEdit, EM_REPLACESEL, 0, (LPARAM)urls[i].text);
2660 SendMessageA(hwndRichEdit, WM_GETTEXT, sizeof(buffer), (LPARAM)buffer);
2661
2662 /* This assumes no templates start with the URL itself, and that they
2663 have at least two characters before the URL text */
2664 ok(!check_CFE_LINK_selection(hwndRichEdit, 0, 1),
2665 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", 0, 1, buffer);
2666 ok(!check_CFE_LINK_selection(hwndRichEdit, at_offset -2, at_offset -1),
2667 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -2, at_offset -1, buffer);
2668 ok(!check_CFE_LINK_selection(hwndRichEdit, at_offset -1, at_offset),
2669 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -1, at_offset, buffer);
2670
2671 if (urls[i].is_url)
2672 {
2673 ok(check_CFE_LINK_selection(hwndRichEdit, at_offset, at_offset +1),
2674 "CFE_LINK not set in (%d-%d), text: %s\n", at_offset, at_offset +1, buffer);
2675 ok(check_CFE_LINK_selection(hwndRichEdit, end_offset -1, end_offset),
2676 "CFE_LINK not set in (%d-%d), text: %s\n", end_offset -1, end_offset, buffer);
2677 }
2678 else
2679 {
2680 ok(!check_CFE_LINK_selection(hwndRichEdit, at_offset, at_offset +1),
2681 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset, at_offset + 1, buffer);
2682 ok(!check_CFE_LINK_selection(hwndRichEdit, end_offset -1, end_offset),
2683 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset -1, end_offset, buffer);
2684 }
2685 if (buffer[end_offset] != '\0')
2686 {
2687 ok(!check_CFE_LINK_selection(hwndRichEdit, end_offset, end_offset +1),
2688 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset, end_offset + 1, buffer);
2689 if (buffer[end_offset +1] != '\0')
2690 {
2691 ok(!check_CFE_LINK_selection(hwndRichEdit, end_offset +1, end_offset +2),
2692 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset +1, end_offset +2, buffer);
2693 }
2694 }
2695 }
2696
2697 /* Set selection with X to the first character of the URL, then the rest */
2698 for (j = 0; j < ARRAY_SIZE(templates_delim); j++) {
2699 char * at_pos;
2700 int at_offset;
2701 int end_offset;
2702
2703 at_pos = strchr(templates_delim[j], 'X');
2704 at_offset = at_pos - templates_delim[j];
2705 end_offset = at_offset + strlen(urls[i].text);
2706
2707 strcpy(buffer, "YY");
2708 buffer[0] = urls[i].text[0];
2709
2710 SendMessageA(hwndRichEdit, EM_AUTOURLDETECT, TRUE, 0);
2711 SendMessageA(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)templates_delim[j]);
2712 SendMessageA(hwndRichEdit, EM_SETSEL, at_offset, at_offset+1);
2713 SendMessageA(hwndRichEdit, EM_REPLACESEL, 0, (LPARAM)buffer);
2714 SendMessageA(hwndRichEdit, EM_SETSEL, at_offset+1, at_offset+2);
2715 SendMessageA(hwndRichEdit, EM_REPLACESEL, 0, (LPARAM)(urls[i].text + 1));
2716 SendMessageA(hwndRichEdit, WM_GETTEXT, sizeof(buffer), (LPARAM)buffer);
2717
2718 /* This assumes no templates start with the URL itself, and that they
2719 have at least two characters before the URL text */
2720 ok(!check_CFE_LINK_selection(hwndRichEdit, 0, 1),
2721 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", 0, 1, buffer);
2722 ok(!check_CFE_LINK_selection(hwndRichEdit, at_offset -2, at_offset -1),
2723 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -2, at_offset -1, buffer);
2724 ok(!check_CFE_LINK_selection(hwndRichEdit, at_offset -1, at_offset),
2725 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -1, at_offset, buffer);
2726
2727 if (urls[i].is_url)
2728 {
2729 ok(check_CFE_LINK_selection(hwndRichEdit, at_offset, at_offset +1),
2730 "CFE_LINK not set in (%d-%d), text: %s\n", at_offset, at_offset +1, buffer);
2731 ok(check_CFE_LINK_selection(hwndRichEdit, end_offset -1, end_offset),
2732 "CFE_LINK not set in (%d-%d), text: %s\n", end_offset -1, end_offset, buffer);
2733 }
2734 else
2735 {
2736 ok(!check_CFE_LINK_selection(hwndRichEdit, at_offset, at_offset +1),
2737 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset, at_offset + 1, buffer);
2738 ok(!check_CFE_LINK_selection(hwndRichEdit, end_offset -1, end_offset),
2739 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset -1, end_offset, buffer);
2740 }
2741 if (buffer[end_offset] != '\0')
2742 {
2743 ok(!check_CFE_LINK_selection(hwndRichEdit, end_offset, end_offset +1),
2744 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset, end_offset + 1, buffer);
2745 if (buffer[end_offset +1] != '\0')
2746 {
2747 ok(!check_CFE_LINK_selection(hwndRichEdit, end_offset +1, end_offset +2),
2748 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset +1, end_offset +2, buffer);
2749 }
2750 }
2751 }
2752
2753 DestroyWindow(hwndRichEdit);
2754 hwndRichEdit = NULL;
2755 }
2756
2758}
char * strchr(const char *String, int ch)
Definition: utclib.c:501
#define E_INVALIDARG
Definition: ddrawi.h:101
const GLdouble * v
Definition: gl.h:2040
GLuint buffer
Definition: glext.h:5915
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
Definition: glfuncs.h:240
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
static void check_CFE_LINK_rcvd(HWND hwnd, BOOL is_url, const char *url)
Definition: editor.c:1951
static HWND new_static_wnd(HWND parent)
Definition: editor.c:1966
#define EM_AUTOURLDETECT
Definition: richedit.h:125
#define ST_SELECTION
Definition: richedit.h:1072
strcat
Definition: string.h:92
strcpy
Definition: string.h:131
UINT codepage
Definition: richedit.h:1066
DWORD flags
Definition: richedit.h:1065

Referenced by START_TEST().

◆ test_EM_CHARFROMPOS()

static void test_EM_CHARFROMPOS ( void  )
static

Definition at line 7209 of file editor.c.

7210{
7211 HWND hwnd;
7212 int result;
7213 RECT rcClient;
7214 POINTL point;
7215 point.x = 0;
7216 point.y = 40;
7217
7218 /* multi-line control inserts CR normally */
7221 (LPARAM)"one two three four five six seven\reight");
7222 ok(result == 1, "Expected 1, got %d\n", result);
7223 GetClientRect(hwnd, &rcClient);
7224
7226 ok(result == 34, "expected character index of 34 but got %d\n", result);
7227
7228 /* Test with points outside the bounds of the richedit control. */
7229 point.x = -1;
7230 point.y = 40;
7232 todo_wine ok(result == 34, "expected character index of 34 but got %d\n", result);
7233
7234 point.x = 1000;
7235 point.y = 0;
7237 todo_wine ok(result == 33, "expected character index of 33 but got %d\n", result);
7238
7239 point.x = 1000;
7240 point.y = 36;
7242 todo_wine ok(result == 39, "expected character index of 39 but got %d\n", result);
7243
7244 point.x = 1000;
7245 point.y = -1;
7247 todo_wine ok(result == 0, "expected character index of 0 but got %d\n", result);
7248
7249 point.x = 1000;
7250 point.y = rcClient.bottom + 1;
7252 todo_wine ok(result == 34, "expected character index of 34 but got %d\n", result);
7253
7254 point.x = 1000;
7255 point.y = rcClient.bottom;
7257 todo_wine ok(result == 39, "expected character index of 39 but got %d\n", result);
7258
7260}
POINTL point
Definition: edittest.c:50
#define todo_wine
Definition: custom.c:89
#define EM_CHARFROMPOS
Definition: richedit.h:78
LONG y
Definition: windef.h:330
LONG x
Definition: windef.h:329
LONG bottom
Definition: windef.h:309
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)

Referenced by START_TEST().

◆ test_EM_EXLIMITTEXT()

static void test_EM_EXLIMITTEXT ( void  )
static

Definition at line 4519 of file editor.c.

4520{
4521 int i, selBegin, selEnd, len1, len2;
4522 int result;
4523 char text[1024 + 1];
4524 char buffer[1024 + 1];
4525 int textlimit = 0; /* multiple of 100 */
4526 HWND hwndRichEdit = new_richedit(NULL);
4527
4528 i = SendMessageA(hwndRichEdit, EM_GETLIMITTEXT, 0, 0);
4529 ok(32767 == i, "EM_EXLIMITTEXT: expected: %d, actual: %d\n", 32767, i); /* default */
4530
4531 textlimit = 256000;
4532 SendMessageA(hwndRichEdit, EM_EXLIMITTEXT, 0, textlimit);
4533 i = SendMessageA(hwndRichEdit, EM_GETLIMITTEXT, 0, 0);
4534 /* set higher */
4535 ok(textlimit == i, "EM_EXLIMITTEXT: expected: %d, actual: %d\n", textlimit, i);
4536
4537 textlimit = 1000;
4538 SendMessageA(hwndRichEdit, EM_EXLIMITTEXT, 0, textlimit);
4539 i = SendMessageA(hwndRichEdit, EM_GETLIMITTEXT, 0, 0);
4540 /* set lower */
4541 ok(textlimit == i, "EM_EXLIMITTEXT: expected: %d, actual: %d\n", textlimit, i);
4542
4543 SendMessageA(hwndRichEdit, EM_EXLIMITTEXT, 0, 0);
4544 i = SendMessageA(hwndRichEdit, EM_GETLIMITTEXT, 0, 0);
4545 /* default for WParam = 0 */
4546 ok(65536 == i, "EM_EXLIMITTEXT: expected: %d, actual: %d\n", 65536, i);
4547
4548 textlimit = sizeof(text)-1;
4549 memset(text, 'W', textlimit);
4550 text[sizeof(text)-1] = 0;
4551 SendMessageA(hwndRichEdit, EM_EXLIMITTEXT, 0, textlimit);
4552 /* maxed out text */
4553 SendMessageA(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)text);
4554
4555 SendMessageA(hwndRichEdit, EM_SETSEL, 0, -1); /* select everything */
4556 SendMessageA(hwndRichEdit, EM_GETSEL, (WPARAM)&selBegin, (LPARAM)&selEnd);
4557 len1 = selEnd - selBegin;
4558
4559 SendMessageA(hwndRichEdit, WM_KEYDOWN, VK_BACK, 1);
4560 SendMessageA(hwndRichEdit, WM_CHAR, VK_BACK, 1);
4561 SendMessageA(hwndRichEdit, WM_KEYUP, VK_BACK, 1);
4562 SendMessageA(hwndRichEdit, EM_SETSEL, 0, -1);
4563 SendMessageA(hwndRichEdit, EM_GETSEL, (WPARAM)&selBegin, (LPARAM)&selEnd);
4564 len2 = selEnd - selBegin;
4565
4566 ok(len1 != len2,
4567 "EM_EXLIMITTEXT: Change Expected\nOld Length: %d, New Length: %d, Limit: %d\n",
4568 len1,len2,i);
4569
4570 SendMessageA(hwndRichEdit, WM_KEYDOWN, 'A', 1);
4571 SendMessageA(hwndRichEdit, WM_CHAR, 'A', 1);
4572 SendMessageA(hwndRichEdit, WM_KEYUP, 'A', 1);
4573 SendMessageA(hwndRichEdit, EM_SETSEL, 0, -1);
4574 SendMessageA(hwndRichEdit, EM_GETSEL, (WPARAM)&selBegin, (LPARAM)&selEnd);
4575 len1 = selEnd - selBegin;
4576
4577 ok(len1 != len2,
4578 "EM_EXLIMITTEXT: Change Expected\nOld Length: %d, New Length: %d, Limit: %d\n",
4579 len1,len2,i);
4580
4581 SendMessageA(hwndRichEdit, WM_KEYDOWN, 'A', 1);
4582 SendMessageA(hwndRichEdit, WM_CHAR, 'A', 1);
4583 SendMessageA(hwndRichEdit, WM_KEYUP, 'A', 1); /* full; should be no effect */
4584 SendMessageA(hwndRichEdit, EM_SETSEL, 0, -1);
4585 SendMessageA(hwndRichEdit, EM_GETSEL, (WPARAM)&selBegin, (LPARAM)&selEnd);
4586 len2 = selEnd - selBegin;
4587
4588 ok(len1 == len2,
4589 "EM_EXLIMITTEXT: No Change Expected\nOld Length: %d, New Length: %d, Limit: %d\n",
4590 len1,len2,i);
4591
4592 /* set text up to the limit, select all the text, then add a char */
4593 textlimit = 5;
4594 memset(text, 'W', textlimit);
4595 text[textlimit] = 0;
4596 SendMessageA(hwndRichEdit, EM_EXLIMITTEXT, 0, textlimit);
4597 SendMessageA(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)text);
4598 SendMessageA(hwndRichEdit, EM_SETSEL, 0, -1);
4599 SendMessageA(hwndRichEdit, WM_CHAR, 'A', 1);
4600 SendMessageA(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM)buffer);
4601 result = strcmp(buffer, "A");
4602 ok(0 == result, "got string = \"%s\"\n", buffer);
4603
4604 /* WM_SETTEXT not limited */
4605 textlimit = 10;
4606 memset(text, 'W', textlimit);
4607 text[textlimit] = 0;
4608 SendMessageA(hwndRichEdit, EM_EXLIMITTEXT, 0, textlimit-5);
4609 SendMessageA(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)text);
4610 SendMessageA(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM)buffer);
4611 i = strlen(buffer);
4612 ok(10 == i, "expected 10 chars\n");
4613 i = SendMessageA(hwndRichEdit, EM_GETLIMITTEXT, 0, 0);
4614 ok(10 == i, "EM_EXLIMITTEXT: expected: %d, actual: %d\n", 10, i);
4615
4616 /* try inserting more text at end */
4617 i = SendMessageA(hwndRichEdit, WM_CHAR, 'A', 0);
4618 ok(0 == i, "WM_CHAR wasn't processed\n");
4619 SendMessageA(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM)buffer);
4620 i = strlen(buffer);
4621 ok(10 == i, "expected 10 chars, got %i\n", i);
4622 i = SendMessageA(hwndRichEdit, EM_GETLIMITTEXT, 0, 0);
4623 ok(10 == i, "EM_EXLIMITTEXT: expected: %d, actual: %d\n", 10, i);
4624
4625 /* try inserting text at beginning */
4626 SendMessageA(hwndRichEdit, EM_SETSEL, 0, 0);
4627 i = SendMessageA(hwndRichEdit, WM_CHAR, 'A', 0);
4628 ok(0 == i, "WM_CHAR wasn't processed\n");
4629 SendMessageA(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM)buffer);
4630 i = strlen(buffer);
4631 ok(10 == i, "expected 10 chars, got %i\n", i);
4632 i = SendMessageA(hwndRichEdit, EM_GETLIMITTEXT, 0, 0);
4633 ok(10 == i, "EM_EXLIMITTEXT: expected: %d, actual: %d\n", 10, i);
4634
4635 /* WM_CHAR is limited */
4636 textlimit = 1;
4637 SendMessageA(hwndRichEdit, EM_EXLIMITTEXT, 0, textlimit);
4638 SendMessageA(hwndRichEdit, EM_SETSEL, 0, -1); /* select everything */
4639 i = SendMessageA(hwndRichEdit, WM_CHAR, 'A', 0);
4640 ok(0 == i, "WM_CHAR wasn't processed\n");
4641 i = SendMessageA(hwndRichEdit, WM_CHAR, 'A', 0);
4642 ok(0 == i, "WM_CHAR wasn't processed\n");
4643 SendMessageA(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM)buffer);
4644 i = strlen(buffer);
4645 ok(1 == i, "expected 1 chars, got %i instead\n", i);
4646
4647 DestroyWindow(hwndRichEdit);
4648}
#define EM_EXLIMITTEXT
Definition: richedit.h:86
#define EM_GETLIMITTEXT
Definition: richedit.h:74
#define VK_BACK
Definition: winuser.h:2201

Referenced by START_TEST().

◆ test_EM_EXSETSEL()

static void test_EM_EXSETSEL ( void  )
static

Definition at line 4968 of file editor.c.

4969{
4970 HWND hwndRichEdit = new_richedit(NULL);
4971 int i;
4972 const int num_tests = ARRAY_SIZE(exsetsel_tests);
4973
4974 /* sending some text to the window */
4975 SendMessageA(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)"testing selection");
4976 /* 01234567890123456*/
4977 /* 10 */
4978
4979 for (i = 0; i < num_tests; i++) {
4980 check_EM_EXSETSEL(hwndRichEdit, &exsetsel_tests[i], i);
4981 }
4982
4983 if (!is_lang_japanese)
4984 skip("Skip multibyte character tests on non-Japanese platform\n");
4985 else
4986 {
4987 CHARRANGE cr;
4988 char bufA[MAX_BUF_LEN] = {0};
4990
4991 /* Test with multibyte character */
4992 SendMessageA(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)"abcdef\x8e\xf0ghijk");
4993 /* 012345 6 78901 */
4994 cr.cpMin = 4; cr.cpMax = 8;
4995 result = SendMessageA(hwndRichEdit, EM_EXSETSEL, 0, (LPARAM)&cr);
4996 ok(result == 8, "EM_EXSETSEL return %ld expected 8\n", result);
4997 result = SendMessageA(hwndRichEdit, EM_GETSELTEXT, sizeof(bufA), (LPARAM)bufA);
4998 ok(!strcmp(bufA, "ef\x8e\xf0g"), "EM_GETSELTEXT return incorrect string\n");
4999 SendMessageA(hwndRichEdit, EM_EXGETSEL, 0, (LPARAM)&cr);
5000 ok(cr.cpMin == 4, "Selection start incorrectly: %d expected 4\n", cr.cpMin);
5001 ok(cr.cpMax == 8, "Selection end incorrectly: %d expected 8\n", cr.cpMax);
5002 }
5003
5004 DestroyWindow(hwndRichEdit);
5005}
#define skip(...)
Definition: atltest.h:64
static const struct exsetsel_s exsetsel_tests[]
Definition: editor.c:4921
static void check_EM_EXSETSEL(HWND hwnd, const struct exsetsel_s *setsel, int id)
Definition: editor.c:4950
#define MAX_BUF_LEN
#define EM_GETSELTEXT
Definition: richedit.h:95
#define EM_EXGETSEL
Definition: richedit.h:85

Referenced by START_TEST().

◆ test_EM_FINDTEXT()

static void test_EM_FINDTEXT ( BOOL  unicode)
static

Definition at line 361 of file editor.c.

362{
363 HWND hwndRichEdit;
364 CHARFORMAT2A cf2;
365
366 if(unicode)
367 hwndRichEdit = new_richeditW(NULL);
368 else
369 hwndRichEdit = new_richedit(NULL);
370
371 /* Empty rich edit control */
372 run_tests_EM_FINDTEXT(hwndRichEdit, "1", find_tests, ARRAY_SIZE(find_tests), unicode);
373
374 SendMessageA(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)haystack);
375
376 /* Haystack text */
377 run_tests_EM_FINDTEXT(hwndRichEdit, "2", find_tests2, ARRAY_SIZE(find_tests2), unicode);
378
379 /* Setting a format on an arbitrary range should have no effect in search
380 results. This tests correct offset reporting across runs. */
381 cf2.cbSize = sizeof(CHARFORMAT2A);
382 SendMessageA(hwndRichEdit, EM_GETCHARFORMAT, SCF_DEFAULT, (LPARAM)&cf2);
383 cf2.dwMask = CFM_ITALIC | cf2.dwMask;
384 cf2.dwEffects = CFE_ITALIC ^ cf2.dwEffects;
385 SendMessageA(hwndRichEdit, EM_SETSEL, 6, 20);
386 SendMessageA(hwndRichEdit, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf2);
387
388 /* Haystack text, again */
389 run_tests_EM_FINDTEXT(hwndRichEdit, "2-bis", find_tests2, ARRAY_SIZE(find_tests2), unicode);
390
391 /* Yet another range */
392 cf2.dwMask = CFM_BOLD | cf2.dwMask;
393 cf2.dwEffects = CFE_BOLD ^ cf2.dwEffects;
394 SendMessageA(hwndRichEdit, EM_SETSEL, 11, 15);
395 SendMessageA(hwndRichEdit, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf2);
396
397 /* Haystack text, again */
398 run_tests_EM_FINDTEXT(hwndRichEdit, "2-bisbis", find_tests2, ARRAY_SIZE(find_tests2), unicode);
399
400 DestroyWindow(hwndRichEdit);
401}
static HWND new_richeditW(HWND parent)
Definition: editor.c:109
static void run_tests_EM_FINDTEXT(HWND hwnd, const char *name, struct find_s *find, int num_tests, BOOL unicode)
Definition: editor.c:350
static struct find_s find_tests2[]
Definition: editor.c:195
static struct find_s find_tests[]
Definition: editor.c:186
static const char haystack[]
Definition: editor.c:174
#define CFE_BOLD
Definition: richedit.h:406
#define CFE_ITALIC
Definition: richedit.h:407
#define SCF_DEFAULT
Definition: richedit.h:234
#define EM_SETCHARFORMAT
Definition: richedit.h:101
#define CFM_ITALIC
Definition: richedit.h:333
struct _charformat2a CHARFORMAT2A
#define CFM_BOLD
Definition: richedit.h:332
DWORD dwMask
Definition: richedit.h:283

◆ test_EM_FINDWORDBREAK_A()

static void test_EM_FINDWORDBREAK_A ( void  )
static

Definition at line 8284 of file editor.c.

8285{
8286 static const struct {
8287 WCHAR c;
8288 BOOL isdelimiter; /* expected result of WB_ISDELIMITER */
8289 } delimiter_tests[] = {
8290 {0x0a, FALSE}, /* newline */
8291 {0x0b, FALSE}, /* vertical tab */
8292 {0x0c, FALSE}, /* form feed */
8293 {0x0d, FALSE}, /* carriage return */
8294 {0x20, TRUE}, /* space */
8295 {0x61, FALSE}, /* capital letter a */
8296 };
8297 int i;
8298 HWND hwndRichEdit = new_richedit(NULL);
8299
8300 ok(!IsWindowUnicode(hwndRichEdit), "window should not be unicode\n");
8301 for (i = 0; i < ARRAY_SIZE(delimiter_tests); i++)
8302 {
8303 int result;
8304 char buf[2];
8305 buf[0] = delimiter_tests[i].c;
8306 buf[1] = 0;
8307 SendMessageA(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)buf);
8309 todo_wine_if (buf[0] == 0x20)
8310 ok(result == delimiter_tests[i].isdelimiter,
8311 "wanted ISDELIMITER_A(0x%x) %d, got %d\n",
8312 delimiter_tests[i].c, delimiter_tests[i].isdelimiter, result);
8313 }
8314 DestroyWindow(hwndRichEdit);
8315}
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
const GLubyte * c
Definition: glext.h:8905
#define c
Definition: ke_i.h:80
#define EM_FINDWORDBREAK
Definition: richedit.h:109
BOOL WINAPI IsWindowUnicode(_In_ HWND)

Referenced by START_TEST().

◆ test_EM_FINDWORDBREAK_W()

static void test_EM_FINDWORDBREAK_W ( void  )
static

Definition at line 8240 of file editor.c.

8241{
8242 static const struct {
8243 WCHAR c;
8244 BOOL isdelimiter; /* expected result of WB_ISDELIMITER */
8245 } delimiter_tests[] = {
8246 {0x0a, FALSE}, /* newline */
8247 {0x0b, FALSE}, /* vertical tab */
8248 {0x0c, FALSE}, /* form feed */
8249 {0x0d, FALSE}, /* carriage return */
8250 {0x20, TRUE}, /* space */
8251 {0x61, FALSE}, /* capital letter a */
8252 {0xa0, FALSE}, /* no-break space */
8253 {0x2000, FALSE}, /* en quad */
8254 {0x3000, FALSE}, /* Ideographic space */
8255 {0x1100, FALSE}, /* Hangul Choseong Kiyeok (G sound) Ordinary Letter*/
8256 {0x11ff, FALSE}, /* Hangul Jongseoung Kiyeok-Hieuh (Hard N sound) Ordinary Letter*/
8257 {0x115f, FALSE}, /* Hangul Choseong Filler (no sound, used with two letter Hangul words) Ordinary Letter */
8258 {0xac00, FALSE}, /* Hangul character GA*/
8259 {0xd7af, FALSE}, /* End of Hangul character chart */
8260 {0xf020, TRUE}, /* MS private for CP_SYMBOL round trip?, see kb897872 */
8261 {0xff20, FALSE}, /* fullwidth commercial @ */
8262 {WCH_EMBEDDING, FALSE}, /* object replacement character*/
8263 };
8264 int i;
8265 HWND hwndRichEdit = new_richeditW(NULL);
8266 ok(IsWindowUnicode(hwndRichEdit), "window should be unicode\n");
8267 for (i = 0; i < ARRAY_SIZE(delimiter_tests); i++)
8268 {
8269 WCHAR wbuf[2];
8270 int result;
8271
8272 wbuf[0] = delimiter_tests[i].c;
8273 wbuf[1] = 0;
8274 SendMessageW(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)wbuf);
8276 todo_wine_if (wbuf[0] == 0x20 || wbuf[0] == 0xf020)
8277 ok(result == delimiter_tests[i].isdelimiter,
8278 "wanted ISDELIMITER_W(0x%x) %d, got %d\n",
8279 delimiter_tests[i].c, delimiter_tests[i].isdelimiter, result);
8280 }
8281 DestroyWindow(hwndRichEdit);
8282}
#define WCH_EMBEDDING
Definition: richedit.h:1024

Referenced by START_TEST().