From 7de7fc653b1eb44d9937f31d037451c8d1048f2c Mon Sep 17 00:00:00 2001 From: Dmitry Timoshkov Date: Wed, 16 Apr 2014 17:09:42 +0900 Subject: [PATCH] ole32/tests: Add more tests for PropVariantClear. --- dlls/ole32/tests/propvariant.c | 47 ++++++++++++++++++++++++++++++++-- 1 file changed, 45 insertions(+), 2 deletions(-) diff --git a/dlls/ole32/tests/propvariant.c b/dlls/ole32/tests/propvariant.c index 9e0f66b5e28..7477b6ab7e6 100644 --- a/dlls/ole32/tests/propvariant.c +++ b/dlls/ole32/tests/propvariant.c @@ -184,28 +184,71 @@ static void test_validtypes(void) HRESULT hr; unsigned int i; - memset(&propvar, 0, sizeof(propvar)); + memset(&propvar, 0x55, sizeof(propvar)); + hr = PropVariantClear(&propvar); + ok(hr == STG_E_INVALIDPARAMETER, "expected STG_E_INVALIDPARAMETER, got %08x\n", hr); +todo_wine + ok(propvar.vt == 0, "expected 0, got %d\n", propvar.vt); +todo_wine + ok(U(propvar).uhVal.QuadPart == 0, "expected 0, got %#x/%#x\n", + U(propvar).uhVal.u.LowPart, U(propvar).uhVal.u.HighPart); for (i = 0; i < sizeof(valid_types)/sizeof(valid_types[0]); i++) { VARTYPE vt; + memset(&propvar, 0x55, sizeof(propvar)); + U(propvar).pszVal = NULL; vt = propvar.vt = i; hr = PropVariantClear(&propvar); expect(hr, vt); + if (hr == S_OK) /* FIXME: Remove once Wine is fixed */ + ok(U(propvar).uhVal.QuadPart == 0, "%u: expected 0, got %#x/%#x\n", + i, U(propvar).uhVal.u.LowPart, U(propvar).uhVal.u.HighPart); + else +todo_wine + ok(U(propvar).uhVal.QuadPart == 0, "%u: expected 0, got %#x/%#x\n", + i, U(propvar).uhVal.u.LowPart, U(propvar).uhVal.u.HighPart); + + memset(&propvar, 0x55, sizeof(propvar)); + U(propvar).pszVal = NULL; vt = propvar.vt = i | VT_ARRAY; hr = PropVariantClear(&propvar); expect(hr, vt); + if (hr == S_OK) /* FIXME: Remove once Wine is fixed */ + ok(U(propvar).uhVal.QuadPart == 0, "%u: expected 0, got %#x/%#x\n", + i, U(propvar).uhVal.u.LowPart, U(propvar).uhVal.u.HighPart); + else +todo_wine + ok(U(propvar).uhVal.QuadPart == 0, "%u: expected 0, got %#x/%#x\n", + i, U(propvar).uhVal.u.LowPart, U(propvar).uhVal.u.HighPart); + memset(&propvar, 0x55, sizeof(propvar)); + U(propvar).pszVal = NULL; vt = propvar.vt = i | VT_VECTOR; hr = PropVariantClear(&propvar); expect(hr, vt); + if (hr == S_OK) /* FIXME: Remove once Wine is fixed */ + ok(U(propvar).uhVal.QuadPart == 0, "%u: expected 0, got %#x/%#x\n", + i, U(propvar).uhVal.u.LowPart, U(propvar).uhVal.u.HighPart); + else +todo_wine + ok(U(propvar).uhVal.QuadPart == 0, "%u: expected 0, got %#x/%#x\n", + i, U(propvar).uhVal.u.LowPart, U(propvar).uhVal.u.HighPart); + memset(&propvar, 0x55, sizeof(propvar)); + U(propvar).pszVal = NULL; vt = propvar.vt = i | VT_BYREF; hr = PropVariantClear(&propvar); expect(hr, vt); - + if (hr == S_OK) /* FIXME: Remove once Wine is fixed */ + ok(U(propvar).uhVal.QuadPart == 0, "%u: expected 0, got %#x/%#x\n", + i, U(propvar).uhVal.u.LowPart, U(propvar).uhVal.u.HighPart); + else +todo_wine + ok(U(propvar).uhVal.QuadPart == 0, "%u: expected 0, got %#x/%#x\n", + i, U(propvar).uhVal.u.LowPart, U(propvar).uhVal.u.HighPart); } }