#include <stdarg.h>
#include <initguid.h>
#include <windows.h>
#include <shlobj.h>
#include <shldisp.h>
#include <shlwapi.h>
#include <shlguid.h>
#include "wine/test.h"
Go to the source code of this file.
|
static LPWSTR | strdup_AtoW (LPCSTR str) |
|
static TestACL * | impl_from_IEnumString (IEnumString *iface) |
|
static TestACL * | impl_from_IACList (IACList *iface) |
|
static TestACL * | TestACL_Constructor (int limit, const char **strings) |
|
static ULONG STDMETHODCALLTYPE | TestACL_AddRef (IEnumString *iface) |
|
static ULONG STDMETHODCALLTYPE | TestACL_Release (IEnumString *iface) |
|
static HRESULT STDMETHODCALLTYPE | TestACL_QueryInterface (IEnumString *iface, REFIID iid, LPVOID *ppvOut) |
|
static HRESULT STDMETHODCALLTYPE | TestACL_Next (IEnumString *iface, ULONG celt, LPOLESTR *rgelt, ULONG *pceltFetched) |
|
static HRESULT STDMETHODCALLTYPE | TestACL_Skip (IEnumString *iface, ULONG celt) |
|
static HRESULT STDMETHODCALLTYPE | TestACL_Clone (IEnumString *iface, IEnumString **out) |
|
static HRESULT STDMETHODCALLTYPE | TestACL_Reset (IEnumString *iface) |
|
static HRESULT STDMETHODCALLTYPE | TestACL_Expand (IACList *iface, LPCOLESTR str) |
|
static ULONG STDMETHODCALLTYPE | TestACL_ACList_AddRef (IACList *iface) |
|
static ULONG STDMETHODCALLTYPE | TestACL_ACList_Release (IACList *iface) |
|
static HRESULT STDMETHODCALLTYPE | TestACL_ACList_QueryInterface (IACList *iface, REFIID iid, LPVOID *ppvout) |
|
static void | test_ACLMulti (void) |
|
static void | test_ACListISF (void) |
|
| START_TEST (autocomplete) |
|
◆ COBJMACROS
◆ expect_end
◆ expect_str
Value:{ \
ole_ok(IEnumString_Next(
obj, 1, &wstr, &
i)); \
ok(
i == 1,
"Expected i == 1, got %d\n",
i); \
ok(
str[0] == wstr[0],
"String mismatch\n"); \
CoTaskMemFree(wstr); \
}
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition at line 215 of file autocomplete.c.
◆ ole_ok
◆ impl_from_IACList()
static TestACL * impl_from_IACList |
( |
IACList * |
iface | ) |
|
|
static |
◆ impl_from_IEnumString()
Definition at line 63 of file autocomplete.c.
Referenced by string_enumerator_AddRef(), string_enumerator_Next(), string_enumerator_QueryInterface(), string_enumerator_Release(), string_enumerator_Reset(), string_enumerator_Skip(), TestACL_AddRef(), TestACL_Next(), TestACL_QueryInterface(), TestACL_Release(), and TestACL_Reset().
◆ START_TEST()
START_TEST |
( |
autocomplete |
| ) |
|
Definition at line 388 of file autocomplete.c.
389{
391
394
396}
static void test_ACLMulti(void)
static void test_ACListISF(void)
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
◆ strdup_AtoW()
Definition at line 40 of file autocomplete.c.
41{
45 return wstr;
46}
#define MultiByteToWideChar
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Referenced by TestACL_Next().
◆ test_ACListISF()
Definition at line 367 of file autocomplete.c.
368{
370 IACList *
list, *list2;
372
374 ok(
hr ==
S_OK,
"failed to create ACListISF instance, 0x%08x\n",
hr);
375
378
379 hr = IEnumString_QueryInterface(enumstring, &IID_IACList, (
void**)&list2);
381 ok(
list == list2,
"got %p, %p\n",
list, list2);
383
384 IEnumString_Release(enumstring);
386}
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
const GUID IID_IEnumString
#define IACList_Release(p)
#define IACList_QueryInterface(p, a, b)
Referenced by START_TEST().
◆ test_ACLMulti()
Definition at line 226 of file autocomplete.c.
227{
228 const char *strings1[] = {"a", "c", "e"};
229 const char *strings2[] = {"a", "b", "d"};
235 IACList *acl;
236 IObjMgr *mgr;
242
244 ok(
hr ==
S_OK,
"failed to create ACLMulti instance, 0x%08x\n",
hr);
246
247 hr = IEnumString_QueryInterface(
obj, &IID_IACList, (
void**)&acl);
249 hr = IEnumString_QueryInterface(
obj, &IID_IACList2, &tmp);
251 hr = IEnumString_QueryInterface(
obj, &IID_IObjMgr, (
void**)&mgr);
253
254 hr = IEnumString_QueryInterface(
obj, &IID_IEnumACString, (
LPVOID*)&unk);
257 else
258 {
259 ok(
hr ==
S_OK,
"QueryInterface(IID_IEnumACString) failed: %x\n",
hr);
261 IEnumACString_Release(unk);
262 }
263
267 ok(
i == 0,
"Unexpected fetched value %d\n",
i);
270 hr = IEnumString_Skip(
obj, 1);
276
292
293 hr = IEnumString_Reset(
obj);
295 ok(acl1->
pos == 0,
"acl1 not reset\n");
296 ok(acl2->
pos == 0,
"acl2 not reset\n");
297
302 "expcount - expected 0 or 1, got %d\n", acl2->
expcount);
303
304 hr = IEnumString_Next(
obj, 15, wstrtab, &
i);
306 ok(
i == 1,
"Expected i == 1, got %d\n",
i);
308
309 hr = IEnumString_Next(
obj, 15, wstrtab, &
i);
312
313 hr = IEnumString_Next(
obj, 15, wstrtab, &
i);
316
317 hr = IEnumString_Next(
obj, 15, wstrtab, &
i);
320
325 "expcount - expected 0 or 2, got %d\n", acl2->
expcount);
331 "expcount - expected 0 or 3, got %d\n", acl2->
expcount);
337 "expcount - expected 0 or 4, got %d\n", acl2->
expcount);
344
347
348 ok(acl1->
ref == 1,
"acl1 not released\n");
350 IEnumString_Reset(
obj);
355
356 IEnumString_Release(
obj);
359 ok(
ref == 0,
"Unexpected references\n");
360 ok(acl1->
ref == 1,
"acl1 not released\n");
361 ok(acl2->
ref == 1,
"acl2 not released\n");
362
365}
#define expect_str(obj, str)
static TestACL * TestACL_Constructor(int limit, const char **strings)
VOID WINAPI CoTaskMemFree(LPVOID ptr)
#define IObjMgr_Append(p, a)
#define IObjMgr_Remove(p, a)
#define IACList_Expand(p, a)
#define IObjMgr_Release(p)
Referenced by START_TEST().
◆ TestACL_ACList_AddRef()
Definition at line 188 of file autocomplete.c.
189{
192}
static TestACL * impl_from_IACList(IACList *iface)
static ULONG STDMETHODCALLTYPE TestACL_AddRef(IEnumString *iface)
◆ TestACL_ACList_QueryInterface()
Definition at line 200 of file autocomplete.c.
201{
204}
static HRESULT STDMETHODCALLTYPE TestACL_QueryInterface(IEnumString *iface, REFIID iid, LPVOID *ppvOut)
◆ TestACL_ACList_Release()
Definition at line 194 of file autocomplete.c.
195{
198}
static ULONG STDMETHODCALLTYPE TestACL_Release(IEnumString *iface)
◆ TestACL_AddRef()
◆ TestACL_Clone()
◆ TestACL_Constructor()
Definition at line 73 of file autocomplete.c.
74{
84}
IEnumStringVtbl TestACLVtbl
IACListVtbl TestACL_ACListVtbl
GLsizei const GLchar *const * strings
Referenced by test_ACLMulti().
◆ TestACL_Expand()
◆ TestACL_Next()
Definition at line 127 of file autocomplete.c.
128{
131
132 trace(
"ACL(%p): read %d item(s)\n",
This, celt);
133 for (
i = 0;
i < celt;
i++)
134 {
136 break;
139 }
140
141 if (pceltFetched)
146}
static LPWSTR strdup_AtoW(LPCSTR str)
◆ TestACL_QueryInterface()
Definition at line 103 of file autocomplete.c.
104{
108 {
109 *ppvOut = iface;
110 }
112 {
113 *ppvOut = &
This->IACList_iface;
114 }
115
116 if (*ppvOut)
117 {
118 IEnumString_AddRef(iface);
120 }
121
123 trace(
"unknown interface queried\n");
125}
#define IsEqualGUID(rguid1, rguid2)
Referenced by TestACL_ACList_QueryInterface().
◆ TestACL_Release()
◆ TestACL_Reset()
◆ TestACL_Skip()
◆ TestACL_ACListVtbl
IACListVtbl TestACL_ACListVtbl |
Initial value:=
{
}
static HRESULT STDMETHODCALLTYPE TestACL_ACList_QueryInterface(IACList *iface, REFIID iid, LPVOID *ppvout)
static ULONG STDMETHODCALLTYPE TestACL_ACList_Release(IACList *iface)
static ULONG STDMETHODCALLTYPE TestACL_ACList_AddRef(IACList *iface)
static HRESULT STDMETHODCALLTYPE TestACL_Expand(IACList *iface, LPCOLESTR str)
Definition at line 206 of file autocomplete.c.
Referenced by TestACL_Constructor().
◆ TestACLVtbl
IEnumStringVtbl TestACLVtbl |
Initial value:=
{
}
static HRESULT STDMETHODCALLTYPE TestACL_Clone(IEnumString *iface, IEnumString **out)
static HRESULT STDMETHODCALLTYPE TestACL_Skip(IEnumString *iface, ULONG celt)
static HRESULT STDMETHODCALLTYPE TestACL_Reset(IEnumString *iface)
static HRESULT STDMETHODCALLTYPE TestACL_Next(IEnumString *iface, ULONG celt, LPOLESTR *rgelt, ULONG *pceltFetched)
Definition at line 176 of file autocomplete.c.
Referenced by TestACL_Constructor().