unit test (C) with WINAPIV function

Huw D M Davies h.davies1 at physics.ox.ac.uk
Tue Apr 23 11:46:29 CDT 2002


On Tue, Apr 23, 2002 at 09:18:45AM -0700, Medland, Bill wrote:
> Any chance of some help with this?

> static BOOL wsprintfWTest (void)
> {
>     WCHAR buf[25];
> 	static const WCHAR fmt[] = {'%','0','1','0','l','d','\0'};
> 	WCHAR target[] = {'-','0','0','0','0','0','0','0','0','1'};

target's not '\0' terminated.
 
>     printf ("%p %p\n", buf, fmt);
>     ok ((wsprintfW (buf, fmt -1) == 10), "wsPrintfW length failure");

missing a ',' between fmt and -1.

> 	ok ((lstrcmpW (buf, target) == 0),
> 	    "wsprintfW zero padded negative value failure\n");
> 
>     return TRUE;
> }

Huw.




More information about the wine-devel mailing list