[ros-diffs] [jimtabor] 49117: [Wine Tests] - Update the only two tests that I tested and know that does not have RTL support. The Right To Left support will be another comprehensive change that can be done in ...

jimtabor at svn.reactos.org jimtabor at svn.reactos.org
Mon Oct 11 15:12:48 UTC 2010


Author: jimtabor
Date: Mon Oct 11 15:12:47 2010
New Revision: 49117

URL: http://svn.reactos.org/svn/reactos?rev=49117&view=rev
Log:
[Wine Tests]
- Update the only two tests that I tested and know that does not have RTL support. The Right To Left support will be another comprehensive change that can be done in a non intrusive way as long no one uses it.

Modified:
    trunk/rostests/winetests/user32/class.c
    trunk/rostests/winetests/user32/dialog.c

Modified: trunk/rostests/winetests/user32/class.c
URL: http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/class.c?rev=49117&r1=49116&r2=49117&view=diff
==============================================================================
--- trunk/rostests/winetests/user32/class.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/user32/class.c [iso-8859-1] Mon Oct 11 15:12:47 2010
@@ -19,7 +19,7 @@
  */
 
 /* To get CS_DROPSHADOW with the MSVC headers */
-#define _WIN32_WINNT 0x0501
+//#define _WIN32_WINNT 0x0501
 
 #include <assert.h>
 #include <stdlib.h>
@@ -315,6 +315,7 @@
 static void test_instances(void)
 {
     WNDCLASSA cls, wc;
+    WNDCLASSEXA wcexA;
     HWND hwnd, hwnd2;
     const char *name = "__test__";
     HINSTANCE kernel32 = GetModuleHandleA("kernel32");
@@ -347,6 +348,25 @@
     check_instance( name, kernel32, kernel32, kernel32 );
     check_thread_instance( name, kernel32, kernel32, kernel32 );
     ok( UnregisterClassA( name, kernel32 ), "Unregister failed for kernel32\n" );
+
+    ZeroMemory(&wcexA, sizeof(wcexA));
+    wcexA.lpfnWndProc = DefWindowProcA;
+    wcexA.lpszClassName = "__classex_test__";
+    SetLastError(0xdeadbeef);
+    wcexA.cbSize = sizeof(wcexA) - 1;
+    ok( ((RegisterClassExA( &wcexA ) == 0) && (GetLastError() == ERROR_INVALID_PARAMETER)),
+          "Succeeded with invalid number of cbSize bytes\n");
+    SetLastError(0xdeadbeef);
+    wcexA.cbSize = sizeof(wcexA) + 1;
+    ok( ((RegisterClassExA( &wcexA ) == 0) && (GetLastError() == ERROR_INVALID_PARAMETER)),
+          "Succeeded with invalid number of cbSize bytes\n");
+    SetLastError(0xdeadbeef);
+    wcexA.cbSize = sizeof(wcexA);
+    ok( RegisterClassExA( &wcexA ), "Failed with valid number of cbSize bytes\n");
+    wcexA.cbSize = 0xdeadbeef;
+    ok( GetClassInfoEx(main_module, wcexA.lpszClassName, &wcexA), "GetClassInfoEx failed\n");
+    ok( wcexA.cbSize == 0xdeadbeef, "GetClassInfoEx returned wrong cbSize value %d\n", wcexA.cbSize);
+    UnregisterClassA(wcexA.lpszClassName, main_module);
 
     /* Bug 2631 - Supplying an invalid number of bytes fails */
     cls.cbClsExtra    = 0;
@@ -880,10 +900,71 @@
     }
 }
 
