From: Bernhard Übelacker bernhardu@mailbox.org
--- dlls/propsys/tests/propsys.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-)
diff --git a/dlls/propsys/tests/propsys.c b/dlls/propsys/tests/propsys.c index 76d6c866546..53aea0abd15 100644 --- a/dlls/propsys/tests/propsys.c +++ b/dlls/propsys/tests/propsys.c @@ -1747,6 +1747,27 @@ do \ } \ } while (0)
+#define check_PropVariantToBSTR2(type, member, value, expect_str, broken_str) \ +do \ +{ \ + PROPVARIANT check_propvar_ = {.vt = (type), .member = (value)}; \ + HRESULT check_hr_; \ + BSTR check_bstr_; \ + \ + check_hr_ = PropVariantToBSTR(&check_propvar_, &check_bstr_); \ + ok_(__FILE__, __LINE__)(check_hr_ == S_OK, \ + "PropVariantToBSTR returned %#lx.\n", check_hr_); \ + \ + if (check_hr_ == S_OK) \ + { \ + 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_); \ + } \ +} while (0) + static void test_PropVariantToBSTR(void) { unsigned char test_bytes[] = {1, 20, 30, 4}; @@ -1765,7 +1786,7 @@ 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_PropVariantToBSTR2(VT_R4, fltVal, 0.125f, L"0.125", L"5.13920855624402E-315" /* Win 7 */ ); check_PropVariantToBSTR(VT_R8, dblVal, 0.456, L"0.456"); } check_PropVariantToBSTR(VT_I1, cVal, -123, L"-123");