]> pd.if.org Git - pdclib/blobdiff - functions/stdio/snprintf.c
PDCLib includes with quotes, not <>.
[pdclib] / functions / stdio / snprintf.c
index 6dd39671fdf33647fb4b5d97f9022c3dad547372..f095b8cb488daee3282e9b9442b553dd0dc9796c 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$ */
-
 /* snprintf( char *, size_t, const char *, ... )
 
    This file is part of the Public Domain C Library (PDCLib).
@@ -26,15 +24,19 @@ int snprintf( char * _PDCLIB_restrict s, size_t n, const char * _PDCLIB_restrict
 #ifdef TEST
 #define _PDCLIB_FILEID "stdio/snprintf.c"
 #define _PDCLIB_STRINGIO
+#include <stdint.h>
+#include <stddef.h>
 
-#include <_PDCLIB_test.h>
+#include "_PDCLIB_test.h"
 
-#define testprintf( s, format, ... ) snprintf( s, 100, format, __VA_ARGS__ )
+#define testprintf( s, ... ) snprintf( s, 100, __VA_ARGS__ )
 
 int main( void )
 {
     char target[100];
 #include "printf_testcases.h"
+    TESTCASE( snprintf( NULL, 0, "foo" ) == 3 );
+    TESTCASE( snprintf( NULL, 0, "%d", 100 ) == 3 );
     return TEST_RESULTS;
 }