Commit 7f96b7b1 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

browseui/tests: Remove string conversion helper.

parent 6b5a5c64
...@@ -37,14 +37,6 @@ ...@@ -37,14 +37,6 @@
ok(FALSE, #exp " failed: %#lx\n", res); \ ok(FALSE, #exp " failed: %#lx\n", res); \
} }
static LPWSTR strdup_AtoW(LPCSTR str)
{
int size = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
LPWSTR wstr = CoTaskMemAlloc((size + 1)*sizeof(WCHAR));
MultiByteToWideChar(CP_ACP, 0, str, -1, wstr, size+1);
return wstr;
}
typedef struct typedef struct
{ {
IEnumString IEnumString_iface; IEnumString IEnumString_iface;
...@@ -54,7 +46,7 @@ typedef struct ...@@ -54,7 +46,7 @@ typedef struct
INT expcount; INT expcount;
INT pos; INT pos;
INT limit; INT limit;
const char **data; const WCHAR **data;
} TestACL; } TestACL;
extern IEnumStringVtbl TestACLVtbl; extern IEnumStringVtbl TestACLVtbl;
...@@ -70,7 +62,7 @@ static TestACL *impl_from_IACList(IACList *iface) ...@@ -70,7 +62,7 @@ static TestACL *impl_from_IACList(IACList *iface)
return CONTAINING_RECORD(iface, TestACL, IACList_iface); return CONTAINING_RECORD(iface, TestACL, IACList_iface);
} }
static TestACL *TestACL_Constructor(int limit, const char **strings) static TestACL *TestACL_Constructor(int limit, const WCHAR **strings)
{ {
TestACL *This = CoTaskMemAlloc(sizeof(TestACL)); TestACL *This = CoTaskMemAlloc(sizeof(TestACL));
ZeroMemory(This, sizeof(*This)); ZeroMemory(This, sizeof(*This));
...@@ -127,6 +119,7 @@ static HRESULT STDMETHODCALLTYPE TestACL_QueryInterface(IEnumString *iface, REFI ...@@ -127,6 +119,7 @@ static HRESULT STDMETHODCALLTYPE TestACL_QueryInterface(IEnumString *iface, REFI
static HRESULT STDMETHODCALLTYPE TestACL_Next(IEnumString *iface, ULONG celt, LPOLESTR *rgelt, ULONG *pceltFetched) static HRESULT STDMETHODCALLTYPE TestACL_Next(IEnumString *iface, ULONG celt, LPOLESTR *rgelt, ULONG *pceltFetched)
{ {
TestACL *This = impl_from_IEnumString(iface); TestACL *This = impl_from_IEnumString(iface);
int size;
ULONG i; ULONG i;
trace("ACL(%p): read %ld item(s)\n", This, celt); trace("ACL(%p): read %ld item(s)\n", This, celt);
...@@ -134,7 +127,10 @@ static HRESULT STDMETHODCALLTYPE TestACL_Next(IEnumString *iface, ULONG celt, LP ...@@ -134,7 +127,10 @@ static HRESULT STDMETHODCALLTYPE TestACL_Next(IEnumString *iface, ULONG celt, LP
{ {
if (This->pos >= This->limit) if (This->pos >= This->limit)
break; break;
rgelt[i] = strdup_AtoW(This->data[This->pos]);
size = wcslen(This->data[This->pos]);
rgelt[i] = CoTaskMemAlloc((size + 1) * sizeof(WCHAR));
wcscpy(rgelt[i], This->data[This->pos]);
This->pos++; This->pos++;
} }
...@@ -222,8 +218,8 @@ IACListVtbl TestACL_ACListVtbl = ...@@ -222,8 +218,8 @@ IACListVtbl TestACL_ACListVtbl =
static void test_ACLMulti(void) static void test_ACLMulti(void)
{ {
const char *strings1[] = {"a", "c", "e"}; const WCHAR *strings1[] = { L"a", L"c", L"e" };
const char *strings2[] = {"a", "b", "d"}; const WCHAR *strings2[] = { L"a", L"b", L"d" };
const WCHAR exp[] = L"ABC"; const WCHAR exp[] = L"ABC";
IEnumString *obj; IEnumString *obj;
IEnumACString *unk; IEnumACString *unk;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment