annotate tests/test-nl_langinfo.c @ 40057:b06060465f09

maint: Run 'make update-copyright'
author Paul Eggert <eggert@cs.ucla.edu>
date Tue, 01 Jan 2019 00:25:11 +0100
parents 672a9a35f02c
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
12431
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1 /* Test of nl_langinfo replacement.
40057
b06060465f09 maint: Run 'make update-copyright'
Paul Eggert <eggert@cs.ucla.edu>
parents: 19511
diff changeset
2 Copyright (C) 2009-2019 Free Software Foundation, Inc.
12431
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
3
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
4 This program is free software: you can redistribute it and/or modify
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
5 it under the terms of the GNU General Public License as published by
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
6 the Free Software Foundation; either version 3 of the License, or
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
7 (at your option) any later version.
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
8
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
9 This program is distributed in the hope that it will be useful,
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
12 GNU General Public License for more details.
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
13
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
14 You should have received a copy of the GNU General Public License
19190
9759915b2aca all: prefer https: URLs
Paul Eggert <eggert@cs.ucla.edu>
parents: 18626
diff changeset
15 along with this program. If not, see <https://www.gnu.org/licenses/>. */
12431
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
16
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
17 /* Written by Bruno Haible <bruno@clisp.org>, 2009. */
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
18
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
19 #include <config.h>
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
20
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
21 #include <langinfo.h>
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
22
12489
33ab12a7cea2 tests: add signature checks
Eric Blake <ebb9@byu.net>
parents: 12431
diff changeset
23 #include "signature.h"
33ab12a7cea2 tests: add signature checks
Eric Blake <ebb9@byu.net>
parents: 12431
diff changeset
24 SIGNATURE_CHECK (nl_langinfo, char *, (nl_item));
33ab12a7cea2 tests: add signature checks
Eric Blake <ebb9@byu.net>
parents: 12431
diff changeset
25
12431
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
26 #include <locale.h>
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
27 #include <stdlib.h>
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
28 #include <string.h>
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
29
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
30 #include "c-strcase.h"
12496
a48d3d749ca5 Refactor common macros used in tests.
Bruno Haible <bruno@clisp.org>
parents: 12489
diff changeset
31 #include "macros.h"
12431
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
32
13946
438ac293c649 nl_langinfo tests: Avoid gcc warning.
Bruno Haible <bruno@clisp.org>
parents: 13819
diff changeset
33 /* For GCC >= 4.3, silence the warnings
13816
4b3de439fe40 nl_langinfo tests: Silence some warnings.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
34 "comparison of unsigned expression >= 0 is always true"
4b3de439fe40 nl_langinfo tests: Silence some warnings.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
35 in this file. */
13946
438ac293c649 nl_langinfo tests: Avoid gcc warning.
Bruno Haible <bruno@clisp.org>
parents: 13819
diff changeset
36 #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
13816
4b3de439fe40 nl_langinfo tests: Silence some warnings.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
37 # pragma GCC diagnostic ignored "-Wtype-limits"
4b3de439fe40 nl_langinfo tests: Silence some warnings.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
38 #endif
4b3de439fe40 nl_langinfo tests: Silence some warnings.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
39
12431
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
40 int
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
41 main (int argc, char *argv[])
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
42 {
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
43 int pass = atoi (argv[1]);
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
44 /* pass locale
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
45 0 C
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
46 1 traditional French locale
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
47 2 French UTF-8 locale
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
48 */
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
49
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
50 setlocale (LC_ALL, "");
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
51
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
52 /* nl_langinfo items of the LC_CTYPE category */
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
53 ASSERT (strlen (nl_langinfo (CODESET)) > 0);
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
54 if (pass == 2)
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
55 {
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
56 const char *codeset = nl_langinfo (CODESET);
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
57 ASSERT (c_strcasecmp (codeset, "UTF-8") == 0 || c_strcasecmp (codeset, "UTF8") == 0);
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
58 }
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
59 /* nl_langinfo items of the LC_NUMERIC category */
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
60 ASSERT (strlen (nl_langinfo (RADIXCHAR)) > 0);
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
61 ASSERT (strlen (nl_langinfo (THOUSEP)) >= 0);
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
62 /* nl_langinfo items of the LC_TIME category */
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
63 ASSERT (strlen (nl_langinfo (D_T_FMT)) > 0);
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
64 ASSERT (strlen (nl_langinfo (D_FMT)) > 0);
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
65 ASSERT (strlen (nl_langinfo (T_FMT)) > 0);
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
66 ASSERT (strlen (nl_langinfo (T_FMT_AMPM)) >= (pass == 0 ? 1 : 0));
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
67 ASSERT (strlen (nl_langinfo (AM_STR)) >= (pass == 0 ? 1 : 0));
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
68 ASSERT (strlen (nl_langinfo (PM_STR)) >= (pass == 0 ? 1 : 0));
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
69 ASSERT (strlen (nl_langinfo (DAY_1)) > 0);
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
70 ASSERT (strlen (nl_langinfo (DAY_2)) > 0);
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
71 ASSERT (strlen (nl_langinfo (DAY_3)) > 0);
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
72 ASSERT (strlen (nl_langinfo (DAY_4)) > 0);
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
73 ASSERT (strlen (nl_langinfo (DAY_5)) > 0);
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
74 ASSERT (strlen (nl_langinfo (DAY_6)) > 0);
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
75 ASSERT (strlen (nl_langinfo (DAY_7)) > 0);
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
76 ASSERT (strlen (nl_langinfo (ABDAY_1)) > 0);
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
77 ASSERT (strlen (nl_langinfo (ABDAY_2)) > 0);
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
78 ASSERT (strlen (nl_langinfo (ABDAY_3)) > 0);
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
79 ASSERT (strlen (nl_langinfo (ABDAY_4)) > 0);
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
80 ASSERT (strlen (nl_langinfo (ABDAY_5)) > 0);
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
81 ASSERT (strlen (nl_langinfo (ABDAY_6)) > 0);
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
82 ASSERT (strlen (nl_langinfo (ABDAY_7)) > 0);
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
83 ASSERT (strlen (nl_langinfo (MON_1)) > 0);
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
84 ASSERT (strlen (nl_langinfo (MON_2)) > 0);
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
85 ASSERT (strlen (nl_langinfo (MON_3)) > 0);
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
86 ASSERT (strlen (nl_langinfo (MON_4)) > 0);
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
87 ASSERT (strlen (nl_langinfo (MON_5)) > 0);
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
88 ASSERT (strlen (nl_langinfo (MON_6)) > 0);
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
89 ASSERT (strlen (nl_langinfo (MON_7)) > 0);
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
90 ASSERT (strlen (nl_langinfo (MON_8)) > 0);
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
91 ASSERT (strlen (nl_langinfo (MON_9)) > 0);
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
92 ASSERT (strlen (nl_langinfo (MON_10)) > 0);
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
93 ASSERT (strlen (nl_langinfo (MON_11)) > 0);
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
94 ASSERT (strlen (nl_langinfo (MON_12)) > 0);
19511
672a9a35f02c langinfo, nl_langinfo: Add support for alternative month names.
Bruno Haible <bruno@clisp.org>
parents: 19484
diff changeset
95 ASSERT (strlen (nl_langinfo (ALTMON_1)) > 0);
672a9a35f02c langinfo, nl_langinfo: Add support for alternative month names.
Bruno Haible <bruno@clisp.org>
parents: 19484
diff changeset
96 ASSERT (strlen (nl_langinfo (ALTMON_2)) > 0);
672a9a35f02c langinfo, nl_langinfo: Add support for alternative month names.
Bruno Haible <bruno@clisp.org>
parents: 19484
diff changeset
97 ASSERT (strlen (nl_langinfo (ALTMON_3)) > 0);
672a9a35f02c langinfo, nl_langinfo: Add support for alternative month names.
Bruno Haible <bruno@clisp.org>
parents: 19484
diff changeset
98 ASSERT (strlen (nl_langinfo (ALTMON_4)) > 0);
672a9a35f02c langinfo, nl_langinfo: Add support for alternative month names.
Bruno Haible <bruno@clisp.org>
parents: 19484
diff changeset
99 ASSERT (strlen (nl_langinfo (ALTMON_5)) > 0);
672a9a35f02c langinfo, nl_langinfo: Add support for alternative month names.
Bruno Haible <bruno@clisp.org>
parents: 19484
diff changeset
100 ASSERT (strlen (nl_langinfo (ALTMON_6)) > 0);
672a9a35f02c langinfo, nl_langinfo: Add support for alternative month names.
Bruno Haible <bruno@clisp.org>
parents: 19484
diff changeset
101 ASSERT (strlen (nl_langinfo (ALTMON_7)) > 0);
672a9a35f02c langinfo, nl_langinfo: Add support for alternative month names.
Bruno Haible <bruno@clisp.org>
parents: 19484
diff changeset
102 ASSERT (strlen (nl_langinfo (ALTMON_8)) > 0);
672a9a35f02c langinfo, nl_langinfo: Add support for alternative month names.
Bruno Haible <bruno@clisp.org>
parents: 19484
diff changeset
103 ASSERT (strlen (nl_langinfo (ALTMON_9)) > 0);
672a9a35f02c langinfo, nl_langinfo: Add support for alternative month names.
Bruno Haible <bruno@clisp.org>
parents: 19484
diff changeset
104 ASSERT (strlen (nl_langinfo (ALTMON_10)) > 0);
672a9a35f02c langinfo, nl_langinfo: Add support for alternative month names.
Bruno Haible <bruno@clisp.org>
parents: 19484
diff changeset
105 ASSERT (strlen (nl_langinfo (ALTMON_11)) > 0);
672a9a35f02c langinfo, nl_langinfo: Add support for alternative month names.
Bruno Haible <bruno@clisp.org>
parents: 19484
diff changeset
106 ASSERT (strlen (nl_langinfo (ALTMON_12)) > 0);
672a9a35f02c langinfo, nl_langinfo: Add support for alternative month names.
Bruno Haible <bruno@clisp.org>
parents: 19484
diff changeset
107 /* In the tested locales, alternate month names and month names ought to be
672a9a35f02c langinfo, nl_langinfo: Add support for alternative month names.
Bruno Haible <bruno@clisp.org>
parents: 19484
diff changeset
108 the same. */
672a9a35f02c langinfo, nl_langinfo: Add support for alternative month names.
Bruno Haible <bruno@clisp.org>
parents: 19484
diff changeset
109 ASSERT (strcmp (nl_langinfo (ALTMON_1), nl_langinfo (MON_1)) == 0);
672a9a35f02c langinfo, nl_langinfo: Add support for alternative month names.
Bruno Haible <bruno@clisp.org>
parents: 19484
diff changeset
110 ASSERT (strcmp (nl_langinfo (ALTMON_2), nl_langinfo (MON_2)) == 0);
672a9a35f02c langinfo, nl_langinfo: Add support for alternative month names.
Bruno Haible <bruno@clisp.org>
parents: 19484
diff changeset
111 ASSERT (strcmp (nl_langinfo (ALTMON_3), nl_langinfo (MON_3)) == 0);
672a9a35f02c langinfo, nl_langinfo: Add support for alternative month names.
Bruno Haible <bruno@clisp.org>
parents: 19484
diff changeset
112 ASSERT (strcmp (nl_langinfo (ALTMON_4), nl_langinfo (MON_4)) == 0);
672a9a35f02c langinfo, nl_langinfo: Add support for alternative month names.
Bruno Haible <bruno@clisp.org>
parents: 19484
diff changeset
113 ASSERT (strcmp (nl_langinfo (ALTMON_5), nl_langinfo (MON_5)) == 0);
672a9a35f02c langinfo, nl_langinfo: Add support for alternative month names.
Bruno Haible <bruno@clisp.org>
parents: 19484
diff changeset
114 ASSERT (strcmp (nl_langinfo (ALTMON_6), nl_langinfo (MON_6)) == 0);
672a9a35f02c langinfo, nl_langinfo: Add support for alternative month names.
Bruno Haible <bruno@clisp.org>
parents: 19484
diff changeset
115 ASSERT (strcmp (nl_langinfo (ALTMON_7), nl_langinfo (MON_7)) == 0);
672a9a35f02c langinfo, nl_langinfo: Add support for alternative month names.
Bruno Haible <bruno@clisp.org>
parents: 19484
diff changeset
116 ASSERT (strcmp (nl_langinfo (ALTMON_8), nl_langinfo (MON_8)) == 0);
672a9a35f02c langinfo, nl_langinfo: Add support for alternative month names.
Bruno Haible <bruno@clisp.org>
parents: 19484
diff changeset
117 ASSERT (strcmp (nl_langinfo (ALTMON_9), nl_langinfo (MON_9)) == 0);
672a9a35f02c langinfo, nl_langinfo: Add support for alternative month names.
Bruno Haible <bruno@clisp.org>
parents: 19484
diff changeset
118 ASSERT (strcmp (nl_langinfo (ALTMON_10), nl_langinfo (MON_10)) == 0);
672a9a35f02c langinfo, nl_langinfo: Add support for alternative month names.
Bruno Haible <bruno@clisp.org>
parents: 19484
diff changeset
119 ASSERT (strcmp (nl_langinfo (ALTMON_11), nl_langinfo (MON_11)) == 0);
672a9a35f02c langinfo, nl_langinfo: Add support for alternative month names.
Bruno Haible <bruno@clisp.org>
parents: 19484
diff changeset
120 ASSERT (strcmp (nl_langinfo (ALTMON_12), nl_langinfo (MON_12)) == 0);
12431
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
121 ASSERT (strlen (nl_langinfo (ABMON_1)) > 0);
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
122 ASSERT (strlen (nl_langinfo (ABMON_2)) > 0);
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
123 ASSERT (strlen (nl_langinfo (ABMON_3)) > 0);
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
124 ASSERT (strlen (nl_langinfo (ABMON_4)) > 0);
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
125 ASSERT (strlen (nl_langinfo (ABMON_5)) > 0);
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
126 ASSERT (strlen (nl_langinfo (ABMON_6)) > 0);
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
127 ASSERT (strlen (nl_langinfo (ABMON_7)) > 0);
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
128 ASSERT (strlen (nl_langinfo (ABMON_8)) > 0);
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
129 ASSERT (strlen (nl_langinfo (ABMON_9)) > 0);
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
130 ASSERT (strlen (nl_langinfo (ABMON_10)) > 0);
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
131 ASSERT (strlen (nl_langinfo (ABMON_11)) > 0);
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
132 ASSERT (strlen (nl_langinfo (ABMON_12)) > 0);
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
133 ASSERT (strlen (nl_langinfo (ERA)) >= 0);
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
134 ASSERT (strlen (nl_langinfo (ERA_D_FMT)) >= 0);
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
135 ASSERT (strlen (nl_langinfo (ERA_D_T_FMT)) >= 0);
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
136 ASSERT (strlen (nl_langinfo (ERA_T_FMT)) >= 0);
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
137 ASSERT (nl_langinfo (ALT_DIGITS) != NULL);
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
138 /* nl_langinfo items of the LC_MONETARY category */
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
139 {
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
140 const char *currency = nl_langinfo (CRNCYSTR);
13819
b7fdddf92299 nl_langinfo test: Avoid test failure on NetBSD 5.
Bruno Haible <bruno@clisp.org>
parents: 13816
diff changeset
141 ASSERT (strlen (currency) >= 0);
b7fdddf92299 nl_langinfo test: Avoid test failure on NetBSD 5.
Bruno Haible <bruno@clisp.org>
parents: 13816
diff changeset
142 #if !defined __NetBSD__
b7fdddf92299 nl_langinfo test: Avoid test failure on NetBSD 5.
Bruno Haible <bruno@clisp.org>
parents: 13816
diff changeset
143 if (pass > 0)
b7fdddf92299 nl_langinfo test: Avoid test failure on NetBSD 5.
Bruno Haible <bruno@clisp.org>
parents: 13816
diff changeset
144 ASSERT (strlen (currency) >= 1);
b7fdddf92299 nl_langinfo test: Avoid test failure on NetBSD 5.
Bruno Haible <bruno@clisp.org>
parents: 13816
diff changeset
145 #endif
12431
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
146 }
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
147 /* nl_langinfo items of the LC_MESSAGES category */
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
148 ASSERT (strlen (nl_langinfo (YESEXPR)) > 0);
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
149 ASSERT (strlen (nl_langinfo (NOEXPR)) > 0);
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
150
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
151 return 0;
ebdcb6dc7134 Tests for module 'nl_langinfo'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
152 }