msxml3: tests/xmlelem.c: VT_EMPTY is not a string

Michael Stefaniuc mstefani at redhat.com
Mon Jun 9 04:32:01 CDT 2008


Dan Kegel wrote:
> Casting a VT_EMPTY to a string gets you a null string.
> The test was doing that and taking the string length, then comparing to zero.
> Better to simply compare to null; that's a stronger test, and
> avoids generating a behind-the-scenes exception.
> 
> Passes on Wine and XP, and makes Valgrind output a bit easier on the eyes.
> 
> 
> ------------------------------------------------------------------------
> diff --git a/dlls/msxml3/tests/xmlelem.c b/dlls/msxml3/tests/xmlelem.c
> index 61a2300..229de78 100644
> --- a/dlls/msxml3/tests/xmlelem.c
> +++ b/dlls/msxml3/tests/xmlelem.c
> @@ -78,7 +78,7 @@ static void test_xmlelem(void)
>      hr = IXMLElement_getAttribute(element, str, &vValue);
>      ok(hr == S_FALSE, "Expected S_FALSE, got %d\n", hr);
>      ok(V_VT(&vValue) == VT_EMPTY, "Expected VT_EMPTY, got %d\n",
V_VT(&vValue));
> -    ok(lstrlenW(V_BSTR(&vValue)) == 0, "Expected empty value\n");
> +    ok(V_BSTR(&vValue) == (void *)0, "Expected null value\n");
Is there a problem with using NULL instead of (void *)0?

bye
	michael



More information about the wine-devel mailing list