[USER32_APITEST]
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Thu, 3 Mar 2011 21:49:44 +0000 (21:49 +0000)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Thu, 3 Mar 2011 21:49:44 +0000 (21:49 +0000)
Add a cursor and an icon and use those instead of system cursor. Fixes tests on Windows.

svn path=/trunk/; revision=50965

rostests/apitests/user32/CMakeLists.txt
rostests/apitests/user32/GetIconInfo.c
rostests/apitests/user32/resource.h [new file with mode: 0644]
rostests/apitests/user32/test.cur [new file with mode: 0644]
rostests/apitests/user32/test.ico [new file with mode: 0644]
rostests/apitests/user32/user32_apitest.rbuild
rostests/apitests/user32/user32_apitest.rc [new file with mode: 0644]

index 12fb0e4..e11fdf4 100644 (file)
@@ -9,7 +9,8 @@ list(APPEND SOURCE
     GetSystemMetrics.c
     GetIconInfo.c
     GetPeekMessage.c
-    testlist.c)
+    testlist.c
+    user32_apitest.rc)
 
 add_executable(user32_apitest ${SOURCE})
 target_link_libraries(user32_apitest wine)
index deef6a3..eb0568a 100644 (file)
@@ -2,7 +2,7 @@
 #include <stdio.h>
 #include <wine/test.h>
 #include <windows.h>
-
+#include "resource.h"
 
 // FIXME user32
 
@@ -144,12 +144,21 @@ START_TEST(GetIconInfo)
     Test_GetIconInfo(0);
     Test_GetIconInfo(1);
 
-    hcursor = LoadCursor(NULL, IDC_APPSTARTING);
-    ok(hcursor != 0, "should not fail\n");
+    hcursor = LoadCursor(GetModuleHandle(NULL), "TESTCURSOR");
+    ok(hcursor != 0, "should not fail, error %ld\n", GetLastError());
     ok(GetIconInfo(hcursor, &iconinfo2), "\n");
     ok(iconinfo2.fIcon == 0, "\n");
-    ok(iconinfo2.xHotspot == 0, "%ld\n", iconinfo2.xHotspot);
-    ok(iconinfo2.yHotspot == 8, "%ld\n", iconinfo2.yHotspot);
+    ok(iconinfo2.xHotspot == 8, "%ld\n", iconinfo2.xHotspot);
+    ok(iconinfo2.yHotspot == 29, "%ld\n", iconinfo2.yHotspot);
+    ok(iconinfo2.hbmMask != NULL, "\n");
+    ok(iconinfo2.hbmColor != NULL, "\n");
+
+    hcursor = LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_TEST));
+    ok(hcursor != 0, "should not fail\n");
+    ok(GetIconInfo(hcursor, &iconinfo2), "\n");
+    ok(iconinfo2.fIcon == 1, "\n");
+    ok(iconinfo2.xHotspot == 16, "%ld\n", iconinfo2.xHotspot);
+    ok(iconinfo2.yHotspot == 16, "%ld\n", iconinfo2.yHotspot);
     ok(iconinfo2.hbmMask != NULL, "\n");
     ok(iconinfo2.hbmColor != NULL, "\n");
 
diff --git a/rostests/apitests/user32/resource.h b/rostests/apitests/user32/resource.h
new file mode 100644 (file)
index 0000000..1fbdfca
--- /dev/null
@@ -0,0 +1,3 @@
+
+
+#define IDI_TEST 1000
diff --git a/rostests/apitests/user32/test.cur b/rostests/apitests/user32/test.cur
new file mode 100644 (file)
index 0000000..1a70b67
Binary files /dev/null and b/rostests/apitests/user32/test.cur differ
diff --git a/rostests/apitests/user32/test.ico b/rostests/apitests/user32/test.ico
new file mode 100644 (file)
index 0000000..6630ca1
Binary files /dev/null and b/rostests/apitests/user32/test.ico differ
index 251ad03..8aaa1df 100644 (file)
@@ -8,6 +8,7 @@
        <library>user32</library>
        <library>pseh</library>
        <file>testlist.c</file>
+       <file>user32_apitest.rc</file>
 
        <file>InitializeLpkHooks.c</file>
        <file>RealGetWindowClass.c</file>
diff --git a/rostests/apitests/user32/user32_apitest.rc b/rostests/apitests/user32/user32_apitest.rc
new file mode 100644 (file)
index 0000000..8c40b58
--- /dev/null
@@ -0,0 +1,7 @@
+#include <windows.h>
+#include "resource.h"
+
+LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
+
+IDI_TEST ICON "test.ico"
+TESTCURSOR CURSOR "test.cur"