From 324267c4a95ca7a226e300be235dca880f2ac225 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Villac=C3=ADs=20Lasso?= Date: Mon, 18 Jul 2005 10:33:12 +0000 Subject: [PATCH] Test for behavior of negative underflow formatting. --- dlls/oleaut32/tests/vartype.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dlls/oleaut32/tests/vartype.c b/dlls/oleaut32/tests/vartype.c index 6a1bb625c64..7cbb982797a 100644 --- a/dlls/oleaut32/tests/vartype.c +++ b/dlls/oleaut32/tests/vartype.c @@ -4586,6 +4586,7 @@ static void test_VarBoolChangeTypeEx(void) static void test_VarBstrFromR4(void) { static const WCHAR szNative[] = { '6','5','4','3','2','2','.','3','\0' }; + static const WCHAR szZero[] = {'0', '\0'}; LCID lcid; HRESULT hres; BSTR bstr = NULL; @@ -4608,6 +4609,14 @@ static void test_VarBstrFromR4(void) ok(memcmp(bstr, szNative, sizeof(szNative)) == 0, "string different\n"); } } + + f = -1e-400; /* deliberately cause underflow */ + hres = pVarBstrFromR4(f, lcid, 0, &bstr); + ok(hres == S_OK, "got hres 0x%08lx\n", hres); + if (bstr) + { + todo_wine ok(memcmp(bstr, szZero, sizeof(szZero)) == 0, "negative zero (got %s)\n", wtoascii(bstr)); + } } #define BSTR_DATE(dt,str) SysFreeString(bstr); bstr = NULL; \