projects
/
fw
/
pdclib
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Reworked scanf() testing. General cleanups.
[fw/pdclib]
/
functions
/
stdio
/
vsnprintf.c
diff --git
a/functions/stdio/vsnprintf.c
b/functions/stdio/vsnprintf.c
index 9768c0a02504d45b9cf74a45b3ce51a8771c8d98..9eb869e78cb2b7dbb52c9eab259b0fba1670283c 100644
(file)
--- a/
functions/stdio/vsnprintf.c
+++ b/
functions/stdio/vsnprintf.c
@@
-48,29
+48,25
@@
int vsnprintf( char * _PDCLIB_restrict s, size_t n, const char * _PDCLIB_restric
#endif
#ifdef TEST
#endif
#ifdef TEST
-#include <_PDCLIB_test.h>
+#define _PDCLIB_FILEID "stdio/vsnprintf.c"
+#define _PDCLIB_STRINGIO
-#include <limits.h>
-#include <stdint.h>
-#include <string.h>
+#include <_PDCLIB_test.h>
-static int testprintf( char * s,
size_t n,
const char * format, ... )
+static int testprintf( char * s, const char * format, ... )
{
int i;
va_list arg;
va_start( arg, format );
{
int i;
va_list arg;
va_start( arg, format );
- i = vsnprintf( s,
n
, format, arg );
+ i = vsnprintf( s,
100
, format, arg );
va_end( arg );
return i;
}
va_end( arg );
return i;
}
-#define TESTCASE_SPRINTF( x ) if ( strcmp( buffer, x ) == 0 ) {} \
- else { TEST_RESULTS += 1; printf( "FAILED: " __FILE__ ", line %d - \"%s\" != %s\n", __LINE__, buffer, #x ); }
-
int main( void )
{
int main( void )
{
- char
buffer
[100];
-#include "printf_testcases.
incl
"
+ char
target
[100];
+#include "printf_testcases.
h
"
return TEST_RESULTS;
}
return TEST_RESULTS;
}