ReactOS  0.4.13-dev-657-g10798fa
SHAreIconsEqual.c File Reference
#include <apitest.h>
#include <shlwapi.h>
#include "resource.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 38 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 24 of file SHAreIconsEqual.c.

25 {
28 
29  BOOL result = pSHAreIconsEqual(icon1, icon2);
30 
31  winetest_ok(icon1 != icon2, "Expected two different handles for %s==%s\n", names[id1-1], names[id2-1]);
32  winetest_ok(result == expected, "Expected %d, got %d for %s==%s\n", expected, result, names[id1-1], names[id2-1]);
33 
34  DestroyIcon(icon1);
35  DestroyIcon(icon2);
36 }
static HICON
Definition: imagelist.c:84
#define IMAGE_ICON
Definition: winuser.h:212
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2022
#define MAKEINTRESOURCEA(i)
Definition: winuser.h:581
GLuint GLuint * names
Definition: glext.h:11545
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
void __winetest_cdecl winetest_ok(int condition, const char *msg,...)
HANDLE WINAPI LoadImageA(_In_opt_ HINSTANCE, _In_ LPCSTR, _In_ UINT, _In_ int, _In_ int, _In_ UINT)
Definition: cursoricon.c:2147
#define GetModuleHandle
Definition: winbase.h:3641
GLuint64EXT * result
Definition: glext.h:11304
BOOL expected
Definition: store.c:2063

◆ START_TEST()

START_TEST ( SHAreIconsEqual  )

Definition at line 42 of file SHAreIconsEqual.c.

43 {
44  HMODULE module = LoadLibraryA("shlwapi.dll");
46  pSHAreIconsEqual = (void*)GetProcAddress(module, MAKEINTRESOURCEA(548));
47  if (!pSHAreIconsEqual)
48  {
49  skip("SHAreIconsEqual not exported\n");
50  return;
51  }
52 
53  _SEH2_TRY
54  {
55  pSHAreIconsEqual((HICON)IDC_APPSTARTING, (HICON)IDC_APPSTARTING);
56  Continue = TRUE;
57  }
59  {
60  Continue = FALSE;
61  trace("SHAreIconsEqual not implemented?\n");
62  }
63  _SEH2_END;
64 
65  if (!Continue)
66  {
67  return;
68  }
69 
70  ok(pSHAreIconsEqual((HICON)NULL, (HICON)NULL) == FALSE, "NULL\n");
71  ok(pSHAreIconsEqual((HICON)IDC_APPSTARTING, (HICON)IDC_APPSTARTING) == FALSE, "IDC_APPSTARTING\n");
72  ok(pSHAreIconsEqual((HICON)IDC_ARROW, (HICON)IDC_ARROW) == FALSE, "IDC_ARROW\n");
73  ok(pSHAreIconsEqual((HICON)IDC_SIZENESW, (HICON)IDC_SIZENESW) == FALSE, "IDC_SIZENESW\n");
74 
81 }
#define ICON_16_8_BLACK
Definition: resource.h:2
#define trace(...)
Definition: kmt_test.h:217
static HICON
Definition: imagelist.c:84
#define TRUE
Definition: types.h:120
#define MAKEINTRESOURCEA(i)
Definition: winuser.h:581
#define IDC_SIZENESW
Definition: winuser.h:688
_SEH2_TRY
Definition: create.c:4250
unsigned int BOOL
Definition: ntddk_ex.h:94
#define ICON_32_32
Definition: resource.h:7
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
Definition: loader.c:111
#define ok(value,...)
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
#define IDC_APPSTARTING
Definition: winuser.h:694
#define ICON_16_8_RED
Definition: resource.h:3
#define ICON_16_32_BLACK
Definition: resource.h:4
volatile int Continue
Definition: gdblib.c:102
#define compare_icons
_SEH2_END
Definition: create.c:4424
#define ICON_16_32_RED
Definition: resource.h:5
#define skip(...)
#define IDC_ARROW
Definition: winuser.h:682
#define GetProcAddress(x, y)
Definition: compat.h:410
#define ICON_32_8
Definition: resource.h:6
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6

Variable Documentation

◆ hIcon2

HICON hIcon2

Definition at line 12 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 14 of file SHAreIconsEqual.c.