First version of msvcrt scanf test.

This commit is contained in:
Uwe Bonnes 2002-10-30 23:49:03 +00:00 committed by Alexandre Julliard
parent ec5612ee1d
commit a768fa3119
6 changed files with 69 additions and 1 deletions

3
configure vendored

File diff suppressed because one or more lines are too long

View File

@ -1411,6 +1411,7 @@ dlls/msimg32/Makefile
dlls/msisys/Makefile
dlls/msnet32/Makefile
dlls/msvcrt/Makefile
dlls/msvcrt/tests/Makefile
dlls/msvcrt20/Makefile
dlls/msvideo/Makefile
dlls/msvideo/msrle32/Makefile

View File

@ -37,6 +37,8 @@ C_SRCS = \
time.c \
wcs.c
SUBDIRS = tests
@MAKE_DLL_RULES@
### Dependencies:

View File

@ -0,0 +1,4 @@
Makefile
msvcrt_test.exe.spec.c
scanf.ok
testlist.c

View File

@ -0,0 +1,14 @@
TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../../..
SRCDIR = @srcdir@
VPATH = @srcdir@
TESTDLL = msvcrt.dll
IMPORTS = msvcrt
EXTRAINCL = -I$(TOPSRCDIR)/include/msvcrt
CTESTS = \
scanf.c
@MAKE_TEST_RULES@
### Dependencies:

46
dlls/msvcrt/tests/scanf.c Normal file
View File

@ -0,0 +1,46 @@
/*
* Unit test suite for *scanf functions.
*
* Copyright 2002 Uwe Bonnes
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "stdio.h"
#include "wine/test.h"
static void test_sscanf( void )
{
char buffer[100];
int result;
strcpy(buffer,"0x519");
ok( sscanf(buffer, "%x", &result) == 1, "sscanf failed" );
ok( result == 0x519,"sscanf reads %x instead of %x", result, 0x519 );
strcpy(buffer,"0x51a");
ok( sscanf(buffer, "%x", &result) == 1, "sscanf failed" );
ok( result == 0x51a ,"sscanf reads %x instead of %x", result, 0x51a );
strcpy(buffer,"0x51g");
ok( sscanf(buffer, "%x", &result) == 1, "sscanf failed" );
ok( result == 0x51, "sscanf reads %x instead of %x", result, 0x51 );
}
START_TEST(scanf)
{
test_sscanf();
}