oleaut32/tests: Use the correct allocator in the ClearCustData test.

This commit is contained in:
Alexandre Julliard 2009-05-08 14:12:40 +02:00
parent 18419dab31
commit 4d30e7af47

View file

@ -5788,21 +5788,13 @@ static void test_UintChangeTypeEx(void)
static void test_ClearCustData(void)
{
WCHAR buff[sizeof(CUSTDATAITEM) * NUM_CUST_ITEMS / sizeof(WCHAR)];
CUSTDATA ci;
unsigned i;
CHECKPTR(ClearCustData);
memset(buff, 0, sizeof(buff));
ci.cCustData = NUM_CUST_ITEMS;
/* This is a bit tricky. We use SysAllocStringByteLen to allocate the
* array, since native uses an internal IMalloc interface for allocating
* its memory, while Wine uses HeapAlloc(). Doing this ensures we allocate
* using the correct function whether with native or builtin.
*/
ci.prgCustData = (LPCUSTDATAITEM)Get(SysAllocStringByteLen((LPCSTR)buff, sizeof(buff)));
ci.prgCustData = CoTaskMemAlloc( sizeof(CUSTDATAITEM) * NUM_CUST_ITEMS );
for (i = 0; i < NUM_CUST_ITEMS; i++)
VariantInit(&ci.prgCustData[i].varValue);
pClearCustData(&ci);