annotate tests/test-vfprintf-posix.c @ 40057:b06060465f09

maint: Run 'make update-copyright'
author Paul Eggert <eggert@cs.ucla.edu>
date Tue, 01 Jan 2019 00:25:11 +0100
parents 10eb9086bea0
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8393
744a1a36452c Tests for module 'vfprintf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1 /* Test of POSIX compatible vfprintf() function.
40057
b06060465f09 maint: Run 'make update-copyright'
Paul Eggert <eggert@cs.ucla.edu>
parents: 19484
diff changeset
2 Copyright (C) 2007-2019 Free Software Foundation, Inc.
8393
744a1a36452c Tests for module 'vfprintf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
3
9309
bbbbbf4cd1c5 Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents: 8891
diff changeset
4 This program is free software: you can redistribute it and/or modify
8393
744a1a36452c Tests for module 'vfprintf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
5 it under the terms of the GNU General Public License as published by
9309
bbbbbf4cd1c5 Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents: 8891
diff changeset
6 the Free Software Foundation; either version 3 of the License, or
bbbbbf4cd1c5 Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents: 8891
diff changeset
7 (at your option) any later version.
8393
744a1a36452c Tests for module 'vfprintf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
8
744a1a36452c Tests for module 'vfprintf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
9 This program is distributed in the hope that it will be useful,
744a1a36452c Tests for module 'vfprintf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
744a1a36452c Tests for module 'vfprintf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
744a1a36452c Tests for module 'vfprintf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
12 GNU General Public License for more details.
744a1a36452c Tests for module 'vfprintf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
13
744a1a36452c Tests for module 'vfprintf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
14 You should have received a copy of the GNU General Public License
19190
9759915b2aca all: prefer https: URLs
Paul Eggert <eggert@cs.ucla.edu>
parents: 18626
diff changeset
15 along with this program. If not, see <https://www.gnu.org/licenses/>. */
8393
744a1a36452c Tests for module 'vfprintf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
16
744a1a36452c Tests for module 'vfprintf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
17 /* Written by Bruno Haible <bruno@clisp.org>, 2007. */
744a1a36452c Tests for module 'vfprintf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
18
8891
633babea5f62 Unconditionally include <config.h> in unit tests.
Eric Blake <ebb9@byu.net>
parents: 8754
diff changeset
19 #include <config.h>
8393
744a1a36452c Tests for module 'vfprintf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
20
744a1a36452c Tests for module 'vfprintf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
21 #include <stdio.h>
744a1a36452c Tests for module 'vfprintf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
22
12489
33ab12a7cea2 tests: add signature checks
Eric Blake <ebb9@byu.net>
parents: 12421
diff changeset
23 #include "signature.h"
33ab12a7cea2 tests: add signature checks
Eric Blake <ebb9@byu.net>
parents: 12421
diff changeset
24 SIGNATURE_CHECK (vfprintf, int, (FILE *, char const *, va_list));
33ab12a7cea2 tests: add signature checks
Eric Blake <ebb9@byu.net>
parents: 12421
diff changeset
25
8393
744a1a36452c Tests for module 'vfprintf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
26 #include <stdarg.h>
744a1a36452c Tests for module 'vfprintf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
27 #include <stddef.h>
744a1a36452c Tests for module 'vfprintf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
28 #include <stdint.h>
744a1a36452c Tests for module 'vfprintf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
29 #include <string.h>
744a1a36452c Tests for module 'vfprintf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
30
12496
a48d3d749ca5 Refactor common macros used in tests.
Bruno Haible <bruno@clisp.org>
parents: 12489
diff changeset
31 #include "macros.h"
8393
744a1a36452c Tests for module 'vfprintf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
32
9858
21157f1c35b7 Avoid some warnings from "gcc -Wshadow".
Bruno Haible <bruno@clisp.org>
parents: 9309
diff changeset
33 #include "test-fprintf-posix.h"
21157f1c35b7 Avoid some warnings from "gcc -Wshadow".
Bruno Haible <bruno@clisp.org>
parents: 9309
diff changeset
34
8393
744a1a36452c Tests for module 'vfprintf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
35 static int
744a1a36452c Tests for module 'vfprintf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
36 my_fprintf (FILE *fp, const char *format, ...)
744a1a36452c Tests for module 'vfprintf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
37 {
744a1a36452c Tests for module 'vfprintf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
38 va_list args;
744a1a36452c Tests for module 'vfprintf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
39 int ret;
744a1a36452c Tests for module 'vfprintf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
40
744a1a36452c Tests for module 'vfprintf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
41 va_start (args, format);
744a1a36452c Tests for module 'vfprintf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
42 ret = vfprintf (fp, format, args);
744a1a36452c Tests for module 'vfprintf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
43 va_end (args);
744a1a36452c Tests for module 'vfprintf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
44 return ret;
744a1a36452c Tests for module 'vfprintf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
45 }
744a1a36452c Tests for module 'vfprintf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
46
744a1a36452c Tests for module 'vfprintf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
47 int
744a1a36452c Tests for module 'vfprintf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
48 main (int argc, char *argv[])
744a1a36452c Tests for module 'vfprintf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
49 {
744a1a36452c Tests for module 'vfprintf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
50 test_function (my_fprintf);
744a1a36452c Tests for module 'vfprintf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
51 return 0;
744a1a36452c Tests for module 'vfprintf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
52 }