ole32/tests: Add a few CoGetMalloc tests.

Paul Vriens paul.vriens.wine at gmail.com
Tue Mar 3 07:14:48 CST 2009


Rob Shearman wrote:
> 2009/3/3 Huw Davies <huw at codeweavers.com>:
>> diff --git a/dlls/ole32/tests/compobj.c b/dlls/ole32/tests/compobj.c
>> index a332d27..9720e52 100644
>> --- a/dlls/ole32/tests/compobj.c
>> +++ b/dlls/ole32/tests/compobj.c
>> @@ -1162,6 +1162,28 @@ static void test_CoInitializeEx(void)
>>      OleUninitialize();
>>  }
>>
>> +static void test_CoGetMalloc(void)
>> +{
>> +    IMalloc *malloc;
>> +    HRESULT hr;
>> +    void *ptr;
>> +    DWORD i, size;
>> +
>> +    OleInitialize(NULL);
>> +    hr = CoGetMalloc(1, &malloc);
>> +    ok(hr == S_OK, "got %x\n", hr);
>> +    for(i = 0; i < 10; i++)
>> +    {
>> +        ptr = IMalloc_Alloc(malloc, i);
>> +        ok(ptr != NULL, "got NULL for size %d\n", i);
>> +        size = IMalloc_GetSize(malloc, ptr);
>> +        ok(size == i, "got %d expected %d\n", size, i);
> 
> Has this been tested on Win9x? Since HeapSize on those versions of
> Windows doesn't return the same size as allocated, IMalloc_GetSize
> might not either.
> 
>> +        IMalloc_Free(malloc, ptr);
>> +    }
>> +    IMalloc_Release(malloc);
>> +    OleUninitialize();
>> +}
> 
> 
Hi,

Tested it on my Win95 and Win98 box and all new tests (on both boxes) show:

compobj.c:1180: Test failed: got 12 expected *

-- 
Cheers,

Paul.



More information about the wine-devel mailing list