Commit 1a37f6e9 authored by André Hentschel's avatar André Hentschel Committed by Alexandre Julliard

oleaut32/tests: Add more safearray tests.

parent ae3e768a
...@@ -1590,13 +1590,30 @@ static void test_SafeArrayCopy(void) ...@@ -1590,13 +1590,30 @@ static void test_SafeArrayCopy(void)
hres = SafeArrayAllocDescriptor(1, &sa); hres = SafeArrayAllocDescriptor(1, &sa);
ok(hres == S_OK, "SafeArrayAllocDescriptor failed with error 0x%08x\n", hres); ok(hres == S_OK, "SafeArrayAllocDescriptor failed with error 0x%08x\n", hres);
sa->cbElements = 16;
hres = SafeArrayCopy(sa, &sa2);
ok(hres == S_OK, "SafeArrayCopy failed with error 0x%08x\n", hres);
ok(sa != sa2, "SafeArrayCopy performed shallow copy\n");
hres = SafeArrayDestroy(sa2);
ok(hres == S_OK, "got 0x%08x\n", hres);
hres = SafeArrayDestroy(sa);
ok(hres == S_OK, "got 0x%08x\n", hres);
sa2 = (void*)0xdeadbeef;
hres = SafeArrayCopy(NULL, &sa2);
ok(hres == S_OK, "SafeArrayCopy failed with error 0x%08x\n", hres);
ok(!sa2, "SafeArrayCopy didn't return NULL for output array\n");
hres = SafeArrayAllocDescriptor(1, &sa);
ok(hres == S_OK, "SafeArrayAllocDescriptor failed with error 0x%08x\n", hres);
sa2 = (void*)0xdeadbeef;
hres = SafeArrayCopy(sa, &sa2); hres = SafeArrayCopy(sa, &sa2);
ok(hres == E_INVALIDARG, ok(hres == E_INVALIDARG,
"SafeArrayCopy with empty array should have failed with error E_INVALIDARG instead of 0x%08x\n", "SafeArrayCopy with empty array should have failed with error E_INVALIDARG instead of 0x%08x\n",
hres); hres);
sa->cbElements = 16; ok(!sa2, "SafeArrayCopy didn't return NULL for output array\n");
hres = SafeArrayCopy(sa, &sa2);
ok(hres == S_OK, "SafeArrayCopy failed with error 0x%08x\n", hres);
hres = SafeArrayDestroy(sa2); hres = SafeArrayDestroy(sa2);
ok(hres == S_OK, "got 0x%08x\n", hres); ok(hres == S_OK, "got 0x%08x\n", hres);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment