annotate tests/test-printf-posix.c @ 17415:6550127da196

argp: typo fix * lib/argp-help.c: Typo in comment.
author Alexandre Duret-Lutz <adl@lrde.epita.fr>
date Fri, 17 May 2013 19:01:14 +0200
parents e542fd46ad6f
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9430
bb2a238b2c3a Typo in comment.
Bruno Haible <bruno@clisp.org>
parents: 9309
diff changeset
1 /* Test of POSIX compatible printf() function.
17249
e542fd46ad6f maint: update all copyright year number ranges
Eric Blake <eblake@redhat.com>
parents: 16201
diff changeset
2 Copyright (C) 2007-2013 Free Software Foundation, Inc.
8403
f05a09ae28b1 Tests for module 'printf-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
8403
f05a09ae28b1 Tests for module 'printf-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.
8403
f05a09ae28b1 Tests for module 'printf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
8
f05a09ae28b1 Tests for module 'printf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
9 This program is distributed in the hope that it will be useful,
f05a09ae28b1 Tests for module 'printf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
f05a09ae28b1 Tests for module 'printf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
f05a09ae28b1 Tests for module 'printf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
12 GNU General Public License for more details.
f05a09ae28b1 Tests for module 'printf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
13
f05a09ae28b1 Tests for module 'printf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
14 You should have received a copy of the GNU General Public License
9309
bbbbbf4cd1c5 Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents: 8891
diff changeset
15 along with this program. If not, see <http://www.gnu.org/licenses/>. */
8403
f05a09ae28b1 Tests for module 'printf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
16
f05a09ae28b1 Tests for module 'printf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
17 /* Written by Bruno Haible <bruno@clisp.org>, 2007. */
f05a09ae28b1 Tests for module 'printf-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>
8403
f05a09ae28b1 Tests for module 'printf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
20
f05a09ae28b1 Tests for module 'printf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
21 #include <stdio.h>
f05a09ae28b1 Tests for module 'printf-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 (printf, int, (char const *, ...));
33ab12a7cea2 tests: add signature checks
Eric Blake <ebb9@byu.net>
parents: 12421
diff changeset
25
8403
f05a09ae28b1 Tests for module 'printf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
26 #include <stddef.h>
f05a09ae28b1 Tests for module 'printf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
27 #include <stdint.h>
f05a09ae28b1 Tests for module 'printf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
28 #include <string.h>
f05a09ae28b1 Tests for module 'printf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
29
12496
a48d3d749ca5 Refactor common macros used in tests.
Bruno Haible <bruno@clisp.org>
parents: 12489
diff changeset
30 #include "macros.h"
8403
f05a09ae28b1 Tests for module 'printf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
31
f05a09ae28b1 Tests for module 'printf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
32 #include "test-printf-posix.h"
f05a09ae28b1 Tests for module 'printf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
33
f05a09ae28b1 Tests for module 'printf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
34 int
f05a09ae28b1 Tests for module 'printf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
35 main (int argc, char *argv[])
f05a09ae28b1 Tests for module 'printf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
36 {
f05a09ae28b1 Tests for module 'printf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
37 test_function (printf);
f05a09ae28b1 Tests for module 'printf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
38 return 0;
f05a09ae28b1 Tests for module 'printf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
39 }
f05a09ae28b1 Tests for module 'printf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
40
f05a09ae28b1 Tests for module 'printf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
41 /* Test whether __attribute__ (__format__ (...)) still works. */
15962
cfa1d5dbe78c Support for old NeXTstep 3.3 gcc.
Daniel Richard G <skunk@iskunk.org>
parents: 14079
diff changeset
42 #if (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)) && !defined __STRICT_ANSI__
8403
f05a09ae28b1 Tests for module 'printf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
43 extern int func1 (char *, size_t, const char *, ...)
f05a09ae28b1 Tests for module 'printf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
44 __attribute__ ((__format__ (__printf__, 3, 4)));
f05a09ae28b1 Tests for module 'printf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
45 extern int func2 (char *, size_t, const char *, ...)
f05a09ae28b1 Tests for module 'printf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
46 __attribute__ ((__format__ (printf, 3, 4)));
f05a09ae28b1 Tests for module 'printf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
47 extern int func3 (char *, size_t, const char *, ...)
f05a09ae28b1 Tests for module 'printf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
48 __attribute__ ((format (__printf__, 3, 4)));
f05a09ae28b1 Tests for module 'printf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
49 extern int func4 (char *, size_t, const char *, ...)
f05a09ae28b1 Tests for module 'printf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
50 __attribute__ ((format (printf, 3, 4)));
f05a09ae28b1 Tests for module 'printf-posix'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
51 #endif