annotate tests/test-isblank.c @ 15887:89c762414427

New module 'atanf'. * lib/math.in.h (atanf): New declaration. * lib/atanf.c: New file. * m4/atanf.m4: New file. * m4/math_h.m4 (gl_MATH_H): Test whether atanf is declared. (gl_MATH_H_DEFAULTS): Initialize GNULIB_ATANF, HAVE_ATANF. * modules/math (Makefile.am): Substitute GNULIB_ATANF, HAVE_ATANF. * modules/atanf: New file. * tests/test-math-c++.cc: Check the declaration of atanf. * doc/posix-functions/atanf.texi: Mention the new module.
author Bruno Haible <bruno@clisp.org>
date Sat, 08 Oct 2011 23:55:44 +0200
parents 97fc9a21a8fb
children 8250f2777afc
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
12185
b66b97142d27 Tests for module 'isblank'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1 /* Test of isblank() function.
14079
97fc9a21a8fb maint: update almost all copyright ranges to include 2011
Jim Meyering <meyering@redhat.com>
parents: 12559
diff changeset
2 Copyright (C) 2009-2011 Free Software Foundation, Inc.
12185
b66b97142d27 Tests for module 'isblank'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
3
b66b97142d27 Tests for module 'isblank'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
4 This program is free software: you can redistribute it and/or modify
b66b97142d27 Tests for module 'isblank'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
5 it under the terms of the GNU General Public License as published by
b66b97142d27 Tests for module 'isblank'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
6 the Free Software Foundation; either version 3 of the License, or
b66b97142d27 Tests for module 'isblank'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
7 (at your option) any later version.
b66b97142d27 Tests for module 'isblank'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
8
b66b97142d27 Tests for module 'isblank'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
9 This program is distributed in the hope that it will be useful,
b66b97142d27 Tests for module 'isblank'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
b66b97142d27 Tests for module 'isblank'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
b66b97142d27 Tests for module 'isblank'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
12 GNU General Public License for more details.
b66b97142d27 Tests for module 'isblank'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
13
b66b97142d27 Tests for module 'isblank'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
14 You should have received a copy of the GNU General Public License
b66b97142d27 Tests for module 'isblank'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
15 along with this program. If not, see <http://www.gnu.org/licenses/>. */
b66b97142d27 Tests for module 'isblank'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
16
b66b97142d27 Tests for module 'isblank'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
17 /* Written by Bruno Haible <bruno@clisp.org>, 2009. */
b66b97142d27 Tests for module 'isblank'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
18
b66b97142d27 Tests for module 'isblank'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
19 #include <config.h>
b66b97142d27 Tests for module 'isblank'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
20
b66b97142d27 Tests for module 'isblank'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
21 #include <ctype.h>
b66b97142d27 Tests for module 'isblank'.
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 (isblank, int, (int));
33ab12a7cea2 tests: add signature checks
Eric Blake <ebb9@byu.net>
parents: 12421
diff changeset
25
12185
b66b97142d27 Tests for module 'isblank'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
26 #include <limits.h>
b66b97142d27 Tests for module 'isblank'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
27 #include <stdio.h>
b66b97142d27 Tests for module 'isblank'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
28
12496
a48d3d749ca5 Refactor common macros used in tests.
Bruno Haible <bruno@clisp.org>
parents: 12489
diff changeset
29 #include "macros.h"
12185
b66b97142d27 Tests for module 'isblank'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
30
b66b97142d27 Tests for module 'isblank'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
31 int
b66b97142d27 Tests for module 'isblank'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
32 main (int argc, char *argv[])
b66b97142d27 Tests for module 'isblank'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
33 {
b66b97142d27 Tests for module 'isblank'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
34 unsigned int c;
b66b97142d27 Tests for module 'isblank'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
35
b66b97142d27 Tests for module 'isblank'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
36 /* Verify the property in the "C" locale.
b66b97142d27 Tests for module 'isblank'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
37 POSIX specifies in
b66b97142d27 Tests for module 'isblank'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
38 <http://www.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap07.html>
b66b97142d27 Tests for module 'isblank'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
39 that
b66b97142d27 Tests for module 'isblank'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
40 - in all locales, the blank characters include the <space> and <tab>
b66b97142d27 Tests for module 'isblank'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
41 characters,
b66b97142d27 Tests for module 'isblank'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
42 - in the "POSIX" locale (which is usually the same as the "C" locale),
b66b97142d27 Tests for module 'isblank'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
43 the blank characters include only the ASCII <space> and <tab>
b66b97142d27 Tests for module 'isblank'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
44 characters. */
b66b97142d27 Tests for module 'isblank'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
45 for (c = 0; c <= UCHAR_MAX; c++)
b66b97142d27 Tests for module 'isblank'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
46 ASSERT (!isblank (c) == !(c == ' ' || c == '\t'));
b66b97142d27 Tests for module 'isblank'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
47 ASSERT (!isblank (EOF));
b66b97142d27 Tests for module 'isblank'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
48
b66b97142d27 Tests for module 'isblank'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
49 return 0;
b66b97142d27 Tests for module 'isblank'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
50 }