gettext: Sync with gettext 0.23.
[gnulib.git] / tests / test-localeconv.c
blob1f12c333abadc2f9381077d322c9d195e8a81d47
1 /* Test of localeconv() function.
2 Copyright (C) 2012-2024 Free Software Foundation, Inc.
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.
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.
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <https://www.gnu.org/licenses/>. */
17 /* Written by Bruno Haible <bruno@clisp.org>, 2012. */
19 #include <config.h>
21 #include <locale.h>
23 #include "signature.h"
24 SIGNATURE_CHECK (localeconv, struct lconv *, (void));
26 #include <limits.h>
27 #include <string.h>
29 #include "macros.h"
31 int
32 main ()
34 /* Test localeconv() result in the "C" locale. */
36 struct lconv *l = localeconv ();
38 ASSERT (STREQ (l->decimal_point, "."));
39 ASSERT (STREQ (l->thousands_sep, ""));
40 #if !((defined __FreeBSD__ || defined __DragonFly__) || defined __sun || defined __CYGWIN__)
41 ASSERT (STREQ (l->grouping, ""));
42 #endif
44 ASSERT (STREQ (l->mon_decimal_point, ""));
45 ASSERT (STREQ (l->mon_thousands_sep, ""));
46 #if !((defined __FreeBSD__ || defined __DragonFly__) || defined __sun || defined __CYGWIN__)
47 ASSERT (STREQ (l->mon_grouping, ""));
48 #endif
49 ASSERT (STREQ (l->positive_sign, ""));
50 ASSERT (STREQ (l->negative_sign, ""));
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);
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);
71 return test_exit_status;