Sven Baars : propsys/tests: Fix the PropVariantToBuffer tests.
Alexandre Julliard
julliard at winehq.org
Fri May 31 15:53:32 CDT 2019
Module: wine
Branch: master
Commit: 818838b70786b2e81eaddc451873c5837b5ceeb1
URL: https://source.winehq.org/git/wine.git/?a=commit;h=818838b70786b2e81eaddc451873c5837b5ceeb1
Author: Sven Baars <sven.wine at gmail.com>
Date: Thu May 30 11:39:34 2019 +0200
propsys/tests: Fix the PropVariantToBuffer tests.
Signed-off-by: Sven Baars <sven.wine at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
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 1be8817..22117b5 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);
}
More information about the wine-cvs
mailing list