Mercurial > hg > octave-kai > gnulib-hg
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 |
rev | line source |
---|---|
16721 | 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 | 3 |
4 This program is free software: you can redistribute it and/or modify | |
5 it under the terms of the GNU General Public License as published by | |
6 the Free Software Foundation; either version 3 of the License, or | |
7 (at your option) any later version. | |
8 | |
9 This program is distributed in the hope that it will be useful, | |
10 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 GNU General Public License for more details. | |
13 | |
14 You should have received a copy of the GNU General Public License | |
15 along with this program. If not, see <http://www.gnu.org/licenses/>. */ | |
16 | |
17 /* Written by Bruno Haible <bruno@clisp.org>, 2012. */ | |
18 | |
19 #include <config.h> | |
20 | |
21 #include <locale.h> | |
22 | |
23 #include "signature.h" | |
24 SIGNATURE_CHECK (localeconv, struct lconv *, (void)); | |
25 | |
26 #include <limits.h> | |
27 #include <string.h> | |
28 | |
29 #include "macros.h" | |
30 | |
31 int | |
32 main () | |
33 { | |
34 /* Test localeconv() result in the "C" locale. */ | |
35 { | |
36 struct lconv *l = localeconv (); | |
37 | |
38 ASSERT (STREQ (l->decimal_point, ".")); | |
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 | 41 ASSERT (STREQ (l->grouping, "")); |
42 #endif | |
43 | |
44 ASSERT (STREQ (l->mon_decimal_point, "")); | |
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 | 47 ASSERT (STREQ (l->mon_grouping, "")); |
48 #endif | |
49 ASSERT (STREQ (l->positive_sign, "")); | |
50 ASSERT (STREQ (l->negative_sign, "")); | |
51 | |
52 ASSERT (STREQ (l->currency_symbol, "")); | |
53 ASSERT (l->frac_digits == CHAR_MAX); | |
54 ASSERT (l->p_cs_precedes == CHAR_MAX); | |
55 ASSERT (l->p_sign_posn == CHAR_MAX); | |
56 ASSERT (l->p_sep_by_space == CHAR_MAX); | |
57 ASSERT (l->n_cs_precedes == CHAR_MAX); | |
58 ASSERT (l->n_sign_posn == CHAR_MAX); | |
59 ASSERT (l->n_sep_by_space == CHAR_MAX); | |
60 | |
61 ASSERT (STREQ (l->int_curr_symbol, "")); | |
62 ASSERT (l->int_frac_digits == CHAR_MAX); | |
63 ASSERT (l->int_p_cs_precedes == CHAR_MAX); | |
64 ASSERT (l->int_p_sign_posn == CHAR_MAX); | |
65 ASSERT (l->int_p_sep_by_space == CHAR_MAX); | |
66 ASSERT (l->int_n_cs_precedes == CHAR_MAX); | |
67 ASSERT (l->int_n_sign_posn == CHAR_MAX); | |
68 ASSERT (l->int_n_sep_by_space == CHAR_MAX); | |
69 } | |
70 | |
71 return 0; | |
72 } |