+static void test_GetClassInfo(void)
+{
+    static const WCHAR staticW[] = {'s','t','a','t','i','c',0};
+    WNDCLASSA wc;
+    WNDCLASSEXA wcx;
+    BOOL ret;
+
+    SetLastError(0xdeadbeef);
+    ret = GetClassInfoA(0, "static", &wc);
+    ok(ret, "GetClassInfoA() error %d\n", GetLastError());
+
+if (0) { /* crashes under XP */
+    SetLastError(0xdeadbeef);
+    ret = GetClassInfoA(0, "static", NULL);
+    ok(ret, "GetClassInfoA() error %d\n", GetLastError());
+
+    SetLastError(0xdeadbeef);
+    ret = GetClassInfoW(0, staticW, NULL);
+    ok(ret, "GetClassInfoW() error %d\n", GetLastError());
+}
+
+    wcx.cbSize = sizeof(wcx);
+    SetLastError(0xdeadbeef);
+    ret = GetClassInfoExA(0, "static", &wcx);
+    ok(ret, "GetClassInfoExA() error %d\n", GetLastError());
+
+    SetLastError(0xdeadbeef);
+    ret = GetClassInfoExA(0, "static", NULL);
+    ok(!ret, "GetClassInfoExA() should fail\n");
+    ok(GetLastError() == ERROR_NOACCESS ||
+       broken(GetLastError() == 0xdeadbeef), /* win9x */
+       "expected ERROR_NOACCESS, got %d\n", GetLastError());
+
+    SetLastError(0xdeadbeef);
+    ret = GetClassInfoExW(0, staticW, NULL);
+    ok(!ret, "GetClassInfoExW() should fail\n");
+    ok(GetLastError() == ERROR_NOACCESS ||
+       broken(GetLastError() == 0xdeadbeef) /* NT4 */ ||
+       broken(GetLastError() == ERROR_CALL_NOT_IMPLEMENTED), /* win9x */
+       "expected ERROR_NOACCESS, got %d\n", GetLastError());
+
+    wcx.cbSize = 0;
+    SetLastError(0xdeadbeef);
+    ret = GetClassInfoExA(0, "static", &wcx);
+    ok(ret, "GetClassInfoExA() error %d\n", GetLastError());
+    ok(wcx.cbSize == 0, "expected 0, got %u\n", wcx.cbSize);
+
+    wcx.cbSize = sizeof(wcx) - 1;
+    SetLastError(0xdeadbeef);
+    ret = GetClassInfoExA(0, "static", &wcx);
+    ok(ret, "GetClassInfoExA() error %d\n", GetLastError());
+    ok(wcx.cbSize == sizeof(wcx) - 1, "expected sizeof(wcx)-1, got %u\n", wcx.cbSize);
+
+    wcx.cbSize = sizeof(wcx) + 1;
+    SetLastError(0xdeadbeef);
+    ret = GetClassInfoExA(0, "static", &wcx);
+    ok(ret, "GetClassInfoExA() error %d\n", GetLastError());
+    ok(wcx.cbSize == sizeof(wcx) + 1, "expected sizeof(wcx)+1, got %u\n", wcx.cbSize);
+}
+
 START_TEST(class)
 {
     HANDLE hInstance = GetModuleHandleA( NULL );
 
+    test_GetClassInfo();
     test_extra_values();
 
     if (!GetModuleHandleW(0))

Modified: trunk/rostests/winetests/user32/dialog.c
URL: http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/dialog.c?rev=49117&r1=49116&r2=49117&view=diff
==============================================================================
--- trunk/rostests/winetests/user32/dialog.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/user32/dialog.c [iso-8859-1] Mon Oct 11 15:12:47 2010
@@ -760,12 +760,7 @@
        return TRUE;
 
     case WM_COMMAND:
-       if (LOWORD(wParam) == IDCANCEL)
-       {
-           EndDialog(hDlg, LOWORD(wParam));
-           return TRUE;
-       }
-       else if (LOWORD(wParam) == 200)
+       if (LOWORD(wParam) == 200)
        {
            if (HIWORD(wParam) == EN_SETFOCUS)
                g_hwndInitialFocusT1 = (HWND)lParam;
@@ -1005,6 +1000,28 @@
     return FALSE;
 }
 
+static INT_PTR CALLBACK TestReturnKeyDlgProc (HWND hDlg, UINT uiMsg,
+        WPARAM wParam, LPARAM lParam)
+{
+    static int received_idok = 0;
+    switch (uiMsg)
+    {
+    case WM_INITDIALOG:
+        {
+            MSG msg = {hDlg, WM_KEYDOWN, VK_RETURN, 0x011c0001};
+            IsDialogMessage(hDlg, &msg);
+        }
+        ok(received_idok, "WM_COMMAND not received\n");
+        EndDialog(hDlg, 0);
+        return TRUE;
+    case WM_COMMAND:
+        ok(wParam==IDOK, "Expected IDOK\n");
+        received_idok = 1;
+        return TRUE;
+    }
+    return FALSE;
+}
+
 static void test_DialogBoxParamA(void)
 {
     INT_PTR ret;
@@ -1049,6 +1066,8 @@
 
     ret = DialogBoxParamA(GetModuleHandle(NULL), "TEST_EMPTY_DIALOG", 0, TestDefButtonDlgProc, 0);
     ok(ret == IDOK, "Expected IDOK\n");
+
+    DialogBoxParamA(GetModuleHandle(NULL), "TEST_EMPTY_DIALOG", 0, TestReturnKeyDlgProc, 0);
 }
 
 static void test_DisabledDialogTest(void)




More information about the Ros-diffs mailing list