Commit 3d52c87d authored by Alexandre Julliard's avatar Alexandre Julliard

shlwapi/tests: Use nameless unions/structs.

parent a345f985
......@@ -39,12 +39,12 @@ static void test_IStream_invalid_operations(IStream * stream, DWORD mode)
ULONG count;
char data[256];
U(uzero).HighPart = 0;
U(uzero).LowPart = 0;
U(uret).HighPart = 0;
U(uret).LowPart = 0;
U(zero).HighPart = 0;
U(zero).LowPart = 0;
uzero.HighPart = 0;
uzero.LowPart = 0;
uret.HighPart = 0;
uret.LowPart = 0;
zero.HighPart = 0;
zero.LowPart = 0;
/* IStream::Read */
......@@ -707,7 +707,7 @@ static void test_SHCreateStreamOnFileEx_CopyTo(void)
ok(SUCCEEDED(ret), "SHCreateStreamOnFileEx failed with ret=0x%08lx\n", ret);
written.QuadPart = 0;
ret = IStream_Write(src, srcContents, sizeof(srcContents), &U(written).LowPart);
ret = IStream_Write(src, srcContents, sizeof(srcContents), &written.LowPart);
ok(SUCCEEDED(ret), "ISequentialStream_Write failed with ret=0x%08lx\n", ret);
distance.QuadPart = 0;
......@@ -723,8 +723,8 @@ static void test_SHCreateStreamOnFileEx_CopyTo(void)
ret = IStream_CopyTo(src, dst, count, &read, &written);
ok(SUCCEEDED(ret), "CopyTo failed with ret=0x%08lx\n", ret);
ok(read.QuadPart == 1, "read does not match size: %ld != 1\n", U(read).LowPart);
ok(written.QuadPart == 1, "written does not match size: %ld != 1\n", U(written).LowPart);
ok(read.QuadPart == 1, "read does not match size: %ld != 1\n", read.LowPart);
ok(written.QuadPart == 1, "written does not match size: %ld != 1\n", written.LowPart);
IStream_Release(dst);
IStream_Release(src);
......
......@@ -896,7 +896,7 @@ static void test_StrRetToBSTR(void)
}
strret.uType = STRRET_WSTR;
U(strret).pOleStr = CoDupStrW("Test");
strret.pOleStr = CoDupStrW("Test");
bstr = 0;
ret = pStrRetToBSTR(&strret, NULL, &bstr);
ok(ret == S_OK && bstr && !wcscmp(bstr, szTestW),
......@@ -904,14 +904,14 @@ static void test_StrRetToBSTR(void)
SysFreeString(bstr);
strret.uType = STRRET_CSTR;
lstrcpyA(U(strret).cStr, "Test");
lstrcpyA(strret.cStr, "Test");
ret = pStrRetToBSTR(&strret, NULL, &bstr);
ok(ret == S_OK && bstr && !wcscmp(bstr, szTestW),
"STRRET_CSTR: dup failed, ret=0x%08lx, bstr %p\n", ret, bstr);
SysFreeString(bstr);
strret.uType = STRRET_OFFSET;
U(strret).uOffset = 1;
strret.uOffset = 1;
strcpy((char*)&iidl, " Test");
ret = pStrRetToBSTR(&strret, iidl, &bstr);
ok(ret == S_OK && bstr && !wcscmp(bstr, szTestW),
......@@ -1128,7 +1128,7 @@ if (0)
{
memset(wbuf, 0xbf, sizeof(wbuf));
strret.uType = STRRET_WSTR;
U(strret).pOleStr = StrDupW(wstr1);
strret.pOleStr = StrDupW(wstr1);
hres = pStrRetToBufW(&strret, NULL, wbuf, 10);
ok(hres == E_NOT_SUFFICIENT_BUFFER || broken(hres == S_OK) /* winxp */,
"StrRetToBufW returned %08lx\n", hres);
......@@ -1139,14 +1139,14 @@ if (0)
memset(wbuf, 0xbf, sizeof(wbuf));
strret.uType = STRRET_CSTR;
StrCpyNA(U(strret).cStr, str1, MAX_PATH);
StrCpyNA(strret.cStr, str1, MAX_PATH);
hres = pStrRetToBufW(&strret, NULL, wbuf, 10);
ok(hres == S_OK, "StrRetToBufW returned %08lx\n", hres);
ok(!memcmp(wbuf, wstr1, 9*sizeof(WCHAR)) && !wbuf[9], "StrRetToBuf returned %s\n", wine_dbgstr_w(wbuf));
memset(wbuf, 0xbf, sizeof(wbuf));
strret.uType = STRRET_WSTR;
U(strret).pOleStr = NULL;
strret.pOleStr = NULL;
hres = pStrRetToBufW(&strret, NULL, wbuf, 10);
ok(hres == E_FAIL, "StrRetToBufW returned %08lx\n", hres);
ok(!wbuf[0], "StrRetToBuf returned %s\n", wine_dbgstr_w(wbuf));
......@@ -1158,7 +1158,7 @@ if (0)
{
memset(buf, 0xbf, sizeof(buf));
strret.uType = STRRET_CSTR;
StrCpyNA(U(strret).cStr, str1, MAX_PATH);
StrCpyNA(strret.cStr, str1, MAX_PATH);
expect_eq2(pStrRetToBufA(&strret, NULL, buf, 10), S_OK, E_NOT_SUFFICIENT_BUFFER /* Vista */, HRESULT, "%lx");
expect_eq(buf[9], 0, CHAR, "%x");
expect_eq(buf[10], (CHAR)0xbf, CHAR, "%x");
......
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