ReactOS 0.4.16-dev-91-g764881a
SHAreIconsEqual.c File Reference
#include <apitest.h>
#include <shlwapi.h>
#include "resource.h"
#include <pseh/pseh2.h>
Include dependency graph for SHAreIconsEqual.c:

Go to the source code of this file.

Macros

#define compare_icons   (winetest_set_location(__FILE__, __LINE__), 0) ? (void)0 : compare_icons_imp
 

Functions

static BOOL (WINAPI *pSHAreIconsEqual)(HICON hIcon1
 
void compare_icons_imp (int id1, int id2, BOOL expected)
 
 START_TEST (SHAreIconsEqual)
 

Variables

static HICON hIcon2
 
static const charnames []
 

Macro Definition Documentation

◆ compare_icons

#define compare_icons   (winetest_set_location(__FILE__, __LINE__), 0) ? (void)0 : compare_icons_imp

Definition at line 40 of file SHAreIconsEqual.c.

Function Documentation

◆ BOOL()

static BOOL ( WINAPI pSHAreIconsEqual)
static

◆ compare_icons_imp()

void compare_icons_imp ( int  id1,
int  id2,
BOOL  expected 
)

Definition at line 26 of file SHAreIconsEqual.c.

27{
30
31 BOOL result = pSHAreIconsEqual(icon1, icon2);
32
33 winetest_ok(icon1 != icon2, "Expected two different handles for %s==%s\n", names[id1-1], names[id2-1]);
34 winetest_ok(result == expected, "Expected %d, got %d for %s==%s\n", expected, result, names[id1-1], names[id2-1]);
35
36 DestroyIcon(icon1);
37 DestroyIcon(icon2);
38}
#define NULL
Definition: types.h:112
unsigned int BOOL
Definition: ntddk_ex.h:94
GLuint GLuint * names
Definition: glext.h:11545
GLuint64EXT * result
Definition: glext.h:11304
static HICON
Definition: imagelist.c:80
BOOL expected
Definition: store.c:2063
void __winetest_cdecl winetest_ok(int condition, const char *msg,...)
#define GetModuleHandle
Definition: winbase.h:3827
#define IMAGE_ICON
Definition: winuser.h:212
#define MAKEINTRESOURCEA(i)
Definition: winuser.h:581
HANDLE WINAPI LoadImageA(_In_opt_ HINSTANCE hInst, _In_ LPCSTR name, _In_ UINT type, _In_ int cx, _In_ int cy, _In_ UINT fuLoad)
Definition: cursoricon.c:2222
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2097

◆ START_TEST()

START_TEST ( SHAreIconsEqual  )

Definition at line 44 of file SHAreIconsEqual.c.

45{
46 HMODULE module = LoadLibraryA("shlwapi.dll");
47 BOOL Continue = FALSE;
48 pSHAreIconsEqual = (void*)GetProcAddress(module, MAKEINTRESOURCEA(548));
49 if (!pSHAreIconsEqual)
50 {
51 skip("SHAreIconsEqual not exported\n");
52 return;
53 }
54
56 {
57 pSHAreIconsEqual((HICON)IDC_APPSTARTING, (HICON)IDC_APPSTARTING);
58 Continue = TRUE;
59 }
61 {
62 Continue = FALSE;
63 trace("SHAreIconsEqual not implemented?\n");
64 }
66
67 if (!Continue)
68 {
69 return;
70 }
71
72 ok(pSHAreIconsEqual((HICON)NULL, (HICON)NULL) == FALSE, "NULL\n");
73 ok(pSHAreIconsEqual((HICON)IDC_APPSTARTING, (HICON)IDC_APPSTARTING) == FALSE, "IDC_APPSTARTING\n");
74 ok(pSHAreIconsEqual((HICON)IDC_ARROW, (HICON)IDC_ARROW) == FALSE, "IDC_ARROW\n");
75 ok(pSHAreIconsEqual((HICON)IDC_SIZENESW, (HICON)IDC_SIZENESW) == FALSE, "IDC_SIZENESW\n");
76
83}
#define compare_icons
#define trace
Definition: atltest.h:70
#define ok(value,...)
Definition: atltest.h:57
#define skip(...)
Definition: atltest.h:64
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define GetProcAddress(x, y)
Definition: compat.h:753
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
Definition: loader.c:111
#define _SEH2_END
Definition: filesup.c:22
#define _SEH2_TRY
Definition: filesup.c:19
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define ICON_16_32_BLACK
Definition: resource.h:4
#define ICON_32_8
Definition: resource.h:6
#define ICON_16_8_RED
Definition: resource.h:3
#define ICON_16_8_BLACK
Definition: resource.h:2
#define ICON_16_32_RED
Definition: resource.h:5
#define ICON_32_32
Definition: resource.h:7
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:66
#define IDC_SIZENESW
Definition: winuser.h:693
#define IDC_ARROW
Definition: winuser.h:687
#define IDC_APPSTARTING
Definition: winuser.h:699

Variable Documentation

◆ hIcon2

HICON hIcon2

Definition at line 14 of file SHAreIconsEqual.c.

Referenced by SHAreIconsEqual(), START_TEST(), and test_marshal_HICON().

◆ names

const char* names[]
static
Initial value:
=
{
"16_8_black",
"16_8_red",
"16_32_black",
"16_32_red",
"32_8",
"32_32",
}

Definition at line 16 of file SHAreIconsEqual.c.