Re: msxml3: tests/xmlelem.c: VT_EMPTY is not a string
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
On Mon, Jun 9, 2008 at 2:32 AM, Michael Stefaniuc <mstefani(a)redhat.com> wrote:
- 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?
NULL would probably be fine. (I come from an era where NULL had to be defined by hand, so sometimes I slip and don't use it.) - Dan
participants (2)
-
Dan Kegel -
Michael Stefaniuc