Module: wine Branch: master Commit: b69045bfc71f083b9ea0dd6c5161e986aa760c28 URL: http://source.winehq.org/git/wine.git/?a=commit;h=b69045bfc71f083b9ea0dd6c51...
Author: Andrew Nguyen arethusa26@gmail.com Date: Mon Jan 18 07:00:01 2010 -0600
mapi32/tests: Fix the PropCopyMore tests and add an additional test.
The PropCopyMore test function was incorrectly allocating memory and testing property types without initializing the correct property union member, causing a crash with the native Outlook extended MAPI provider.
---
dlls/mapi32/tests/prop.c | 13 +++++++------ 1 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/dlls/mapi32/tests/prop.c b/dlls/mapi32/tests/prop.c index bf6c275..ce6fbd5 100644 --- a/dlls/mapi32/tests/prop.c +++ b/dlls/mapi32/tests/prop.c @@ -69,10 +69,10 @@ static BOOL InitFuncPtrs(void) return FALSE; }
+/* FIXME: Test PT_I2, PT_I4, PT_R4, PT_R8, PT_CURRENCY, PT_APPTIME, PT_SYSTIME, + * PT_ERROR, PT_BOOLEAN, PT_I8, and PT_CLSID. */ static ULONG ptTypes[] = { - PT_I2, PT_I4, PT_R4, PT_R8, PT_CURRENCY, PT_APPTIME, PT_SYSTIME, - PT_ERROR, PT_BOOLEAN, PT_I8, PT_CLSID, PT_STRING8, PT_BINARY, - PT_UNICODE + PT_STRING8, PT_BINARY, PT_UNICODE };
static inline int strcmpW(const WCHAR *str1, const WCHAR *str2) @@ -97,7 +97,7 @@ static void test_PropCopyMore(void) return; }
- scode = pMAPIAllocateBuffer(sizeof(LPSPropValue), lpDest); + scode = pMAPIAllocateBuffer(sizeof(SPropValue), &lpDest); ok(scode == S_OK, "Expected MAPIAllocateBuffer to return S_OK, got 0x%x\n", scode); if (FAILED(scode)) { @@ -105,7 +105,7 @@ static void test_PropCopyMore(void) return; }
- scode = pMAPIAllocateMore(sizeof(LPSPropValue), lpDest, lpSrc); + scode = pMAPIAllocateMore(sizeof(SPropValue), lpDest, &lpSrc); ok(scode == S_OK, "Expected MAPIAllocateMore to return S_OK, got 0x%x\n", scode); if (FAILED(scode)) { @@ -159,7 +159,8 @@ static void test_PropCopyMore(void) }
/* Since all allocations are linked, freeing lpDest frees everything */ - pMAPIFreeBuffer(lpDest); + scode = pMAPIFreeBuffer(lpDest); + ok(scode == S_OK, "Expected MAPIFreeBuffer to return S_OK, got 0x%x\n", scode); }
static void test_UlPropSize(void)