Print unicode strings in tests

Alexandre Julliard julliard at winehq.org
Wed Jun 1 04:18:54 CDT 2005


Robert Shearman <rob at codeweavers.com> writes:

> Paul Vriens wrote:
> 
> >Hi,
> >
> >I'd like to print unicode-strings in some tests (for debugging purposes).
> >The following however does not show nice output on wine (it does on
> >windows):
> >
> >static const WCHAR dataW[] = {'S','o','m','e',' ','d','a','t','a',0};
> >UNICODE_STRING usdata = { sizeof(dataW)-sizeof(WCHAR), sizeof(dataW),
> >(LPWSTR)dataW };
> >
> >trace("Length is %d\n", usdata.Length);
> >trace("Maximum Length is %d\n", usdata.MaximumLength);
> >trace("The strings is %ls\n", usdata.Buffer);
> >
> >Our trace doesn't seem to be able to cope with %ls (or %S).
> >
> >Any ideas ?
> >
> 
> You need to use wine_dbgstr_w to convert the string to ASCII.

Except you can't use that in tests since they need to build on
Windows.  You'll need to provide your own debugging routine inside the
test.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list