[PATCH 2/3] propsys/tests: Fix the PropVariantToBuffer tests.
Sven Baars
sven.wine at gmail.com
Thu May 30 04:39:34 CDT 2019
Signed-off-by: Sven Baars <sven.wine at gmail.com>
---
dlls/propsys/tests/propsys.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/dlls/propsys/tests/propsys.c b/dlls/propsys/tests/propsys.c
index 1be88172bd..22117b5805 100644
--- a/dlls/propsys/tests/propsys.c
+++ b/dlls/propsys/tests/propsys.c
@@ -1525,13 +1525,14 @@ static void test_PropVariantToBuffer(void)
hr = SafeArrayAccessData(sa, &pdata);
ok(hr == S_OK, "SafeArrayAccessData failed: 0x%08x.\n", hr);
memcpy(pdata, data, sizeof(data));
+ hr = SafeArrayUnaccessData(sa);
+ ok(hr == S_OK, "SafeArrayUnaccessData failed: 0x%08x.\n", hr);
U(propvar).parray = sa;
buffer[0] = 99;
hr = PropVariantToBuffer(&propvar, buffer, 11);
todo_wine ok(hr == E_FAIL, "PropVariantToBuffer returned: 0x%08x.\n", hr);
ok(buffer[0] == 99, "got wrong buffer.\n");
memset(buffer, 0, sizeof(buffer));
- SafeArrayDestroy(sa);
PropVariantClear(&propvar);
PropVariantInit(&propvar);
@@ -1544,12 +1545,13 @@ static void test_PropVariantToBuffer(void)
hr = SafeArrayAccessData(sa, &pdata);
ok(hr == S_OK, "SafeArrayAccessData failed: 0x%08x.\n", hr);
memcpy(pdata, data, sizeof(data));
+ hr = SafeArrayUnaccessData(sa);
+ ok(hr == S_OK, "SafeArrayUnaccessData failed: 0x%08x.\n", hr);
U(propvar).parray = sa;
hr = PropVariantToBuffer(&propvar, buffer, sizeof(data));
todo_wine ok(hr == S_OK, "PropVariantToBuffer failed: 0x%08x.\n", hr);
todo_wine ok(!memcmp(buffer, data, 10) && !buffer[10], "got wrong buffer.\n");
memset(buffer, 0, sizeof(buffer));
- SafeArrayDestroy(sa);
PropVariantClear(&propvar);
PropVariantInit(&propvar);
@@ -1571,10 +1573,11 @@ static void test_PropVariantToBuffer(void)
hr = SafeArrayAccessData(sa, &pdata);
ok(hr == S_OK, "SafeArrayAccessData failed: 0x%08x.\n", hr);
memcpy(pdata, data_int8, sizeof(data_int8));
+ hr = SafeArrayUnaccessData(sa);
+ ok(hr == S_OK, "SafeArrayUnaccessData failed: 0x%08x.\n", hr);
U(propvar).parray = sa;
hr = PropVariantToBuffer(&propvar, buffer, sizeof(data_int8));
ok(hr == E_INVALIDARG, "PropVariantToBuffer failed: 0x%08x.\n", hr);
- SafeArrayDestroy(sa);
PropVariantClear(&propvar);
}
--
2.17.1
More information about the wine-devel
mailing list