annotate tests/test-localeconv.c @ 17476:6057744acd2c default tip master

autoupdate
author Karl Berry <karl@freefriends.org>
date Fri, 16 Aug 2013 06:32:22 -0700 (2013-08-16)
parents e542fd46ad6f
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
16721
ec061881e329 Tests for module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1 /* Test of localeconv() function.
17249
e542fd46ad6f maint: update all copyright year number ranges
Eric Blake <eblake@redhat.com>
parents: 17116
diff changeset
2 Copyright (C) 2012-2013 Free Software Foundation, Inc.
16721
ec061881e329 Tests for module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
3
ec061881e329 Tests for module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
4 This program is free software: you can redistribute it and/or modify
ec061881e329 Tests for module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
5 it under the terms of the GNU General Public License as published by
ec061881e329 Tests for module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
6 the Free Software Foundation; either version 3 of the License, or
ec061881e329 Tests for module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
7 (at your option) any later version.
ec061881e329 Tests for module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
8
ec061881e329 Tests for module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
9 This program is distributed in the hope that it will be useful,
ec061881e329 Tests for module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
ec061881e329 Tests for module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
ec061881e329 Tests for module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
12 GNU General Public License for more details.
ec061881e329 Tests for module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
13
ec061881e329 Tests for module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
14 You should have received a copy of the GNU General Public License
ec061881e329 Tests for module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
15 along with this program. If not, see <http://www.gnu.org/licenses/>. */
ec061881e329 Tests for module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
16
ec061881e329 Tests for module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
17 /* Written by Bruno Haible <bruno@clisp.org>, 2012. */
ec061881e329 Tests for module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
18
ec061881e329 Tests for module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
19 #include <config.h>
ec061881e329 Tests for module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
20
ec061881e329 Tests for module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
21 #include <locale.h>
ec061881e329 Tests for module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
22
ec061881e329 Tests for module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
23 #include "signature.h"
ec061881e329 Tests for module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
24 SIGNATURE_CHECK (localeconv, struct lconv *, (void));
ec061881e329 Tests for module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
25
ec061881e329 Tests for module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
26 #include <limits.h>
ec061881e329 Tests for module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
27 #include <string.h>
ec061881e329 Tests for module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
28
ec061881e329 Tests for module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
29 #include "macros.h"
ec061881e329 Tests for module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
30
ec061881e329 Tests for module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
31 int
ec061881e329 Tests for module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
32 main ()
ec061881e329 Tests for module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
33 {
ec061881e329 Tests for module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
34 /* Test localeconv() result in the "C" locale. */
ec061881e329 Tests for module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
35 {
ec061881e329 Tests for module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
36 struct lconv *l = localeconv ();
ec061881e329 Tests for module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
37
ec061881e329 Tests for module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
38 ASSERT (STREQ (l->decimal_point, "."));
ec061881e329 Tests for module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
39 ASSERT (STREQ (l->thousands_sep, ""));
17116
d45221b76b37 localeconv tests: Avoid test failure on OpenIndiana.
Bruno Haible <bruno@clisp.org>
parents: 16721
diff changeset
40 #if !(defined __FreeBSD__ || defined __sun)
16721
ec061881e329 Tests for module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
41 ASSERT (STREQ (l->grouping, ""));
ec061881e329 Tests for module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
42 #endif
ec061881e329 Tests for module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
43
ec061881e329 Tests for module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
44 ASSERT (STREQ (l->mon_decimal_point, ""));
ec061881e329 Tests for module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
45 ASSERT (STREQ (l->mon_thousands_sep, ""));
17116
d45221b76b37 localeconv tests: Avoid test failure on OpenIndiana.
Bruno Haible <bruno@clisp.org>
parents: 16721
diff changeset
46 #if !(defined __FreeBSD__ || defined __sun)
16721
ec061881e329 Tests for module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
47 ASSERT (STREQ (l->mon_grouping, ""));
ec061881e329 Tests for module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
48 #endif
ec061881e329 Tests for module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
49 ASSERT (STREQ (l->positive_sign, ""));
ec061881e329 Tests for module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
50 ASSERT (STREQ (l->negative_sign, ""));
ec061881e329 Tests for module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
51
ec061881e329 Tests for module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
52 ASSERT (STREQ (l->currency_symbol, ""));
ec061881e329 Tests for module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
53 ASSERT (l->frac_digits == CHAR_MAX);
ec061881e329 Tests for module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
54 ASSERT (l->p_cs_precedes == CHAR_MAX);
ec061881e329 Tests for module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
55 ASSERT (l->p_sign_posn == CHAR_MAX);
ec061881e329 Tests for module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
56 ASSERT (l->p_sep_by_space == CHAR_MAX);
ec061881e329 Tests for module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
57 ASSERT (l->n_cs_precedes == CHAR_MAX);
ec061881e329 Tests for module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
58 ASSERT (l->n_sign_posn == CHAR_MAX);
ec061881e329 Tests for module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
59 ASSERT (l->n_sep_by_space == CHAR_MAX);
ec061881e329 Tests for module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
60
ec061881e329 Tests for module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
61 ASSERT (STREQ (l->int_curr_symbol, ""));
ec061881e329 Tests for module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
62 ASSERT (l->int_frac_digits == CHAR_MAX);
ec061881e329 Tests for module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
63 ASSERT (l->int_p_cs_precedes == CHAR_MAX);
ec061881e329 Tests for module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
64 ASSERT (l->int_p_sign_posn == CHAR_MAX);
ec061881e329 Tests for module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
65 ASSERT (l->int_p_sep_by_space == CHAR_MAX);
ec061881e329 Tests for module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
66 ASSERT (l->int_n_cs_precedes == CHAR_MAX);
ec061881e329 Tests for module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
67 ASSERT (l->int_n_sign_posn == CHAR_MAX);
ec061881e329 Tests for module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
68 ASSERT (l->int_n_sep_by_space == CHAR_MAX);
ec061881e329 Tests for module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
69 }
ec061881e329 Tests for module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
70
ec061881e329 Tests for module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
71 return 0;
ec061881e329 Tests for module 'localeconv'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
72 }