oleacc/tests: Fix some failures on Win98 up to W2K.

This commit is contained in:
Paul Vriens 2008-10-23 09:36:40 +02:00 committed by Alexandre Julliard
parent 29e49bbe8e
commit c9b8a28576
1 changed files with 17 additions and 2 deletions

View File

@ -24,8 +24,8 @@
static void test_getroletext(void)
{
INT ret, role;
CHAR buf[2], *buff, buff2[100];
WCHAR bufW[2], *buffW, buff2W[100];
CHAR buf[2], *buff;
WCHAR bufW[2], *buffW;
/* wrong role number */
ret = GetRoleTextA(-1, NULL, 0);
@ -103,11 +103,26 @@ static void test_getroletext(void)
/* check returned length for all roles */
for(role = 0; role <= ROLE_SYSTEM_OUTLINEBUTTON; role++){
CHAR buff2[100];
WCHAR buff2W[100];
/* NT4 and W2K don't clear the buffer on a non existing role in the A-call */
memset(buff2, 0, sizeof(buff2));
ret = GetRoleTextA(role, NULL, 0);
/* Win98 up to W2K miss some of the roles */
if (role >= ROLE_SYSTEM_SPLITBUTTON)
ok(ret > 0 || broken(ret == 0), "Expected the role %d to be present\n", role);
else
ok(ret > 0, "Expected the role to be present\n");
GetRoleTextA(role, buff2, sizeof(buff2));
ok(ret == lstrlenA(buff2),
"GetRoleTextA: returned length doesn't match returned buffer for role %d\n", role);
/* Win98 and WinMe don't clear the buffer on a non existing role in the W-call */
memset(buff2W, 0, sizeof(buff2W));
ret = GetRoleTextW(role, NULL, 0);
GetRoleTextW(role, buff2W, sizeof(buff2W)/sizeof(WCHAR));
ok(ret == lstrlenW(buff2W),