wsprintfW is not supported on Win9x platforms.
wsprintf{A,W}Test should be void. Improve error reporting. Remove unnecessary #includes.
This commit is contained in:
parent
23aa0f64a2
commit
50c0cdef7e
|
@ -17,41 +17,38 @@
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <assert.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
#include "wine/test.h"
|
#include "wine/test.h"
|
||||||
#include "winbase.h"
|
#include "winbase.h"
|
||||||
#include "winuser.h"
|
#include "winuser.h"
|
||||||
|
|
||||||
static BOOL wsprintfATest (void)
|
static void wsprintfATest(void)
|
||||||
{
|
{
|
||||||
char buf[25];
|
char buf[25];
|
||||||
|
int rc;
|
||||||
|
|
||||||
ok ((wsprintfA (buf, "%010ld", -1) == 10), "wsPrintfA length failure");
|
rc=wsprintfA(buf, "%010ld", -1);
|
||||||
ok ((strcmp (buf, "-000000001") == 0),
|
ok(rc == 10, "wsPrintfA length failure: rc=%d error=%ld",rc,GetLastError());
|
||||||
"wsprintfA zero padded negative value failure\n");
|
ok((lstrcmpA(buf, "-000000001") == 0),
|
||||||
|
"wsprintfA zero padded negative value failure: buf=[%s]",buf);
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static BOOL wsprintfWTest (void)
|
static void wsprintfWTest(void)
|
||||||
{
|
{
|
||||||
|
static const WCHAR fmt[] = {'%','0','1','0','l','d','\0'};
|
||||||
|
static const WCHAR target[] = {'-','0','0','0','0','0','0','0','0','1', '\0'};
|
||||||
WCHAR buf[25];
|
WCHAR buf[25];
|
||||||
static const WCHAR fmt[] = {'%','0','1','0','l','d','\0'};
|
int rc;
|
||||||
static const WCHAR target[] = {'-','0','0','0','0','0','0','0','0','1', '\0'};
|
|
||||||
|
|
||||||
ok ((wsprintfW (buf, fmt, -1) == 10), "wsPrintfW length failure");
|
rc=wsprintfW(buf, fmt, -1);
|
||||||
ok ((lstrcmpW (buf, target) == 0),
|
if (rc==0 && GetLastError()==ERROR_CALL_NOT_IMPLEMENTED)
|
||||||
"wsprintfW zero padded negative value failure\n");
|
return;
|
||||||
|
ok(rc == 10, "wsPrintfW length failure: rc=%d error=%ld",rc,GetLastError());
|
||||||
return TRUE;
|
ok((lstrcmpW(buf, target) == 0),
|
||||||
|
"wsprintfW zero padded negative value failure");
|
||||||
}
|
}
|
||||||
|
|
||||||
START_TEST(wsprintf)
|
START_TEST(wsprintf)
|
||||||
{
|
{
|
||||||
wsprintfATest ();
|
wsprintfATest();
|
||||||
wsprintfWTest ();
|
wsprintfWTest();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue