Tests show test propsys:propsys is failing for many Windows 7 machines. https://test.winehq.org/data/patterns-tb-win.html#propsys:propsys
It looks like windows 7 processes VT_R4 like VT_R8. (`0.125f / 0x3e000000 (float/4 byte)` becomes `5.1392085562440189e-315 / 0x3e000000 (double/8 byte)`.
Is this worth the effort to remove the failures from the test patterns page?
From: Bernhard Übelacker bernhardu@mailbox.org
--- dlls/propsys/tests/propsys.c | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-)
diff --git a/dlls/propsys/tests/propsys.c b/dlls/propsys/tests/propsys.c index 76d6c866546..d5387210658 100644 --- a/dlls/propsys/tests/propsys.c +++ b/dlls/propsys/tests/propsys.c @@ -1728,7 +1728,7 @@ static void test_PropVariantToString(void) memset(bufferW, 0, sizeof(bufferW)); }
-#define check_PropVariantToBSTR(type, member, value, expect_str) \ +#define check_PropVariantToBSTR(type, member, value, expect_str, broken_str) \ do \ { \ PROPVARIANT check_propvar_ = {.vt = (type), .member = (value)}; \ @@ -1741,7 +1741,9 @@ do \ \ if (check_hr_ == S_OK) \ { \ - ok_(__FILE__, __LINE__)(!wcscmp(check_bstr_, (expect_str)), \ + ok_(__FILE__, __LINE__)( \ + !wcscmp(check_bstr_, (expect_str)) || \ + (broken_str && broken(!wcscmp(check_bstr_, (broken_str)))), \ "Unexpected bstr %s.\n", debugstr_w(check_bstr_)); \ SysFreeString(check_bstr_); \ } \ @@ -1764,21 +1766,21 @@ static void test_PropVariantToBSTR(void)
todo_wine { - check_PropVariantToBSTR(VT_BOOL, boolVal, TRUE, L"1"); - check_PropVariantToBSTR(VT_R4, fltVal, 0.125f, L"0.125"); - check_PropVariantToBSTR(VT_R8, dblVal, 0.456, L"0.456"); + check_PropVariantToBSTR(VT_BOOL, boolVal, TRUE, L"1", NULL); + check_PropVariantToBSTR(VT_R4, fltVal, 0.125f, L"0.125", L"5.13920855624402E-315" /* Win 7 */ ); + check_PropVariantToBSTR(VT_R8, dblVal, 0.456, L"0.456", NULL); } - check_PropVariantToBSTR(VT_I1, cVal, -123, L"-123"); - check_PropVariantToBSTR(VT_I2, iVal, -456, L"-456"); - check_PropVariantToBSTR(VT_I4, lVal, -789, L"-789"); - check_PropVariantToBSTR(VT_I8, hVal.QuadPart, -101112, L"-101112"); - check_PropVariantToBSTR(VT_UI1, bVal, 205, L"205"); - check_PropVariantToBSTR(VT_UI2, uiVal, 57005, L"57005"); - check_PropVariantToBSTR(VT_UI4, ulVal, 0xdeadbeef, L"3735928559"); - check_PropVariantToBSTR(VT_UI8, uhVal.QuadPart, 0xdeadbeefdeadbeef, L"16045690984833335023"); - check_PropVariantToBSTR(VT_CLSID, puuid, (CLSID *)&dummy_guid, dummy_guid_str); - check_PropVariantToBSTR(VT_LPSTR, pszVal, (char *)topic, topicW); - check_PropVariantToBSTR(VT_LPWSTR, pwszVal, (WCHAR *)topicW, topicW); + check_PropVariantToBSTR(VT_I1, cVal, -123, L"-123", NULL); + check_PropVariantToBSTR(VT_I2, iVal, -456, L"-456", NULL); + check_PropVariantToBSTR(VT_I4, lVal, -789, L"-789", NULL); + check_PropVariantToBSTR(VT_I8, hVal.QuadPart, -101112, L"-101112", NULL); + check_PropVariantToBSTR(VT_UI1, bVal, 205, L"205", NULL); + check_PropVariantToBSTR(VT_UI2, uiVal, 57005, L"57005", NULL); + check_PropVariantToBSTR(VT_UI4, ulVal, 0xdeadbeef, L"3735928559", NULL); + check_PropVariantToBSTR(VT_UI8, uhVal.QuadPart, 0xdeadbeefdeadbeef, L"16045690984833335023", NULL); + check_PropVariantToBSTR(VT_CLSID, puuid, (CLSID *)&dummy_guid, dummy_guid_str, NULL); + check_PropVariantToBSTR(VT_LPSTR, pszVal, (char *)topic, topicW, NULL); + check_PropVariantToBSTR(VT_LPWSTR, pwszVal, (WCHAR *)topicW, topicW, NULL);
PropVariantInit(&propvar); propvar.vt = VT_FILETIME;
I don't think I follow. This isn't just a precision issue, but completely garbage output, right? If that's the case, I think it's better to have a separate helper like check_PropVariantToBSTR2() so that we don't need to spread this all over, and it will be less noise when we'll start getting rid of win7 workarounds.
But in general it definitely valuable to clear at much failures as we can from tests page.
This isn't just a precision issue, but completely garbage output, right?
I think this windows version handles `VT_R4` and `VT_R8` the same. Therefore VT_R4 returns the interpretation as a double instead of a float.
This is what gdb shows when placing the 0.125 to some memory and casting this to float or double: ``` $ gdb -q --args tools/makedep Reading symbols from tools/makedep... (gdb) starti ... (gdb) set *(long long*)$rsp = 0 (gdb) x/8xb $rsp 0x7fffffffd600: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 (gdb) set *(float*)$rsp = 0.125 (gdb) x/8xb $rsp 0x7fffffffd600: 0x00 0x00 0x00 0x3e 0x00 0x00 0x00 0x00 (gdb) print *(float*)$rsp $1 = 0.125 (gdb) print *(double*)$rsp $2 = 5.1392085562440189e-315 (gdb) ```
So it seems not completely garbage, just the bits from a float interpreted as double.
I will try to push a check_PropVariantToBSTR2 version later.