]> pd.if.org Git - pdclib/blob - functions/stdio/vprintf.c
Tyndur tests
[pdclib] / functions / stdio / vprintf.c
1 /* vprintf( const char *, va_list )
2
3    This file is part of the Public Domain C Library (PDCLib).
4    Permission is granted to use, modify, and / or redistribute at will.
5 */
6
7 #include <stdio.h>
8 #include <stdarg.h>
9
10 #ifndef REGTEST
11
12 int vprintf( const char * _PDCLIB_restrict format, _PDCLIB_va_list arg )
13 {
14     return vfprintf( stdout, format, arg );
15 }
16
17 #endif
18
19 #ifdef TEST
20 #define _PDCLIB_FILEID "stdio/vprintf.c"
21 #define _PDCLIB_FILEIO
22 #include <stdint.h>
23 #include <stddef.h>
24 #include "_PDCLIB_test.h"
25
26 static int testprintf( FILE * stream, const char * format, ... )
27 {
28     int i;
29     va_list arg;
30     va_start( arg, format );
31     i = vprintf( format, arg );
32     va_end( arg );
33     return i;
34 }
35
36 int main( void )
37 {
38     FILE * target;
39     TESTCASE( ( target = freopen( testfile, "wb+", stdout ) ) != NULL );
40 #include "printf_testcases.h"
41     TESTCASE( fclose( target ) == 0 );
42     TESTCASE( remove( testfile ) == 0 );
43     return TEST_RESULTS;
44 }
45
46 #endif