40 #define ID_RICHEDITTESTDBUTTON 0x123 44 #define ok_w3(format, szString1, szString2, szString3) \ 45 WideCharToMultiByte(CP_ACP, 0, szString1, -1, string1, MAX_PATH, NULL, NULL); \ 46 WideCharToMultiByte(CP_ACP, 0, szString2, -1, string2, MAX_PATH, NULL, NULL); \ 47 WideCharToMultiByte(CP_ACP, 0, szString3, -1, string3, MAX_PATH, NULL, NULL); \ 48 ok(!lstrcmpW(szString3, szString1) || !lstrcmpW(szString3, szString2), \ 49 format, string1, string2, string3); 108 while (*szChars !=
'\0') {
111 ok(
ret == 0,
"WM_CHAR('%c') ret=%d\n", *szChars,
ret);
123 ok(
result,
"GetKeyboardState failed.\n");
125 key_state[
vk] |= 0x80;
127 ok(
result,
"SetKeyboardState failed.\n");
137 ok(
result,
"GetKeyboardState failed.\n");
139 key_state[
vk] &= ~0x80;
141 ok(
result,
"SetKeyboardState failed.\n");
145 static const char haystack[] =
"WINEWine wineWine wine WineWine";
160 {0, -1,
"foo", 0, -1},
190 {20, 5,
"Wine", 0, 13},
209 {-20, 20,
"Wine",
FR_DOWN, -1},
210 {-20, 20,
"Wine",
FR_DOWN, -1},
211 {-15, -20,
"Wine",
FR_DOWN, -1},
212 {1<<12, 1<<13,
"Wine",
FR_DOWN, -1},
226 {0, -1,
"wineWine wine", 0, -1},
245 memset(&ftw, 0,
sizeof(ftw));
251 ok(findloc ==
f->expected_loc,
252 "EM_FINDTEXT(%s,%d,%u) '%s' in range(%d,%d), flags %08x, got start at %d, expected %d\n",
253 name,
id, unicode,
f->needle,
f->start,
f->end,
f->flags, findloc,
f->expected_loc);
256 ok(findloc ==
f->expected_loc,
257 "EM_FINDTEXTW(%s,%d,%u) '%s' in range(%d,%d), flags %08x, got start at %d, expected %d\n",
258 name,
id, unicode,
f->needle,
f->start,
f->end,
f->flags, findloc,
f->expected_loc);
263 memset(&fta, 0,
sizeof(fta));
269 ok(findloc ==
f->expected_loc,
270 "EM_FINDTEXT(%s,%d,%u) '%s' in range(%d,%d), flags %08x, got start at %d, expected %d\n",
271 name,
id, unicode,
f->needle,
f->start,
f->end,
f->flags, findloc,
f->expected_loc);
276 int id,
BOOL unicode)
279 int expected_end_loc;
283 memset(&ftw, 0,
sizeof(ftw));
288 ok(findloc ==
f->expected_loc,
289 "EM_FINDTEXTEX(%s,%d) '%s' in range(%d,%d), flags %08x, start at %d\n",
290 name,
id,
f->needle,
f->start,
f->end,
f->flags, findloc);
291 ok(ftw.chrgText.cpMin ==
f->expected_loc,
292 "EM_FINDTEXTEX(%s,%d) '%s' in range(%d,%d), flags %08x, start at %d\n",
293 name,
id,
f->needle,
f->start,
f->end,
f->flags, ftw.chrgText.cpMin);
294 expected_end_loc = ((
f->expected_loc == -1) ? -1
295 :
f->expected_loc +
strlen(
f->needle));
296 ok(ftw.chrgText.cpMax == expected_end_loc,
297 "EM_FINDTEXTEX(%s,%d) '%s' in range(%d,%d), flags %08x, end at %d, expected %d\n",
298 name,
id,
f->needle,
f->start,
f->end,
f->flags, ftw.chrgText.cpMax, expected_end_loc);
302 memset(&fta, 0,
sizeof(fta));
307 ok(findloc ==
f->expected_loc,
308 "EM_FINDTEXTEX(%s,%d) '%s' in range(%d,%d), flags %08x, start at %d\n",
309 name,
id,
f->needle,
f->start,
f->end,
f->flags, findloc);
310 ok(fta.chrgText.cpMin ==
f->expected_loc,
311 "EM_FINDTEXTEX(%s,%d) '%s' in range(%d,%d), flags %08x, start at %d\n",
312 name,
id,
f->needle,
f->start,
f->end,
f->flags, fta.chrgText.cpMin);
313 expected_end_loc = ((
f->expected_loc == -1) ? -1
314 :
f->expected_loc +
strlen(
f->needle));
315 ok(fta.chrgText.cpMax == expected_end_loc,
316 "EM_FINDTEXTEX(%s,%d) '%s' in range(%d,%d), flags %08x, end at %d, expected %d\n",
317 name,
id,
f->needle,
f->start,
f->end,
f->flags, fta.chrgText.cpMax, expected_end_loc);
364 cf2.dwEffects =
CFE_BOLD ^ cf2.dwEffects;
379 {0, 10,
"foo bar\r"},
394 static const int nBuf = 1024;
395 char dest[1024], origdest[1024];
396 const char text[] =
"foo bar\n" 402 memset(origdest, 0xBB, nBuf);
414 ok(nCopied == expected_nCopied,
"%d: %d!=%d\n",
i, nCopied,
417 if (
gl[
i].buffer_len == 0)
420 else if (
gl[
i].buffer_len == 1)
422 !
strncmp(
dest+2, origdest+2, nBuf-2),
"buffer_len=1\n");
426 char expectedbuf[1024];
427 char resultbuf[1024];
430 for (
j = 0;
j < 32;
j++)
432 expectedbuf[0] =
'\0';
433 for (
j = 0;
j < expected_bytes_written;
j++)
435 for (;
j <
gl[
i].buffer_len;
j++)
438 sprintf(expectedbuf+
strlen(expectedbuf),
"%02x", origdest[
j] & 0xFF);
448 "%d: expected_bytes_written=%d\n" "expected=0x%s\n" "but got= 0x%s\n",
449 i, expected_bytes_written, expectedbuf, resultbuf);
453 nBuf -
gl[
i].buffer_len),
454 "%d: expected_bytes_written=%d\n" "expected=0x%s\n" "but got= 0x%s\n",
455 i, expected_bytes_written, expectedbuf, resultbuf);
470 int offset_test[10][2] = {
487 for (
i = 0;
i < 10;
i++) {
489 ok(
result == offset_test[
i][1],
"Length of line at offset %d is %ld, expected %d\n",
490 offset_test[
i][0],
result, offset_test[
i][1]);
495 skip(
"Skip multibyte character tests on non-Japanese platform\n");
502 int offset_test1[3][2] = {
510 ok(
result == offset_test1[
i][1],
"Length of line at offset %d is %ld, expected %d\n",
511 offset_test1[
i][0],
result, offset_test1[
i][1]);
522 ok(
p.x != -1 &&
p.y != -1,
"p.x:%d p.y:%d\n",
p.x,
p.y);
529 cr.
cpMax = charindex;
530 cr.
cpMin = charindex;
542 const char text[] =
"aa\n" 543 "this is a long line of text that should be longer than the " 570 ok(prevY != curY,
"%d == %d\n", prevY, curY);
578 ok(prevY != curY,
"%d == %d\n", prevY, curY);
585 ok(prevY == curY,
"%d != %d\n", prevY, curY);
592 ok(prevY == curY,
"%d != %d\n", prevY, curY);
608 static const char text[] =
"aa\n" 609 "this is a long line of text that should be longer than the " 620 (sig.lsUsb[3] & 0x08000000) != 0);
623 for (
i = 0;
i < 50;
i++)
642 for (
i = 0;
i < 50;
i++)
679 for (
i = 0;
i < 50;
i++)
684 "EM_POSFROMCHAR reports y=%hd, expected %d\n",
713 "EM_POSFROMCHAR reports x=%hd, expected value less than %d\n",
721 ok(
pt.x > 1,
"pt.x = %d\n",
pt.x);
725 ok(
pt.x > xpos,
"pt.x = %d\n",
pt.x);
726 xpos = (
rtl ?
pt.x + 7 :
pt.x);
729 ok(
pt.x == xpos,
"pt.x = %d\n",
pt.x);
733 ok(
pt.x == 1,
"pt.x = %d\n",
pt.x);
737 (
LPARAM)
"{\\rtf1\\pard\\fi-200\\li-200\\f1 TestSomeText\\par}");
739 ok(
pt.x == 1,
"pt.x = %d\n",
pt.x);
743 ok(
fmt.dxStartIndent == -400,
"got %d\n",
fmt.dxStartIndent);
744 ok(
fmt.dxOffset == 200,
"got %d\n",
fmt.dxOffset);
758 int tested_effects[] = {
773 DWORD expect_effects;
777 (sig.lsUsb[3] & 0x08000000) != 0);
783 ok(cf2.dwMask ==
CFM_ALL2,
"got %08x\n", cf2.dwMask);
785 if (cf2.wWeight > 550) expect_effects |=
CFE_BOLD;
786 ok(cf2.dwEffects == expect_effects,
"got %08x\n", cf2.dwEffects);
787 ok(cf2.yOffset == 0,
"got %d\n", cf2.yOffset);
788 ok(cf2.sSpacing == 0,
"got %d\n", cf2.sSpacing);
790 ok(cf2.sStyle == 0,
"got %d\n", cf2.sStyle);
791 ok(cf2.wKerning == 0,
"got %d\n", cf2.wKerning);
792 ok(cf2.bAnimation == 0,
"got %d\n", cf2.bAnimation);
793 ok(cf2.bRevAuthor == 0,
"got %d\n", cf2.bRevAuthor);
796 memset(&cf2, 0,
sizeof(cf2));
798 ok(rc == 0,
"EM_SETCHARFORMAT returned %d instead of 0\n", rc);
801 memset(&cf2, 0,
sizeof(cf2));
803 ok(rc == 0,
"EM_SETCHARFORMAT returned %d instead of 0\n", rc);
806 memset(&cf2, 0,
sizeof(cf2));
808 ok(rc == 0,
"EM_SETCHARFORMAT returned %d instead of 0\n", rc);
811 memset(&cf2, 0,
sizeof(cf2));
813 ok(rc == 0,
"EM_SETCHARFORMAT returned %d instead of 0\n", rc);
816 memset(&cf2, 0,
sizeof(cf2));
818 ok(rc == 0,
"EM_SETCHARFORMAT returned %d instead of 0\n", rc);
821 memset(&cf2, 0,
sizeof(cf2));
824 ok(rc == 1,
"EM_SETCHARFORMAT returned %d instead of 1\n", rc);
826 ok(rc ==
FALSE,
"Should not be able to undo here.\n");
830 memset(&cf2, 0,
sizeof(cf2));
833 ok(rc == 1,
"EM_SETCHARFORMAT returned %d instead of 1\n", rc);
835 ok(rc ==
FALSE,
"Should not be able to undo here.\n");
839 memset(&cf2, 0,
sizeof(cf2));
842 ok(rc == 1,
"EM_SETCHARFORMAT returned %d instead of 1\n", rc);
844 ok(rc ==
FALSE,
"Should not be able to undo here.\n");
848 memset(&cf2, 0,
sizeof(cf2));
851 ok(rc == 1,
"EM_SETCHARFORMAT returned %d instead of 1\n", rc);
857 memset(&cf2, 0,
sizeof(cf2));
860 ok(rc == 1,
"EM_SETCHARFORMAT returned %d instead of 1\n", rc);
862 ok(rc ==
TRUE,
"Should not be able to undo here.\n");
877 ok(rc == 0,
"Text marked as modified, expected not modified!\n");
879 ok(rc == 1,
"EM_SETCHARFORMAT returned %d instead of 1\n", rc);
883 ok(rc == 0,
"Text marked as modified, expected not modified!\n");
886 skip(
"RTL language found\n");
891 ok(rc == 0,
"Text marked as modified, expected not modified!\n");
893 ok(rc == 1,
"EM_SETCHARFORMAT returned %d instead of 1\n", rc);
895 ok(rc == 0,
"Text marked as modified, expected not modified!\n");
899 ok(rc == 0,
"Text marked as modified, expected not modified!\n");
901 ok(rc == 1,
"EM_SETCHARFORMAT returned %d instead of 1\n", rc);
903 ok(rc == 0,
"Text marked as modified, expected not modified!\n");
906 ok(rc == 1,
"EM_SETCHARFORMAT returned %d instead of 1\n", rc);
908 ok(rc == -1,
"Text not marked as modified, expected modified! (%d)\n", rc);
913 ok(rc == 0,
"Text marked as modified, expected not modified!\n");
915 ok(rc == 1,
"EM_SETCHARFORMAT returned %d instead of 1\n", rc);
917 ok(rc == -1,
"Text not marked as modified, expected modified! (%d)\n", rc);
922 for (
i = 0; tested_effects[
i];
i++)
932 strcpy(cf2.szFaceName,
"Courier New");
943 (cf2.dwMask & tested_effects[
i]) == tested_effects[
i]),
944 "%d, cf2.dwMask == 0x%08x expected mask 0x%08x\n",
i, cf2.dwMask, tested_effects[
i]);
945 ok((cf2.dwEffects & tested_effects[
i]) == 0,
946 "%d, cf2.dwEffects == 0x%08x expected effect 0x%08x clear\n",
i, cf2.dwEffects, tested_effects[
i]);
950 cf2.dwMask = tested_effects[
i];
953 cf2.dwEffects = tested_effects[
i];
964 (cf2.dwMask & tested_effects[
i]) == tested_effects[
i]),
965 "%d, cf2.dwMask == 0x%08x expected mask 0x%08x\n",
i, cf2.dwMask, tested_effects[
i]);
966 ok((cf2.dwEffects & tested_effects[
i]) == tested_effects[
i],
967 "%d, cf2.dwEffects == 0x%08x expected effect 0x%08x\n",
i, cf2.dwEffects, tested_effects[
i]);
976 (cf2.dwMask & tested_effects[
i]) == tested_effects[
i]),
977 "%d, cf2.dwMask == 0x%08x expected mask 0x%08x\n",
i, cf2.dwMask, tested_effects[
i]);
978 ok((cf2.dwEffects & tested_effects[
i]) == 0,
979 "%d, cf2.dwEffects == 0x%08x expected effect 0x%08x clear\n",
i, cf2.dwEffects, tested_effects[
i]);
988 (cf2.dwMask & tested_effects[
i]) == 0),
989 "%d, cf2.dwMask == 0x%08x expected mask 0x%08x clear\n",
i, cf2.dwMask, tested_effects[
i]);
994 for (
i = 0; tested_effects[
i];
i++)
1004 strcpy(cf2.szFaceName,
"Courier New");
1010 cf2.dwMask = tested_effects[
i];
1013 cf2.dwEffects = tested_effects[
i];
1024 (cf2.dwMask & tested_effects[
i]) == tested_effects[
i]),
1025 "%d, cf2.dwMask == 0x%08x expected mask 0x%08x\n",
i, cf2.dwMask, tested_effects[
i]);
1026 ok((cf2.dwEffects & tested_effects[
i]) == 0,
1027 "%d, cf2.dwEffects == 0x%08x expected effect 0x%08x clear\n",
i, cf2.dwEffects, tested_effects[
i]);
1036 (cf2.dwMask & tested_effects[
i]) == tested_effects[
i]),
1037 "%d, cf2.dwMask == 0x%08x expected mask 0x%08x\n",
i, cf2.dwMask, tested_effects[
i]);
1038 ok((cf2.dwEffects & tested_effects[
i]) == tested_effects[
i],
1039 "%d, cf2.dwEffects == 0x%08x expected effect 0x%08x\n",
i, cf2.dwEffects, tested_effects[
i]);
1048 (cf2.dwMask & tested_effects[
i]) == 0),
1049 "%d, cf2.dwMask == 0x%08x expected mask 0x%08x clear\n",
i, cf2.dwMask, tested_effects[
i]);
1050 ok((cf2.dwEffects & tested_effects[
i]) == tested_effects[
i],
1051 "%d, cf2.dwEffects == 0x%08x expected effect 0x%08x set\n",
i, cf2.dwEffects, tested_effects[
i]);
1077 "%d, cf2.dwMask == 0x%08x expected mask 0x%08x\n",
i, cf2.dwMask,
CFM_BOLD);
1079 "%d, cf2.dwEffects == 0x%08x expected effect 0x%08x\n",
i, cf2.dwEffects,
CFE_BOLD);
1114 "%d, cf2.dwEffects == 0x%08x expected effect 0x%08x\n",
i, cf2.dwEffects, (
CFE_BOLD|
CFE_ITALIC));
1147 "%d, cf2.dwMask == 0x%08x expected mask 0x%08x\n",
i, cf2.dwMask,
CFM_BOLD);
1149 "%d, cf2.dwEffects == 0x%08x expected effect 0x%08x\n",
i, cf2.dwEffects,
CFE_BOLD);
1182 "%d, cf2.dwMask == 0x%08x expected mask 0x%08x\n",
i, cf2.dwMask,
CFM_BOLD);
1184 "%d, cf2.dwEffects == 0x%08x not expecting effect 0x%08x\n",
i, cf2.dwEffects,
CFE_BOLD);
1206 cr.cpMin = 2; cr.cpMax = 2;
1214 cr.cpMin = 2; cr.cpMax = 6;
1219 "%d, cf2.dwMask == 0x%08x expected mask 0x%08x\n",
i, cf2.dwMask,
CFM_BOLD);
1221 "%d, cf2.dwEffects == 0x%08x expected effect 0x%08x\n",
i, cf2.dwEffects,
CFE_BOLD);
1224 memset(&cf2, 0,
sizeof(cf2));
1225 cf2.cbSize =
sizeof(cf2);
1229 memset(&cf2, 0,
sizeof(cf2));
1230 cf2.cbSize =
sizeof(cf2);
1232 ok(cf2.wWeight == 100,
"got %d\n", cf2.wWeight);
1234 memset(&cf2, 0,
sizeof(cf2));
1235 cf2.cbSize =
sizeof(cf2);
1239 memset(&cf2, 0,
sizeof(cf2));
1240 cf2.cbSize =
sizeof(cf2);
1242 ok(cf2.sSpacing == 10,
"got %d\n", cf2.sSpacing);
1245 memset(&cfW, 0,
sizeof(cfW));
1246 cfW.
cbSize =
sizeof(cfW);
1250 memset(&cfW, 0,
sizeof(cfW));
1251 cfW.cbSize =
sizeof(cfW);
1253 ok(cfW.wWeight == 100,
"got %d\n", cfW.wWeight);
1255 memset(&cfW, 0,
sizeof(cfW));
1256 cfW.cbSize =
sizeof(cfW);
1260 memset(&cfW, 0,
sizeof(cfW));
1261 cfW.cbSize =
sizeof(cfW);
1263 ok(cfW.sSpacing == 10,
"got %d\n", cfW.sSpacing);
1279 "got %08x\n", cf2.dwMask);
1281 ok(cf2.bUnderlineType ==
CFU_UNDERLINE,
"got %x\n", cf2.bUnderlineType);
1291 "got %08x\n", cf2.dwMask);
1293 ok(cf2.bUnderlineType ==
CFU_UNDERLINE,
"got %x\n", cf2.bUnderlineType);
1303 "got %08x\n", cf2.dwMask);
1315 "got %08x\n", cf2.dwMask);
1328 "got %08x\n", cf2.dwMask);
1340 "got %08x\n", cf2.dwMask);
1374 "EM_SETTEXTMODE: using mutually exclusive mode flags - returned: %x\n", rc);
1384 "EM_SETTEXTMODE: changed text mode in control containing text - returned: %x\n", rc);
1401 ok(rc == 0,
"Text marked as modified, expected not modified!\n");
1406 ok(rc == 1,
"EM_SETCHARFORMAT returned %d instead of 1\n", rc);
1409 ok(rc == -1,
"Text not marked as modified, expected modified! (%d)\n", rc);
1424 ok(rc == 1,
"EM_SETCHARFORMAT returned %d instead of 1\n", rc);
1431 ok(rc == 0,
"EM_SETTEXTMODE: unable to switch to plain text mode with empty control: returned: %d\n", rc);
1457 ok((cf2.dwMask == cf2test.dwMask) && (cf2.dwEffects == cf2test.dwEffects),
1458 "two formats found in plain text mode - cf2.dwEffects: %x cf2test.dwEffects: %x\n",
1459 cf2.dwEffects, cf2test.dwEffects);
1467 ok(rc != 0,
"EM_SETTEXTMODE: changed from plain text to rich text with text in control - returned: %d\n", rc);
1474 ok(rc == 0,
"EM_SETTEXTMODE: unable to change to rich text with empty control - returned: %d\n", rc);
1499 todo_wine ok((cf2.dwMask == cf2test.dwMask) && (cf2.dwEffects != cf2test.dwEffects),
1500 "expected different formats - cf2.dwMask: %x, cf2test.dwMask: %x, cf2.dwEffects: %x, cf2test.dwEffects: %x\n",
1501 cf2.dwMask, cf2test.dwMask, cf2.dwEffects, cf2test.dwEffects);
1517 ok(
ret != 0,
"expected non-zero got %d\n",
ret);
1528 ok(
ret == expectedMask,
"expected %x got %x\n", expectedMask,
ret);
1529 ok(
fmt.dwMask == expectedMask,
"expected %x got %x\n", expectedMask,
fmt.dwMask);
1532 ok(
fmt.wNumbering == 0,
"got %d\n",
fmt.wNumbering );
1533 ok(
fmt.wNumberingStart == 0,
"got %d\n",
fmt.wNumberingStart );
1534 ok(
fmt.wNumberingStyle == 0,
"got %04x\n",
fmt.wNumberingStyle );
1535 ok(
fmt.wNumberingTab == 0,
"got %d\n",
fmt.wNumberingTab );
1566 cf2.dwMask =
CFM_BOLD | cf2.dwMask;
1567 cf2.dwEffects =
CFE_BOLD ^ cf2.dwEffects;
1570 ok(rc == 0,
"EM_SETCHARFORMAT returned %d instead of 0\n", rc);
1573 ok(rc == 0,
"EM_SETCHARFORMAT returned %d instead of 0\n", rc);
1576 ok(rc == 1,
"EM_SETCHARFORMAT returned %d instead of 1\n", rc);
1591 ok((cf2.dwMask == cf2test.dwMask) && (cf2.dwEffects == cf2test.dwEffects),
1592 "two selections' formats differ - cf2.dwMask: %x, cf2test.dwMask %x, cf2.dwEffects: %x, cf2test.dwEffects: %x\n",
1593 cf2.dwMask, cf2test.dwMask, cf2.dwEffects, cf2test.dwEffects);
1617 ok(rc == 1,
"EM_SETCHARFORMAT returned %d instead of 1\n", rc);
1644 ok((cf2.dwMask == cf2test.dwMask) && (cf2.dwEffects == cf2test.dwEffects),
1645 "Copied text retained formatting - cf2.dwMask: %x, cf2test.dwMask: %x, cf2.dwEffects: %x, cf2test.dwEffects: %x\n",
1646 cf2.dwMask, cf2test.dwMask, cf2.dwEffects, cf2test.dwEffects);
1653 static const char text[] =
"Hello. My name is RichEdit!";
1654 static const char text2[] =
"Hello. My name is RichEdit!\r";
1655 static const char text2_after[] =
"Hello. My name is RichEdit!\r\n";
1667 "WM_GETTEXT: settext and gettext differ. strcmp: %d\n",
result);
1672 "WM_GETTEXTLENGTH reports incorrect length %d, expected %d\n",
1685 "WM_GETTEXT: settext and gettext differ. strcmp: %d\n",
result);
1694 "WM_GETTEXT: settext and gettext differ. strcmp: %d\n",
result);
1699 "WM_GETTEXTLENGTH reports incorrect length %d, expected %d\n",
1707 "WM_GETTEXT returned %d, expected 0 or %d\n",
result,
lstrlenA(text2) - 1);
1712 "WM_GETTEXT: settext and gettext differ. strcmp: %d\n",
result);
1720 const char * text1 =
"foo bar\r\nfoo bar";
1721 const char * text2 =
"foo bar\rfoo bar";
1722 const char *
expect =
"bar\rfoo";
1738 textRange.lpstrText =
buffer;
1739 textRange.chrg.cpMin = 4;
1740 textRange.chrg.cpMax = 11;
1746 textRange.lpstrText =
buffer;
1747 textRange.chrg.cpMin = 0;
1748 textRange.chrg.cpMax = -1;
1754 textRange.lpstrText =
buffer;
1755 textRange.chrg.cpMin = -1;
1756 textRange.chrg.cpMax = 1;
1762 textRange.lpstrText =
buffer;
1763 textRange.chrg.cpMin = 1;
1764 textRange.chrg.cpMax = -1;
1770 textRange.lpstrText =
buffer;
1771 textRange.chrg.cpMin = 5;
1772 textRange.chrg.cpMax = 5;
1778 textRange.lpstrText =
buffer;
1779 textRange.chrg.cpMin = 0;
1780 textRange.chrg.cpMax = 1000;
1787 skip(
"Skip multibyte character tests on non-Japanese platform\n");
1791 textRange.chrg.cpMin = 4;
1792 textRange.chrg.cpMax = 8;
1804 const char * text1 =
"foo bar\r\nfoo bar";
1805 const char * text2 =
"foo bar\rfoo bar";
1806 const char *
expect =
"bar\rfoo";
1826 skip(
"Skip multibyte character tests on non-Japanese platform\n");
1843 static const char text[] =
"Hello. My name is RichEdit!";
1854 ok(hwndRichEdit !=
NULL,
"class: %s, error: %d\n",
1864 ok(hwndRichEdit !=
NULL,
"class: %s, error: %d\n",
1869 "Incorrect initial options %x\n",
options);
1879 "EM_SETOPTIONS: Text not changed! s1:%s s2:%s\n",
text,
buffer);
1888 "EM_SETOPTIONS: Text changed! s1:%s s2:%s\n",
text,
buffer);
1893 ok(dwStyle &
ES_READONLY,
"Readonly style not set by EM_SETOPTIONS\n");
1901 "EM_SETOPTIONS: Text changed! s1:%s s2:%s\n",
text,
buffer);
1907 "Options set by SetWindowLong (%x -> %x)\n", oldOptions,
options);
1915 text_format.
cbSize =
sizeof(text_format);
1918 return (text_format.dwEffects &
CFE_LINK) != 0;
1928 ok(link_present,
"URL Case: CFE_LINK not set for [%s].\n",
url);
1932 ok(!link_present,
"Non-URL Case: CFE_LINK set for [%s].\n",
url);
1949 {
"winehq.org",
FALSE},
1950 {
"http://www.winehq.org",
TRUE},
1951 {
"http//winehq.org",
FALSE},
1952 {
"ww.winehq.org",
FALSE},
1953 {
"www.winehq.org",
TRUE},
1954 {
"ftp://192.168.1.1",
TRUE},
1955 {
"ftp//192.168.1.1",
FALSE},
1956 {
"mailto:your@email.com",
TRUE},
1957 {
"prospero:prosperoserver",
TRUE},
1958 {
"telnet:test",
TRUE},
1959 {
"news:newserver",
TRUE},
1960 {
"wais:waisserver",
TRUE}
1968 const char * templates_delim[] = {
1969 "This is some text with X on it",
1970 "This is some text with (X) on it",
1971 "This is some text with X\r on it",
1972 "This is some text with ---X--- on it",
1973 "This is some text with \"X\" on it",
1974 "This is some text with 'X' on it",
1975 "This is some text with 'X' on it",
1976 "This is some text with :X: on it",
1978 "This text ends with X",
1980 "This is some text with X) on it",
1981 "This is some text with X--- on it",
1982 "This is some text with X\" on it",
1983 "This is some text with X' on it",
1984 "This is some text with X: on it",
1986 "This is some text with (X on it",
1987 "This is some text with \rX on it",
1988 "This is some text with ---X on it",
1989 "This is some text with \"X on it",
1990 "This is some text with 'X on it",
1991 "This is some text with :X on it",
1994 const char * templates_non_delim[] = {
1995 "This is some text with |X| on it",
1996 "This is some text with *X* on it",
1997 "This is some text with /X/ on it",
1998 "This is some text with +X+ on it",
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@ 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 "This is some text with %X on it",
2008 "This is some text with #X on it",
2009 "This is some text with @X on it",
2010 "This is some text with \\X on it",
2011 "This is some text with _X on it",
2016 const char * templates_xten_delim[] = {
2017 "This is some text with X| 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 "This is some text with X# on it",
2023 "This is some text with X@ on it",
2024 "This is some text with X\\ on it",
2025 "This is some text with X_ on it",
2033 const char * templates_neutral_delim[] = {
2034 "This is some text with X-Y on it",
2035 "This is some text with X--Y on it",
2036 "This is some text with X!Y on it",
2037 "This is some text with X[Y on it",
2038 "This is some text with X]Y on it",
2039 "This is some text with X{Y on it",
2040 "This is some text with X}Y on it",
2041 "This is some text with X(Y on it",
2042 "This is some text with X)Y on it",
2043 "This is some text with X\"Y on it",
2044 "This is some text with X;Y on it",
2045 "This is some text with X:Y on it",
2046 "This is some text with X'Y on it",
2047 "This is some text with X?Y on it",
2048 "This is some text with X<Y on it",
2049 "This is some text with X>Y on it",
2050 "This is some text with X.Y on it",
2051 "This is some text with X,Y on it",
2059 ok(urlRet==0,
"Good wParam: urlRet is: %d\n", urlRet);
2061 ok(urlRet==0,
"Good wParam2: urlRet is: %d\n", urlRet);
2066 ok(urlRet==
E_INVALIDARG,
"Bad wParam2: urlRet is: %d\n", urlRet);
2090 at_pos =
strchr(templates_delim[
j],
'X');
2091 at_offset = at_pos - templates_delim[
j];
2093 buffer[at_offset] =
'\0';
2104 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", 0, 1,
buffer);
2106 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -2, at_offset -1,
buffer);
2108 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -1, at_offset,
buffer);
2113 "CFE_LINK not set in (%d-%d), text: %s\n", at_offset, at_offset +1,
buffer);
2115 "CFE_LINK not set in (%d-%d), text: %s\n", end_offset -1, end_offset,
buffer);
2120 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset, at_offset + 1,
buffer);
2122 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset -1, end_offset,
buffer);
2124 if (
buffer[end_offset] !=
'\0')
2127 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset, end_offset + 1,
buffer);
2128 if (
buffer[end_offset +1] !=
'\0')
2131 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset +1, end_offset +2,
buffer);
2141 at_pos =
strchr(templates_non_delim[
j],
'X');
2142 at_offset = at_pos - templates_non_delim[
j];
2144 buffer[at_offset] =
'\0';
2155 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", 0, 1,
buffer);
2157 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -2, at_offset -1,
buffer);
2159 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -1, at_offset,
buffer);
2162 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset, at_offset + 1,
buffer);
2164 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset -1, end_offset,
buffer);
2165 if (
buffer[end_offset] !=
'\0')
2168 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset, end_offset + 1,
buffer);
2169 if (
buffer[end_offset +1] !=
'\0')
2172 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset +1, end_offset +2,
buffer);
2182 at_pos =
strchr(templates_xten_delim[
j],
'X');
2183 at_offset = at_pos - templates_xten_delim[
j];
2185 buffer[at_offset] =
'\0';
2196 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", 0, 1,
buffer);
2198 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -2, at_offset -1,
buffer);
2200 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -1, at_offset,
buffer);
2205 "CFE_LINK not set in (%d-%d), text: %s\n", at_offset, at_offset +1,
buffer);
2207 "CFE_LINK not set in (%d-%d), text: %s\n", end_offset -1, end_offset,
buffer);
2209 "CFE_LINK not set in (%d-%d), text: %s\n", end_offset, end_offset +1,
buffer);
2214 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset, at_offset + 1,
buffer);
2216 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset -1, end_offset,
buffer);
2218 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset, end_offset +1,
buffer);
2220 if (
buffer[end_offset +1] !=
'\0')
2223 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset +1, end_offset + 2,
buffer);
2224 if (
buffer[end_offset +2] !=
'\0')
2227 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset +2, end_offset +3,
buffer);
2233 char * at_pos, * end_pos;
2237 if (!urls[
i].is_url)
continue;
2239 at_pos =
strchr(templates_neutral_delim[
j],
'X');
2240 at_offset = at_pos - templates_neutral_delim[
j];
2242 buffer[at_offset] =
'\0';
2247 end_offset = end_pos -
buffer;
2255 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", 0, 1,
buffer);
2257 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -2, at_offset -1,
buffer);
2259 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -1, at_offset,
buffer);
2262 "CFE_LINK not set in (%d-%d), text: %s\n", at_offset, at_offset +1,
buffer);
2264 "CFE_LINK not set in (%d-%d), text: %s\n", end_offset -1, end_offset,
buffer);
2266 "CFE_LINK not set in (%d-%d), text: %s\n", end_offset, end_offset +1,
buffer);
2274 "CFE_LINK not set in (%d-%d), text: %s\n", at_offset, at_offset +1,
buffer);
2276 "CFE_LINK set in (%d-%d), text: %s\n", end_offset -1, end_offset,
buffer);
2278 "CFE_LINK set in (%d-%d), text: %s\n", end_offset, end_offset +1,
buffer);
2282 hwndRichEdit =
NULL;
2287 for (
i = 0;
i < 2;
i++) {
2291 for (
j = 0;
j < 3;
j++) {
2297 at_pos =
strchr(templates_delim[
j],
'X');
2298 at_offset = at_pos - templates_delim[
j];
2303 for (
u = 0; templates_delim[
j][
u];
u++) {
2304 if (templates_delim[
j][
u] ==
'\r') {
2306 }
else if (templates_delim[
j][
u] !=
'X') {
2309 for (
v = 0; urls[
i].text[
v];
v++) {
2319 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", 0, 1,
buffer);
2321 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -2, at_offset -1,
buffer);
2323 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -1, at_offset,
buffer);
2328 "CFE_LINK not set in (%d-%d), text: %s\n", at_offset, at_offset +1,
buffer);
2330 "CFE_LINK not set in (%d-%d), text: %s\n", end_offset -1, end_offset,
buffer);
2335 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset, at_offset + 1,
buffer);
2337 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset -1, end_offset,
buffer);
2339 if (
buffer[end_offset] !=
'\0')
2342 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset, end_offset + 1,
buffer);
2343 if (
buffer[end_offset +1] !=
'\0')
2346 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset +1, end_offset +2,
buffer);
2358 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", 0, 1,
buffer);
2360 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -2, at_offset -1,
buffer);
2362 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -1, at_offset,
buffer);
2365 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset, at_offset + 1,
buffer);
2368 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset, end_offset+1,
buffer);
2369 ok(
buffer[end_offset],
"buffer \"%s\" ended prematurely. Is it missing a newline character?\n",
buffer);
2370 if (
buffer[end_offset] != 0 &&
buffer[end_offset+1] !=
'\0')
2373 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset+1, end_offset +2,
buffer);
2374 if (
buffer[end_offset +2] !=
'\0')
2377 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset +2, end_offset +3,
buffer);
2388 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", 0, 1,
buffer);
2390 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -2, at_offset -1,
buffer);
2392 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -1, at_offset,
buffer);
2397 "CFE_LINK not set in (%d-%d), text: %s\n", at_offset, at_offset +1,
buffer);
2399 "CFE_LINK not set in (%d-%d), text: %s\n", end_offset -1, end_offset,
buffer);
2404 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset, at_offset + 1,
buffer);
2406 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset -1, end_offset,
buffer);
2408 if (
buffer[end_offset] !=
'\0')
2411 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset, end_offset + 1,
buffer);
2412 if (
buffer[end_offset +1] !=
'\0')
2415 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset +1, end_offset +2,
buffer);
2420 hwndRichEdit =
NULL;
2425 for (
i = 0;
i < 2;
i++) {
2448 at_pos =
strchr(templates_delim[
j],
'X');
2449 at_offset = at_pos - templates_delim[
j];
2451 buffer[at_offset] =
'\0';
2462 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", 0, 1,
buffer);
2464 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -2, at_offset -1,
buffer);
2466 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -1, at_offset,
buffer);
2471 "CFE_LINK not set in (%d-%d), text: %s\n", at_offset, at_offset +1,
buffer);
2473 "CFE_LINK not set in (%d-%d), text: %s\n", end_offset -1, end_offset,
buffer);
2478 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset, at_offset + 1,
buffer);
2480 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset -1, end_offset,
buffer);
2482 if (
buffer[end_offset] !=
'\0')
2485 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset, end_offset + 1,
buffer);
2486 if (
buffer[end_offset +1] !=
'\0')
2489 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset +1, end_offset +2,
buffer);
2500 at_pos =
strchr(templates_delim[
j],
'X');
2501 at_offset = at_pos - templates_delim[
j];
2516 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", 0, 1,
buffer);
2518 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -2, at_offset -1,
buffer);
2520 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -1, at_offset,
buffer);
2525 "CFE_LINK not set in (%d-%d), text: %s\n", at_offset, at_offset +1,
buffer);
2527 "CFE_LINK not set in (%d-%d), text: %s\n", end_offset -1, end_offset,
buffer);
2532 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset, at_offset + 1,
buffer);
2534 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset -1, end_offset,
buffer);
2536 if (
buffer[end_offset] !=
'\0')
2539 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset, end_offset + 1,
buffer);
2540 if (
buffer[end_offset +1] !=
'\0')
2543 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset +1, end_offset +2,
buffer);
2554 at_pos =
strchr(templates_delim[
j],
'X');
2555 at_offset = at_pos - templates_delim[
j];
2575 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", 0, 1,
buffer);
2577 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -2, at_offset -1,
buffer);
2579 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -1, at_offset,
buffer);
2584 "CFE_LINK not set in (%d-%d), text: %s\n", at_offset, at_offset +1,
buffer);
2586 "CFE_LINK not set in (%d-%d), text: %s\n", end_offset -1, end_offset,
buffer);
2591 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset, at_offset + 1,
buffer);
2593 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset -1, end_offset,
buffer);
2595 if (
buffer[end_offset] !=
'\0')
2598 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset, end_offset + 1,
buffer);
2599 if (
buffer[end_offset +1] !=
'\0')
2602 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset +1, end_offset +2,
buffer);
2608 hwndRichEdit =
NULL;
2613 for (
i = 0;
i < 2;
i++) {
2622 at_pos =
strchr(templates_delim[
j],
'X');
2623 at_offset = at_pos - templates_delim[
j];
2635 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", 0, 1,
buffer);
2637 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -2, at_offset -1,
buffer);
2639 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -1, at_offset,
buffer);
2644 "CFE_LINK not set in (%d-%d), text: %s\n", at_offset, at_offset +1,
buffer);
2646 "CFE_LINK not set in (%d-%d), text: %s\n", end_offset -1, end_offset,
buffer);
2651 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset, at_offset + 1,
buffer);
2653 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset -1, end_offset,
buffer);
2655 if (
buffer[end_offset] !=
'\0')
2658 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset, end_offset + 1,
buffer);
2659 if (
buffer[end_offset +1] !=
'\0')
2662 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset +1, end_offset +2,
buffer);
2673 at_pos =
strchr(templates_delim[
j],
'X');
2674 at_offset = at_pos - templates_delim[
j];
2691 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", 0, 1,
buffer);
2693 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -2, at_offset -1,
buffer);
2695 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -1, at_offset,
buffer);
2700 "CFE_LINK not set in (%d-%d), text: %s\n", at_offset, at_offset +1,
buffer);
2702 "CFE_LINK not set in (%d-%d), text: %s\n", end_offset -1, end_offset,
buffer);
2707 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset, at_offset + 1,
buffer);
2709 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset -1, end_offset,
buffer);
2711 if (
buffer[end_offset] !=
'\0')
2714 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset, end_offset + 1,
buffer);
2715 if (
buffer[end_offset +1] !=
'\0')
2718 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset +1, end_offset +2,
buffer);
2724 hwndRichEdit =
NULL;
2736 int y_before, y_after;
2741 for (
i = 0;
i < 4;
i++) {
2746 ok(
expr ==
r,
"EM_SCROLL improper return value returned (i == %d). " 2747 "Got 0x%08x, expected 0x%08x\n",
i,
r,
expr);
2748 ok(y_after == 0,
"EM_SCROLL improper scroll. scrolled to line %d, not 1 " 2749 "(i == %d)\n", y_after,
i);
2757 for (
i = 0;
i < 2;
i++) {
2762 "a LONG LINE LONG LINE LONG LINE LONG LINE LONG LINE " 2763 "LONG LINE LONG LINE LONG LINE LONG LINE LONG LINE " 2764 "LONG LINE \nb\nc\nd\ne");
2765 for (
j = 0;
j < 12;
j++)
2775 ok(((
r & 0xffffff00) == 0x00010000) &&
2776 ((
r & 0x000000ff) != 0x00000000),
2777 "EM_SCROLL page down didn't scroll by a small positive number of " 2778 "lines (r == 0x%08x)\n",
r);
2779 ok(y_after > y_before,
"EM_SCROLL page down not functioning " 2780 "(line %d scrolled to line %d\n", y_before, y_after);
2786 ok(((
r & 0xffffff00) == 0x0001ff00),
2787 "EM_SCROLL page up didn't scroll by a small negative number of lines " 2788 "(r == 0x%08x)\n",
r);
2789 ok(y_after < y_before,
"EM_SCROLL page up not functioning (line " 2790 "%d scrolled to line %d\n", y_before, y_after);
2798 ok(
r == 0x00010001,
"EM_SCROLL line down didn't scroll by one line " 2799 "(r == 0x%08x)\n",
r);
2800 ok(y_after -1 == y_before,
"EM_SCROLL line down didn't go down by " 2801 "1 line (%d scrolled to %d)\n", y_before, y_after);
2809 ok(
r == 0x0001ffff,
"EM_SCROLL line up didn't scroll by one line " 2810 "(r == 0x%08x)\n",
r);
2811 ok(y_after +1 == y_before,
"EM_SCROLL line up didn't go up by 1 " 2812 "line (%d scrolled to %d)\n", y_before, y_after);
2822 "EM_SCROLL line up returned indicating movement (0x%08x)\n",
r);
2823 ok(y_before == y_after,
2824 "EM_SCROLL line up beyond top worked (%d)\n", y_after);
2834 "EM_SCROLL page up returned indicating movement (0x%08x)\n",
r);
2835 ok(y_before == y_after,
2836 "EM_SCROLL page up beyond top worked (%d)\n", y_after);
2838 for (
j = 0;
j < 12;
j++)
2846 "EM_SCROLL page down returned indicating movement (0x%08x)\n",
r);
2847 ok(y_before == y_after,
2848 "EM_SCROLL page down beyond bottom worked (%d -> %d)\n",
2856 "EM_SCROLL line down returned indicating movement (0x%08x)\n",
r);
2857 ok(y_before == y_after,
2858 "EM_SCROLL line down beyond bottom worked (%d -> %d)\n",
2899 const char *
text=
"a\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\n";
2915 memset(&si, 0,
sizeof(si));
2920 "Vertical scrollbar is visible, should be invisible.\n");
2922 "reported page/range is %d (%d..%d) expected all 0 or nMax=100\n",
2926 memset(&si, 0,
sizeof(si));
2931 "Vertical scrollbar is visible, should be invisible.\n");
2933 "reported page/range is %d (%d..%d) expected all 0 or nMax=100\n",
2937 memset(&si, 0,
sizeof(si));
2942 "Vertical scrollbar is invisible, should be visible.\n");
2944 "reported page/range is %d (%d..%d) expected nMax/nPage nonzero\n",
2950 memset(&si, 0,
sizeof(si));
2955 "Vertical scrollbar is visible, should be invisible.\n");
2957 "reported page/range is %d (%d..%d) expected nMax/nPage nonzero\n",
2962 memset(&si, 0,
sizeof(si));
2967 "Vertical scrollbar is visible, should be invisible.\n");
2969 "reported page/range is %d (%d..%d) expected nMax/nPage nonzero\n",
2973 memset(&si, 0,
sizeof(si));
2978 "Vertical scrollbar is visible, should be invisible.\n");
2980 "reported page/range is %d (%d..%d) expected nMax/nPage nonzero\n",
2984 memset(&si, 0,
sizeof(si));
2989 "Vertical scrollbar is visible, should be invisible.\n");
2991 "reported page/range is %d (%d..%d) expected nMax/nPage nonzero\n",
2995 memset(&si, 0,
sizeof(si));
3000 "Vertical scrollbar is visible, should be invisible.\n");
3002 "reported page/range is %d (%d..%d) expected nMax/nPage nonzero\n",
3011 memset(&si, 0,
sizeof(si));
3016 "Vertical scrollbar is invisible, should be visible.\n");
3018 "reported page/range is %d (%d..%d) expected 0 (0..1)\n",
3022 memset(&si, 0,
sizeof(si));
3027 "Vertical scrollbar is invisible, should be visible.\n");
3029 "reported page/range is %d (%d..%d) expected 0 (0..1)\n",
3033 memset(&si, 0,
sizeof(si));
3038 "Vertical scrollbar is invisible, should be visible.\n");
3040 "reported page/range is %d (%d..%d)\n",
3045 memset(&si, 0,
sizeof(si));
3050 "Vertical scrollbar is invisible, should be visible.\n");
3052 "reported page/range is %d (%d..%d) expected nMax/nPage nonzero\n",
3057 memset(&si, 0,
sizeof(si));
3062 "Vertical scrollbar is invisible, should be visible.\n");
3064 "reported page/range is %d (%d..%d) expected nMax/nPage nonzero\n",
3068 memset(&si, 0,
sizeof(si));
3073 "Vertical scrollbar is invisible, should be visible.\n");
3075 "reported page/range is %d (%d..%d) expected nMax/nPage nonzero\n",
3079 memset(&si, 0,
sizeof(si));
3084 "Vertical scrollbar is invisible, should be visible.\n");
3086 "reported page/range is %d (%d..%d) expected nMax/nPage nonzero\n",
3090 memset(&si, 0,
sizeof(si));
3095 "Vertical scrollbar is invisible, should be visible.\n");
3097 "reported page/range is %d (%d..%d) expected nMax/nPage nonzero\n",
3107 memset(&si, 0,
sizeof(si));
3112 "Vertical scrollbar is invisible, should be visible.\n");
3115 "reported page/range is %d (%d..%d) expected 0 (0..100)\n",
3121 memset(&si, 0,
sizeof(si));
3126 "Vertical scrollbar is invisible, should be visible.\n");
3129 "reported page/range is %d (%d..%d) expected 0 (0..100)\n",
3135 memset(&si, 0,
sizeof(si));
3140 "Vertical scrollbar is invisible, should be visible.\n");
3143 "reported page/range is %d (%d..%d) expected 0 (0..100)\n",
3149 memset(&si, 0,
sizeof(si));
3154 "Vertical scrollbar is invisible, should be visible.\n");
3157 "reported page/range is %d (%d..%d) expected 0 (0..100)\n",
3163 memset(&si, 0,
sizeof(si));
3168 "Vertical scrollbar is invisible, should be visible.\n");
3171 "reported page/range is %d (%d..%d) expected 0 (0..100)\n",
3177 memset(&si, 0,
sizeof(si));
3182 "Vertical scrollbar is visible, should be invisible.\n");
3184 "reported page/range is %d (%d..%d) expected nMax/nPage nonzero\n",
3192 memset(&si, 0,
sizeof(si));
3197 "Vertical scrollbar is visible, should be invisible.\n");
3199 "reported page/range is %d (%d..%d) expected all 0 or nMax=100\n",
3203 memset(&si, 0,
sizeof(si));
3208 "Vertical scrollbar is visible, should be invisible.\n");
3210 "reported page/range is %d (%d..%d) expected all 0 or nMax=100\n",
3214 memset(&si, 0,
sizeof(si));
3219 "Vertical scrollbar is visible, should be invisible.\n");
3221 "reported page/range is %d (%d..%d) expected all 0 or nMax=100\n",
3225 memset(&si, 0,
sizeof(si));
3230 "Vertical scrollbar is visible, should be invisible.\n");
3232 "reported page/range is %d (%d..%d) expected all 0 or nMax=100\n",
3236 memset(&si, 0,
sizeof(si));
3241 "Vertical scrollbar is invisible, should be visible.\n");
3243 "reported page/range is %d (%d..%d)\n",
3248 memset(&si, 0,
sizeof(si));
3253 "Vertical scrollbar is visible, should be invisible.\n");
3255 "reported page/range is %d (%d..%d)\n",
3259 memset(&si, 0,
sizeof(si));
3264 "Vertical scrollbar is visible, should be invisible.\n");
3266 "reported page/range is %d (%d..%d)\n",
3272 memset(&si, 0,
sizeof(si));
3277 "Vertical scrollbar is invisible, should be visible.\n");
3279 "reported page/range is %d (%d..%d)\n",
3283 memset(&si, 0,
sizeof(si));
3288 "Vertical scrollbar is visible, should be invisible.\n");
3290 "reported page/range is %d (%d..%d)\n",
3295 memset(&si, 0,
sizeof(si));
3300 "Vertical scrollbar is invisible, should be visible.\n");
3302 "reported page/range is %d (%d..%d)\n",
3306 memset(&si, 0,
sizeof(si));
3311 "Vertical scrollbar is visible, should be invisible.\n");
3313 "reported page/range is %d (%d..%d) expected nMax/nPage nonzero\n",
3317 memset(&si, 0,
sizeof(si));
3322 "Vertical scrollbar is invisible, should be visible.\n");
3324 "reported page/range is %d (%d..%d)\n",
3333 #define ENABLE_WS_VSCROLL(hwnd) \ 3334 SetWindowLongA(hwnd, GWL_STYLE, GetWindowLongA(hwnd, GWL_STYLE) | WS_VSCROLL) 3335 #define DISABLE_WS_VSCROLL(hwnd) \ 3336 SetWindowLongA(hwnd, GWL_STYLE, GetWindowLongA(hwnd, GWL_STYLE) & ~WS_VSCROLL) 3340 memset(&si, 0,
sizeof(si));
3345 "Vertical scrollbar is invisible, should be visible.\n");
3347 "reported page/range is %d (%d..%d) expected all 0 or nMax=100\n",
3352 memset(&si, 0,
sizeof(si));
3357 "Vertical scrollbar is invisible, should be visible.\n");
3359 "reported page/range is %d (%d..%d) expected all 0 or nMax=100\n",
3364 memset(&si, 0,
sizeof(si));
3369 "Vertical scrollbar is invisible, should be visible.\n");
3371 "reported page/range is %d (%d..%d) expected all 0 or nMax=100\n",
3376 memset(&si, 0,
sizeof(si));
3381 "Vertical scrollbar is invisible, should be visible.\n");
3383 "reported page/range is %d (%d..%d) expected all 0 or nMax=100\n",
3388 memset(&si, 0,
sizeof(si));
3393 "Vertical scrollbar is invisible, should be visible.\n");
3395 "reported page/range is %d (%d..%d) expected all 0 or nMax=100\n",
3400 memset(&si, 0,
sizeof(si));
3405 "Vertical scrollbar is visible, should be invisible.\n");
3407 "reported page/range is %d (%d..%d) expected nMax/nPage nonzero\n",
3415 memset(&si, 0,
sizeof(si));
3420 "Vertical scrollbar is visible, should be invisible.\n");
3422 "reported page/range is %d (%d..%d) expected all 0 or nMax=100\n",
3426 memset(&si, 0,
sizeof(si));
3431 "Vertical scrollbar is visible, should be invisible.\n");
3433 "reported page/range is %d (%d..%d) expected all 0 or nMax=100\n",
3437 memset(&si, 0,
sizeof(si));
3442 "Vertical scrollbar is visible, should be invisible.\n");
3444 "reported page/range is %d (%d..%d) expected all 0 or nMax=100\n",
3448 memset(&si, 0,
sizeof(si));
3453 "Vertical scrollbar is visible, should be invisible.\n");
3455 "reported page/range is %d (%d..%d) expected all 0 or nMax=100\n",
3459 memset(&si, 0,
sizeof(si));
3464 "Vertical scrollbar is invisible, should be visible.\n");
3466 "reported page/range is %d (%d..%d)\n",
3471 memset(&si, 0,
sizeof(si));
3476 "Vertical scrollbar is visible, should be invisible.\n");
3478 "reported page/range is %d (%d..%d)\n",
3482 memset(&si, 0,
sizeof(si));
3487 "Vertical scrollbar is visible, should be invisible.\n");
3489 "reported page/range is %d (%d..%d) expected nMax/nPage nonzero\n",
3493 memset(&si, 0,
sizeof(si));
3498 "Vertical scrollbar is invisible, should be visible.\n");
3500 "reported page/range is %d (%d..%d)\n",
3504 memset(&si, 0,
sizeof(si));
3509 "Vertical scrollbar is visible, should be invisible.\n");
3511 "reported page/range is %d (%d..%d)\n",
3517 memset(&si, 0,
sizeof(si));
3522 "Vertical scrollbar is invisible, should be visible.\n");
3524 "reported page/range is %d (%d..%d)\n",
3528 memset(&si, 0,
sizeof(si));
3533 "Vertical scrollbar is visible, should be invisible.\n");
3535 "reported page/range is %d (%d..%d)\n",
3540 memset(&si, 0,
sizeof(si));
3545 "Vertical scrollbar is invisible, should be visible.\n");
3547 "reported page/range is %d (%d..%d)\n",
3569 "WM_SIZE/scrollbar mutual recursion detected, expected none!\n");
3576 "WM_SIZE/scrollbar mutual recursion detected, expected none!\n");
3610 for (
i=0;
i<101;
i++)
3612 for (
i=0;
i<100;
i++)
3615 "EM_SETUNDOLIMIT allowed more than a hundred undo's by default.\n");
3623 "EM_SETUNDOLIMIT allowed undo with UNDOLIMIT set to 0\n");
3633 "EM_SETUNDOLIMIT didn't allow the first undo with UNDOLIMIT set to 2\n");
3636 "EM_SETUNDOLIMIT didn't allow a second undo with UNDOLIMIT set to 2\n");
3639 "EM_SETUNDOLIMIT allowed a third undo with UNDOLIMIT set to 2\n");
3645 "EM_SETUNDOLIMIT returned %d when set to -1, instead of 100\n",
result);
3660 "EM_GETPASSWORDCHAR returned %c by default, instead of NULL\n",
result);
3666 "EM_GETPASSWORDCHAR returned %c (%d) when set to 'x', instead of x (120)\n",
result,
result);
3672 "EM_GETPASSWORDCHAR returned %c (%d) when set to 'x', instead of x (120)\n",
result,
result);
3683 char**
str = (
char**)dwCookie;
3696 const char * TestItem1 =
"TestSomeText";
3697 const char * TestItem2 =
"TestSomeText\r";
3698 const char * TestItem2_after =
"TestSomeText\r\n";
3699 const char * TestItem3 =
"TestSomeText\rSomeMoreText\r";
3700 const char * TestItem3_after =
"TestSomeText\r\nSomeMoreText\r\n";
3701 const char * TestItem4 =
"TestSomeText\n\nTestSomeText";
3702 const char * TestItem4_after =
"TestSomeText\r\n\r\nTestSomeText";
3703 const char * TestItem5 =
"TestSomeText\r\r\nTestSomeText";
3704 const char * TestItem5_after =
"TestSomeText TestSomeText";
3705 const char * TestItem6 =
"TestSomeText\r\r\n\rTestSomeText";
3706 const char * TestItem6_after =
"TestSomeText \r\nTestSomeText";
3707 const char * TestItem7 =
"TestSomeText\r\n\r\r\n\rTestSomeText";
3708 const char * TestItem7_after =
"TestSomeText\r\n \r\nTestSomeText";
3710 const char rtftextA[] =
"{\\rtf sometext}";
3711 const char urtftextA[] =
"{\\urtf sometext}";
3712 const WCHAR rtftextW[] = {
'{',
'\\',
'r',
't',
'f',
' ',
's',
'o',
'm',
'e',
't',
'e',
'x',
't',
'}',0};
3713 const WCHAR urtftextW[] = {
'{',
'\\',
'u',
'r',
't',
'f',
' ',
's',
'o',
'm',
'e',
't',
'e',
'x',
't',
'}',0};
3714 const WCHAR sometextW[] = {
's',
'o',
'm',
'e',
't',
'e',
'x',
't',0};
3716 char buf[1024] = {0};
3717 WCHAR bufW[1024] = {0};
3726 #define TEST_SETTEXT(a, b) \ 3727 result = SendMessageA(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)a); \ 3728 ok (result == 1, "WM_SETTEXT returned %ld instead of 1\n", result); \ 3729 result = SendMessageA(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM)buf); \ 3730 ok (result == lstrlenA(buf), \ 3731 "WM_GETTEXT returned %ld instead of expected %u\n", \ 3732 result, lstrlenA(buf)); \ 3733 result = strcmp(b, buf); \ 3735 "WM_SETTEXT round trip: strcmp = %ld, text=\"%s\"\n", result, buf); 3754 #define TEST_SETTEXTW(a, b) \ 3755 result = SendMessageW(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)a); \ 3756 ok (result == 1, "WM_SETTEXT returned %ld instead of 1\n", result); \ 3757 result = SendMessageW(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM)bufW); \ 3758 ok (result == lstrlenW(bufW), \ 3759 "WM_GETTEXT returned %ld instead of expected %u\n", \ 3760 result, lstrlenW(bufW)); \ 3761 result = lstrcmpW(b, bufW); \ 3762 ok(result == 0, "WM_SETTEXT round trip: strcmp = %ld\n", result); 3773 #undef TEST_SETTEXTW 3778 ok(
result == 1,
"WM_SETTEXT returned %ld, expected 12\n",
result);
3780 ok(
result == 5,
"WM_GETTEXT returned %ld, expected 5\n",
result);
3781 ok(!
strcmp(
buf,
"line1"),
"WM_GETTEXT returned incorrect string '%s'\n",
buf);
3783 ok(
result == 1,
"WM_SETTEXT returned %ld, expected 1\n",
result);
3785 ok(
result == 3,
"WM_GETTEXT returned %ld, expected 3\n",
result);
3786 ok(!
strcmp(
buf,
"ABC"),
"WM_GETTEXT returned incorrect string '%s'\n",
buf);
3797 char**
str = (
char**)dwCookie;
3798 ok(*pcb ==
cb || *pcb == 0,
"cb %d, *pcb %d\n",
cb, *pcb);
3810 const char *
p =
buf;