[USER32_APITEST]
authorJérôme Gardou <jerome.gardou@reactos.org>
Thu, 23 Oct 2014 11:19:21 +0000 (11:19 +0000)
committerJérôme Gardou <jerome.gardou@reactos.org>
Thu, 23 Oct 2014 11:19:21 +0000 (11:19 +0000)
 - Add a test showing that CopyImage accepts LR_SHARED flag.
CORE-7575

svn path=/trunk/; revision=64916

rostests/apitests/user32/LoadImage.c

index f59f601..39e09bd 100644 (file)
@@ -39,11 +39,27 @@ START_TEST(LoadImage)
         hCopy = CopyImage(arg, IMAGE_CURSOR, 0, 0, 0);
         ok(hCopy != NULL, "\n");
         ok(DestroyIcon(hCopy), "\n");
+        /* Unlike the original, this one is not shared */
+        ok(!DestroyIcon(hCopy), "\n");
         
         hCopy = CopyImage(arg, IMAGE_CURSOR, 0, 0, LR_COPYFROMRESOURCE);
         ok(hCopy != NULL, "\n");
         ok(DestroyIcon(hCopy), "\n");
+        /* Unlike the original, this one is not shared */
+        ok(!DestroyIcon(hCopy), "\n");
+
+        hCopy = CopyImage(arg, IMAGE_CURSOR, 0, 0, LR_COPYFROMRESOURCE | LR_SHARED);
+        ok(hCopy != NULL, "\n");
+        ok(DestroyIcon(hCopy), "\n");
+        /* This one is shared */
+        ok(DestroyIcon(hCopy), "\n");
         
+        hCopy = CopyImage(arg, IMAGE_CURSOR, 0, 0, LR_SHARED);
+        ok(hCopy != NULL, "\n");
+        ok(DestroyIcon(hCopy), "\n");
+        /* This one is shared */
+        ok(DestroyIcon(hCopy), "\n");
+
         /* Try various usual functions */
         hdcScreen = CreateDCW(L"DISPLAY", NULL, NULL, NULL);
         ok(hdcScreen != NULL, "\n");