From ea5d55bf4c7718a6645dcd6aa2ed5a067f227025 Mon Sep 17 00:00:00 2001
From: Michael Kaufmann <hallo@michael-kaufmann.ch>
Date: Wed, 7 Jun 2006 14:03:22 +0200
Subject: [PATCH] user/tests: Update LoadImage test.

Include a bitmap in the resources and don't depend on Windows'
OBM_CHECK bitmap anymore.
---
 dlls/user/tests/.gitignore  |  1 +
 dlls/user/tests/Makefile.in |  4 ++++
 dlls/user/tests/resource.c  | 21 +++++++++++++--------
 dlls/user/tests/resource.rc | 10 ++++++++++
 4 files changed, 28 insertions(+), 8 deletions(-)

diff --git a/dlls/user/tests/.gitignore b/dlls/user/tests/.gitignore
index 33984ecc223..ca09a9db717 100644
--- a/dlls/user/tests/.gitignore
+++ b/dlls/user/tests/.gitignore
@@ -14,6 +14,7 @@ msg.ok
 resource.ok
 resource.res
 sysparams.ok
+test_mono.bmp
 testlist.c
 text.ok
 win.ok
diff --git a/dlls/user/tests/Makefile.in b/dlls/user/tests/Makefile.in
index 75e4d0f17eb..02313e02eba 100644
--- a/dlls/user/tests/Makefile.in
+++ b/dlls/user/tests/Makefile.in
@@ -27,6 +27,10 @@ CTESTS = \
 
 RC_SRCS = resource.rc
 
+RC_BINSRC = resource.rc
+RC_BINARIES = \
+	test_mono.bmp
+
 @MAKE_TEST_RULES@
 
 ### Dependencies:
diff --git a/dlls/user/tests/resource.c b/dlls/user/tests/resource.c
index d46d6e6f317..dc879315467 100644
--- a/dlls/user/tests/resource.c
+++ b/dlls/user/tests/resource.c
@@ -283,17 +283,22 @@ static void test_PrivateExtractIcons(void) {
     ok(cIcons == 4, "Three icons requested, four expected, got cIcons=%d\n", cIcons);
 }
 
-static void test_LoadImage(void) {
+static void test_LoadImage(void)
+{
     HBITMAP bmp;
-    
-    bmp = LoadBitmapA(NULL, MAKEINTRESOURCE(OBM_CHECK));
-    ok(bmp != NULL, "Could not load the OBM_CHECK bitmap\n");
+    HRSRC hres;
+
+    bmp = LoadBitmapA(GetModuleHandle(NULL), MAKEINTRESOURCE(100));
+    ok(bmp != NULL, "Could not load a bitmap resource\n");
     if (bmp) DeleteObject(bmp);
-    
-    bmp = LoadBitmapA(NULL, "#32760"); /* Value of OBM_CHECK */
-    ok(bmp != NULL, "Could not load the OBM_CHECK bitmap\n");
+
+    hres = FindResource(GetModuleHandle(NULL), "#100", RT_BITMAP);
+    ok(hres != NULL, "Could not find a bitmap resource with a numeric string\n");
+
+    bmp = LoadBitmapA(GetModuleHandle(NULL), "#100");
+    ok(bmp != NULL, "Could not load a bitmap resource with a numeric string\n");
     if (bmp) DeleteObject(bmp);
-}    
+}
 
 START_TEST(resource)
 {
diff --git a/dlls/user/tests/resource.rc b/dlls/user/tests/resource.rc
index 435f9372bb0..305b06a5e9a 100644
--- a/dlls/user/tests/resource.rc
+++ b/dlls/user/tests/resource.rc
@@ -77,3 +77,13 @@ FONT 8, "MS Shell Dlg"
 {
   EDITTEXT                200,4,4,50,14
 }
+
+/* BINRES test_mono.bmp */
+100 BITMAP test_mono.bmp
+/* {
+ '42 4D 42 00 00 00 00 00 00 00 3E 00 00 00 28 00'
+ '00 00 02 00 00 00 01 00 00 00 01 00 01 00 00 00'
+ '00 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00'
+ '00 00 00 00 00 00 00 00 00 00 FF FF FF 00 40 00'
+ '00 00'
+} */