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

Alexandre Julliard julliard at winehq.org
Thu Oct 23 08:38:09 CDT 2008


Module: wine
Branch: master
Commit: c9b8a28576d046d2c98054c3bf53d402e563d9d8
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=c9b8a28576d046d2c98054c3bf53d402e563d9d8

Author: Paul Vriens <Paul.Vriens.Wine at gmail.com>
Date:   Thu Oct 23 09:36:40 2008 +0200

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

---

 dlls/oleacc/tests/main.c |   19 +++++++++++++++++--
 1 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/dlls/oleacc/tests/main.c b/dlls/oleacc/tests/main.c
index 66b25af..b977a7b 100644
--- a/dlls/oleacc/tests/main.c
+++ b/dlls/oleacc/tests/main.c
@@ -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),




More information about the wine-cvs mailing list