#endif
#ifdef TEST
-#include <_PDCLIB_test.h>
-
-#include <string.h>
-#include <limits.h>
+#define _PDCLIB_FILEID "stdio/snprintf.c"
+#define _PDCLIB_STRINGIO
-#define testprintf( s, n, format, ... ) snprintf( s, n, format, __VA_ARGS__ )
+#include <_PDCLIB_test.h>
-#define TESTCASE_SPRINTF( x ) TESTCASE( x )
+#define testprintf( s, ... ) snprintf( s, 100, __VA_ARGS__ )
int main( void )
{
- char buffer[100];
-#include "printf_testcases.incl"
+ char target[100];
+#include "printf_testcases.h"
+ TESTCASE( snprintf( NULL, 0, "foo" ) == 3 );
+ TESTCASE( snprintf( NULL, 0, "%d", 100 ) == 3 );
return TEST_RESULTS;
}