Mercurial > hg > octave-kai > gnulib-hg
annotate tests/unistdio/test-u32-printf1.h @ 17476:6057744acd2c default tip master
autoupdate
author | Karl Berry <karl@freefriends.org> |
---|---|
date | Fri, 16 Aug 2013 06:32:22 -0700 |
parents | e542fd46ad6f |
children |
rev | line source |
---|---|
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1 /* Test of u32_v[a]s[n]printf() function. |
17249
e542fd46ad6f
maint: update all copyright year number ranges
Eric Blake <eblake@redhat.com>
parents:
16201
diff
changeset
|
2 Copyright (C) 2007, 2009-2013 Free Software Foundation, Inc. |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3 |
9309
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
9030
diff
changeset
|
4 This program is free software: you can redistribute it and/or modify |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5 it under the terms of the GNU General Public License as published by |
9309
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
9030
diff
changeset
|
6 the Free Software Foundation; either version 3 of the License, or |
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
9030
diff
changeset
|
7 (at your option) any later version. |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
8 |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
9 This program is distributed in the hope that it will be useful, |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
10 but WITHOUT ANY WARRANTY; without even the implied warranty of |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
12 GNU General Public License for more details. |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
13 |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
14 You should have received a copy of the GNU General Public License |
9309
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
9030
diff
changeset
|
15 along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
16 |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
17 /* Written by Bruno Haible <bruno@clisp.org>, 2007. */ |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
18 |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
19 static void |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
20 test_xfunction (uint32_t * (*my_xasprintf) (const char *, ...)) |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
21 { |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
22 /* Test support of size specifiers as in C99. */ |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
23 |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
24 { |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
25 uint32_t *result = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
26 my_xasprintf ("%ju %d", (uintmax_t) 12345671, 33, 44, 55); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
27 static const uint32_t expected[] = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
28 { '1', '2', '3', '4', '5', '6', '7', '1', ' ', '3', '3', 0 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
29 ASSERT (result != NULL); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
30 ASSERT (u32_strcmp (result, expected) == 0); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
31 free (result); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
32 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
33 |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
34 { |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
35 uint32_t *result = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
36 my_xasprintf ("%zu %d", (size_t) 12345672, 33, 44, 55); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
37 static const uint32_t expected[] = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
38 { '1', '2', '3', '4', '5', '6', '7', '2', ' ', '3', '3', 0 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
39 ASSERT (result != NULL); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
40 ASSERT (u32_strcmp (result, expected) == 0); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
41 free (result); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
42 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
43 |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
44 { |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
45 uint32_t *result = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
46 my_xasprintf ("%tu %d", (ptrdiff_t) 12345673, 33, 44, 55); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
47 static const uint32_t expected[] = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
48 { '1', '2', '3', '4', '5', '6', '7', '3', ' ', '3', '3', 0 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
49 ASSERT (result != NULL); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
50 ASSERT (u32_strcmp (result, expected) == 0); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
51 free (result); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
52 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
53 |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
54 { |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
55 uint32_t *result = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
56 my_xasprintf ("%Lg %d", (long double) 1.5, 33, 44, 55); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
57 static const uint32_t expected[] = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
58 { '1', '.', '5', ' ', '3', '3', 0 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
59 ASSERT (result != NULL); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
60 ASSERT (u32_strcmp (result, expected) == 0); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
61 free (result); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
62 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
63 |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
64 /* Test the support of the 'U' conversion specifier for Unicode strings. */ |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
65 |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
66 { |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
67 static const uint8_t unicode_string[] = "Hello"; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
68 { |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
69 uint32_t *result = |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
70 my_xasprintf ("%U %d", unicode_string, 33, 44, 55); |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
71 static const uint32_t expected[] = |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
72 { 'H', 'e', 'l', 'l', 'o', ' ', '3', '3', 0 }; |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
73 ASSERT (result != NULL); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
74 ASSERT (u32_strcmp (result, expected) == 0); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
75 free (result); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
76 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
77 { /* Width. */ |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
78 uint32_t *result = |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
79 my_xasprintf ("%10U %d", unicode_string, 33, 44, 55); |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
80 static const uint32_t expected[] = |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
81 { ' ', ' ', ' ', ' ', ' ', 'H', 'e', 'l', 'l', 'o', ' ', '3', '3', 0 }; |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
82 ASSERT (result != NULL); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
83 ASSERT (u32_strcmp (result, expected) == 0); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
84 free (result); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
85 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
86 { /* FLAG_LEFT. */ |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
87 uint32_t *result = |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
88 my_xasprintf ("%-10U %d", unicode_string, 33, 44, 55); |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
89 static const uint32_t expected[] = |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
90 { 'H', 'e', 'l', 'l', 'o', ' ', ' ', ' ', ' ', ' ', ' ', '3', '3', 0 }; |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
91 ASSERT (result != NULL); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
92 ASSERT (u32_strcmp (result, expected) == 0); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
93 free (result); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
94 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
95 { /* FLAG_ZERO: no effect. */ |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
96 uint32_t *result = |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
97 my_xasprintf ("%010U %d", unicode_string, 33, 44, 55); |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
98 static const uint32_t expected[] = |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
99 { ' ', ' ', ' ', ' ', ' ', 'H', 'e', 'l', 'l', 'o', ' ', '3', '3', 0 }; |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
100 ASSERT (result != NULL); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
101 ASSERT (u32_strcmp (result, expected) == 0); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
102 free (result); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
103 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
104 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
105 |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
106 { |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
107 static const uint16_t unicode_string[] = { 'H', 'e', 'l', 'l', 'o', 0 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
108 { |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
109 uint32_t *result = |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
110 my_xasprintf ("%lU %d", unicode_string, 33, 44, 55); |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
111 static const uint32_t expected[] = |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
112 { 'H', 'e', 'l', 'l', 'o', ' ', '3', '3', 0 }; |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
113 ASSERT (result != NULL); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
114 ASSERT (u32_strcmp (result, expected) == 0); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
115 free (result); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
116 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
117 { /* Width. */ |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
118 uint32_t *result = |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
119 my_xasprintf ("%10lU %d", unicode_string, 33, 44, 55); |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
120 static const uint32_t expected[] = |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
121 { ' ', ' ', ' ', ' ', ' ', 'H', 'e', 'l', 'l', 'o', ' ', '3', '3', 0 }; |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
122 ASSERT (result != NULL); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
123 ASSERT (u32_strcmp (result, expected) == 0); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
124 free (result); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
125 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
126 { /* FLAG_LEFT. */ |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
127 uint32_t *result = |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
128 my_xasprintf ("%-10lU %d", unicode_string, 33, 44, 55); |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
129 static const uint32_t expected[] = |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
130 { 'H', 'e', 'l', 'l', 'o', ' ', ' ', ' ', ' ', ' ', ' ', '3', '3', 0 }; |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
131 ASSERT (result != NULL); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
132 ASSERT (u32_strcmp (result, expected) == 0); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
133 free (result); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
134 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
135 { /* FLAG_ZERO: no effect. */ |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
136 uint32_t *result = |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
137 my_xasprintf ("%010lU %d", unicode_string, 33, 44, 55); |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
138 static const uint32_t expected[] = |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
139 { ' ', ' ', ' ', ' ', ' ', 'H', 'e', 'l', 'l', 'o', ' ', '3', '3', 0 }; |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
140 ASSERT (result != NULL); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
141 ASSERT (u32_strcmp (result, expected) == 0); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
142 free (result); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
143 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
144 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
145 |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
146 { |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
147 static const uint32_t unicode_string[] = { 'H', 'e', 'l', 'l', 'o', 0 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
148 { |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
149 uint32_t *result = |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
150 my_xasprintf ("%llU %d", unicode_string, 33, 44, 55); |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
151 static const uint32_t expected[] = |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
152 { 'H', 'e', 'l', 'l', 'o', ' ', '3', '3', 0 }; |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
153 ASSERT (result != NULL); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
154 ASSERT (u32_strcmp (result, expected) == 0); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
155 free (result); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
156 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
157 { /* Width. */ |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
158 uint32_t *result = |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
159 my_xasprintf ("%10llU %d", unicode_string, 33, 44, 55); |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
160 static const uint32_t expected[] = |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
161 { ' ', ' ', ' ', ' ', ' ', 'H', 'e', 'l', 'l', 'o', ' ', '3', '3', 0 }; |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
162 ASSERT (result != NULL); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
163 ASSERT (u32_strcmp (result, expected) == 0); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
164 free (result); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
165 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
166 { /* FLAG_LEFT. */ |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
167 uint32_t *result = |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
168 my_xasprintf ("%-10llU %d", unicode_string, 33, 44, 55); |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
169 static const uint32_t expected[] = |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
170 { 'H', 'e', 'l', 'l', 'o', ' ', ' ', ' ', ' ', ' ', ' ', '3', '3', 0 }; |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
171 ASSERT (result != NULL); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
172 ASSERT (u32_strcmp (result, expected) == 0); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
173 free (result); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
174 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
175 { /* FLAG_ZERO: no effect. */ |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
176 uint32_t *result = |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
177 my_xasprintf ("%010llU %d", unicode_string, 33, 44, 55); |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
178 static const uint32_t expected[] = |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
179 { ' ', ' ', ' ', ' ', ' ', 'H', 'e', 'l', 'l', 'o', ' ', '3', '3', 0 }; |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
180 ASSERT (result != NULL); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
181 ASSERT (u32_strcmp (result, expected) == 0); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
182 free (result); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
183 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
184 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
185 |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
186 /* Test the support of the 's' conversion specifier for strings. */ |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
187 |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
188 { |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
189 uint32_t *result = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
190 my_xasprintf ("Mr. %s %d", "Ronald Reagan", 33, 44, 55); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
191 static const uint32_t expected[] = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
192 { 'M', 'r', '.', ' ', 'R', 'o', 'n', 'a', 'l', 'd', |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
193 ' ', 'R', 'e', 'a', 'g', 'a', 'n', ' ', '3', '3', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
194 0 |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
195 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
196 ASSERT (result != NULL); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
197 ASSERT (u32_strcmp (result, expected) == 0); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
198 free (result); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
199 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
200 |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
201 { /* Width. */ |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
202 uint32_t *result = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
203 my_xasprintf ("Mr. %20s %d", "Ronald Reagan", 33, 44, 55); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
204 static const uint32_t expected[] = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
205 { 'M', 'r', '.', ' ', ' ', ' ', ' ', ' ', ' ', ' ', |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
206 ' ', 'R', 'o', 'n', 'a', 'l', 'd', ' ', 'R', 'e', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
207 'a', 'g', 'a', 'n', ' ', '3', '3', 0 |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
208 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
209 ASSERT (result != NULL); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
210 ASSERT (u32_strcmp (result, expected) == 0); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
211 free (result); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
212 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
213 |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
214 { /* FLAG_LEFT. */ |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
215 uint32_t *result = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
216 my_xasprintf ("Mr. %-20s %d", "Ronald Reagan", 33, 44, 55); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
217 static const uint32_t expected[] = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
218 { 'M', 'r', '.', ' ', 'R', 'o', 'n', 'a', 'l', 'd', |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
219 ' ', 'R', 'e', 'a', 'g', 'a', 'n', ' ', ' ', ' ', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
220 ' ', ' ', ' ', ' ', ' ', '3', '3', 0 |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
221 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
222 ASSERT (result != NULL); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
223 ASSERT (u32_strcmp (result, expected) == 0); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
224 free (result); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
225 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
226 |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
227 { /* FLAG_ZERO: no effect. */ |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
228 uint32_t *result = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
229 my_xasprintf ("Mr. %020s %d", "Ronald Reagan", 33, 44, 55); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
230 static const uint32_t expected[] = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
231 { 'M', 'r', '.', ' ', ' ', ' ', ' ', ' ', ' ', ' ', |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
232 ' ', 'R', 'o', 'n', 'a', 'l', 'd', ' ', 'R', 'e', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
233 'a', 'g', 'a', 'n', ' ', '3', '3', 0 |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
234 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
235 ASSERT (result != NULL); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
236 ASSERT (u32_strcmp (result, expected) == 0); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
237 free (result); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
238 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
239 |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
240 /* Test the support of the 'a' and 'A' conversion specifier for hexadecimal |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
241 output of floating-point numbers. */ |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
242 |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
243 { /* A positive number. */ |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
244 uint32_t *result = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
245 my_xasprintf ("%a %d", 3.1416015625, 33, 44, 55); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
246 static const uint32_t expected1[] = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
247 { '0', 'x', '1', '.', '9', '2', '2', 'p', '+', '1', ' ', '3', '3', 0 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
248 static const uint32_t expected2[] = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
249 { '0', 'x', '3', '.', '2', '4', '4', 'p', '+', '0', ' ', '3', '3', 0 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
250 static const uint32_t expected3[] = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
251 { '0', 'x', '6', '.', '4', '8', '8', 'p', '-', '1', ' ', '3', '3', 0 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
252 static const uint32_t expected4[] = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
253 { '0', 'x', 'c', '.', '9', '1', 'p', '-', '2', ' ', '3', '3', 0 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
254 ASSERT (result != NULL); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
255 ASSERT (u32_strcmp (result, expected1) == 0 |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
256 || u32_strcmp (result, expected2) == 0 |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
257 || u32_strcmp (result, expected3) == 0 |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
258 || u32_strcmp (result, expected4) == 0); |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
259 free (result); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
260 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
261 |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
262 { /* Width. */ |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
263 uint32_t *result = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
264 my_xasprintf ("%10a %d", 1.75, 33, 44, 55); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
265 static const uint32_t expected1[] = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
266 { ' ', ' ', '0', 'x', '1', '.', 'c', 'p', '+', '0', ' ', '3', '3', 0 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
267 static const uint32_t expected2[] = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
268 { ' ', ' ', '0', 'x', '3', '.', '8', 'p', '-', '1', ' ', '3', '3', 0 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
269 static const uint32_t expected3[] = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
270 { ' ', ' ', ' ', ' ', '0', 'x', '7', 'p', '-', '2', ' ', '3', '3', 0 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
271 static const uint32_t expected4[] = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
272 { ' ', ' ', ' ', ' ', '0', 'x', 'e', 'p', '-', '3', ' ', '3', '3', 0 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
273 ASSERT (result != NULL); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
274 ASSERT (u32_strcmp (result, expected1) == 0 |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
275 || u32_strcmp (result, expected2) == 0 |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
276 || u32_strcmp (result, expected3) == 0 |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
277 || u32_strcmp (result, expected4) == 0); |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
278 free (result); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
279 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
280 |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
281 { /* Small precision. */ |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
282 uint32_t *result = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
283 my_xasprintf ("%.10a %d", 1.75, 33, 44, 55); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
284 static const uint32_t expected1[] = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
285 { '0', 'x', '1', '.', 'c', '0', '0', '0', '0', '0', |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
286 '0', '0', '0', '0', 'p', '+', '0', ' ', '3', '3', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
287 0 |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
288 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
289 static const uint32_t expected2[] = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
290 { '0', 'x', '3', '.', '8', '0', '0', '0', '0', '0', |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
291 '0', '0', '0', '0', 'p', '-', '1', ' ', '3', '3', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
292 0 |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
293 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
294 static const uint32_t expected3[] = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
295 { '0', 'x', '7', '.', '0', '0', '0', '0', '0', '0', |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
296 '0', '0', '0', '0', 'p', '-', '2', ' ', '3', '3', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
297 0 |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
298 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
299 static const uint32_t expected4[] = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
300 { '0', 'x', 'e', '.', '0', '0', '0', '0', '0', '0', |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
301 '0', '0', '0', '0', 'p', '-', '3', ' ', '3', '3', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
302 0 |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
303 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
304 ASSERT (result != NULL); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
305 ASSERT (u32_strcmp (result, expected1) == 0 |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
306 || u32_strcmp (result, expected2) == 0 |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
307 || u32_strcmp (result, expected3) == 0 |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
308 || u32_strcmp (result, expected4) == 0); |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
309 free (result); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
310 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
311 |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
312 { /* Large precision. */ |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
313 uint32_t *result = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
314 my_xasprintf ("%.50a %d", 1.75, 33, 44, 55); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
315 static const uint32_t expected1[] = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
316 { '0', 'x', '1', '.', 'c', '0', '0', '0', '0', '0', |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
317 '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
318 '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
319 '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
320 '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
321 '0', '0', '0', '0', 'p', '+', '0', ' ', '3', '3', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
322 0 |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
323 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
324 static const uint32_t expected2[] = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
325 { '0', 'x', '3', '.', '8', '0', '0', '0', '0', '0', |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
326 '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
327 '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
328 '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
329 '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
330 '0', '0', '0', '0', 'p', '-', '1', ' ', '3', '3', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
331 0 |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
332 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
333 static const uint32_t expected3[] = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
334 { '0', 'x', '7', '.', '0', '0', '0', '0', '0', '0', |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
335 '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
336 '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
337 '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
338 '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
339 '0', '0', '0', '0', 'p', '-', '2', ' ', '3', '3', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
340 0 |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
341 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
342 static const uint32_t expected4[] = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
343 { '0', 'x', 'e', '.', '0', '0', '0', '0', '0', '0', |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
344 '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
345 '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
346 '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
347 '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
348 '0', '0', '0', '0', 'p', '-', '3', ' ', '3', '3', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
349 0 |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
350 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
351 ASSERT (result != NULL); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
352 ASSERT (u32_strcmp (result, expected1) == 0 |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
353 || u32_strcmp (result, expected2) == 0 |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
354 || u32_strcmp (result, expected3) == 0 |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
355 || u32_strcmp (result, expected4) == 0); |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
356 free (result); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
357 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
358 |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
359 { /* A positive number. */ |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
360 uint32_t *result = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
361 my_xasprintf ("%La %d", 3.1416015625L, 33, 44, 55); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
362 static const uint32_t expected1[] = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
363 { '0', 'x', '1', '.', '9', '2', '2', 'p', '+', '1', |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
364 ' ', '3', '3', 0 |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
365 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
366 static const uint32_t expected2[] = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
367 { '0', 'x', '3', '.', '2', '4', '4', 'p', '+', '0', |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
368 ' ', '3', '3', 0 |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
369 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
370 static const uint32_t expected3[] = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
371 { '0', 'x', '6', '.', '4', '8', '8', 'p', '-', '1', |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
372 ' ', '3', '3', 0 |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
373 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
374 static const uint32_t expected4[] = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
375 { '0', 'x', 'c', '.', '9', '1', 'p', '-', '2', ' ', |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
376 '3', '3', 0 |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
377 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
378 ASSERT (result != NULL); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
379 ASSERT (u32_strcmp (result, expected1) == 0 |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
380 || u32_strcmp (result, expected2) == 0 |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
381 || u32_strcmp (result, expected3) == 0 |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
382 || u32_strcmp (result, expected4) == 0); |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
383 free (result); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
384 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
385 |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
386 { /* Width. */ |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
387 uint32_t *result = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
388 my_xasprintf ("%10La %d", 1.75L, 33, 44, 55); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
389 static const uint32_t expected1[] = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
390 { ' ', ' ', '0', 'x', '1', '.', 'c', 'p', '+', '0', ' ', '3', '3', 0 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
391 static const uint32_t expected2[] = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
392 { ' ', ' ', '0', 'x', '3', '.', '8', 'p', '-', '1', ' ', '3', '3', 0 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
393 static const uint32_t expected3[] = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
394 { ' ', ' ', ' ', ' ', '0', 'x', '7', 'p', '-', '2', ' ', '3', '3', 0 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
395 static const uint32_t expected4[] = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
396 { ' ', ' ', ' ', ' ', '0', 'x', 'e', 'p', '-', '3', ' ', '3', '3', 0 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
397 ASSERT (result != NULL); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
398 ASSERT (u32_strcmp (result, expected1) == 0 |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
399 || u32_strcmp (result, expected2) == 0 |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
400 || u32_strcmp (result, expected3) == 0 |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
401 || u32_strcmp (result, expected4) == 0); |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
402 free (result); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
403 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
404 |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
405 { /* Small precision. */ |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
406 uint32_t *result = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
407 my_xasprintf ("%.10La %d", 1.75L, 33, 44, 55); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
408 static const uint32_t expected1[] = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
409 { '0', 'x', '1', '.', 'c', '0', '0', '0', '0', '0', |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
410 '0', '0', '0', '0', 'p', '+', '0', ' ', '3', '3', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
411 0 |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
412 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
413 static const uint32_t expected2[] = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
414 { '0', 'x', '3', '.', '8', '0', '0', '0', '0', '0', |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
415 '0', '0', '0', '0', 'p', '-', '1', ' ', '3', '3', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
416 0 |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
417 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
418 static const uint32_t expected3[] = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
419 { '0', 'x', '7', '.', '0', '0', '0', '0', '0', '0', |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
420 '0', '0', '0', '0', 'p', '-', '2', ' ', '3', '3', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
421 0 |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
422 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
423 static const uint32_t expected4[] = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
424 { '0', 'x', 'e', '.', '0', '0', '0', '0', '0', '0', |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
425 '0', '0', '0', '0', 'p', '-', '3', ' ', '3', '3', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
426 0 |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
427 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
428 ASSERT (result != NULL); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
429 ASSERT (u32_strcmp (result, expected1) == 0 |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
430 || u32_strcmp (result, expected2) == 0 |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
431 || u32_strcmp (result, expected3) == 0 |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
432 || u32_strcmp (result, expected4) == 0); |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
433 free (result); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
434 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
435 |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
436 { /* Large precision. */ |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
437 uint32_t *result = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
438 my_xasprintf ("%.50La %d", 1.75L, 33, 44, 55); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
439 static const uint32_t expected1[] = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
440 { '0', 'x', '1', '.', 'c', '0', '0', '0', '0', '0', |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
441 '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
442 '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
443 '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
444 '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
445 '0', '0', '0', '0', 'p', '+', '0', ' ', '3', '3', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
446 0 |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
447 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
448 static const uint32_t expected2[] = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
449 { '0', 'x', '3', '.', '8', '0', '0', '0', '0', '0', |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
450 '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
451 '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
452 '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
453 '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
454 '0', '0', '0', '0', 'p', '-', '1', ' ', '3', '3', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
455 0 |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
456 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
457 static const uint32_t expected3[] = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
458 { '0', 'x', '7', '.', '0', '0', '0', '0', '0', '0', |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
459 '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
460 '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
461 '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
462 '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
463 '0', '0', '0', '0', 'p', '-', '2', ' ', '3', '3', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
464 0 |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
465 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
466 static const uint32_t expected4[] = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
467 { '0', 'x', 'e', '.', '0', '0', '0', '0', '0', '0', |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
468 '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
469 '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
470 '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
471 '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
472 '0', '0', '0', '0', 'p', '-', '3', ' ', '3', '3', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
473 0 |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
474 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
475 ASSERT (result != NULL); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
476 ASSERT (u32_strcmp (result, expected1) == 0 |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
477 || u32_strcmp (result, expected2) == 0 |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
478 || u32_strcmp (result, expected3) == 0 |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
479 || u32_strcmp (result, expected4) == 0); |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
480 free (result); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
481 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
482 |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
483 /* Test the support of the %f format directive. */ |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
484 |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
485 { /* A positive number. */ |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
486 uint32_t *result = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
487 my_xasprintf ("%f %d", 12.75, 33, 44, 55); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
488 static const uint32_t expected[] = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
489 { '1', '2', '.', '7', '5', '0', '0', '0', '0', ' ', '3', '3', 0 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
490 ASSERT (result != NULL); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
491 ASSERT (u32_strcmp (result, expected) == 0); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
492 free (result); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
493 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
494 |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
495 { /* Width. */ |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
496 uint32_t *result = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
497 my_xasprintf ("%10f %d", 1.75, 33, 44, 55); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
498 static const uint32_t expected[] = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
499 { ' ', ' ', '1', '.', '7', '5', '0', '0', '0', '0', ' ', '3', '3', 0 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
500 ASSERT (result != NULL); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
501 ASSERT (u32_strcmp (result, expected) == 0); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
502 free (result); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
503 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
504 |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
505 { /* Precision. */ |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
506 uint32_t *result = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
507 my_xasprintf ("%.f %d", 1234.0, 33, 44, 55); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
508 static const uint32_t expected[] = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
509 { '1', '2', '3', '4', ' ', '3', '3', 0 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
510 ASSERT (result != NULL); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
511 ASSERT (u32_strcmp (result, expected) == 0); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
512 free (result); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
513 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
514 |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
515 { /* A positive number. */ |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
516 uint32_t *result = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
517 my_xasprintf ("%Lf %d", 12.75L, 33, 44, 55); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
518 static const uint32_t expected[] = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
519 { '1', '2', '.', '7', '5', '0', '0', '0', '0', ' ', '3', '3', 0 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
520 ASSERT (result != NULL); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
521 ASSERT (u32_strcmp (result, expected) == 0); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
522 free (result); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
523 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
524 |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
525 { /* Width. */ |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
526 uint32_t *result = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
527 my_xasprintf ("%10Lf %d", 1.75L, 33, 44, 55); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
528 static const uint32_t expected[] = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
529 { ' ', ' ', '1', '.', '7', '5', '0', '0', '0', '0', ' ', '3', '3', 0 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
530 ASSERT (result != NULL); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
531 ASSERT (u32_strcmp (result, expected) == 0); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
532 free (result); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
533 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
534 |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
535 { /* Precision. */ |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
536 uint32_t *result = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
537 my_xasprintf ("%.Lf %d", 1234.0L, 33, 44, 55); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
538 static const uint32_t expected[] = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
539 { '1', '2', '3', '4', ' ', '3', '3', 0 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
540 ASSERT (result != NULL); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
541 ASSERT (u32_strcmp (result, expected) == 0); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
542 free (result); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
543 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
544 |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
545 /* Test the support of the %F format directive. */ |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
546 |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
547 { /* A positive number. */ |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
548 uint32_t *result = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
549 my_xasprintf ("%F %d", 12.75, 33, 44, 55); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
550 static const uint32_t expected[] = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
551 { '1', '2', '.', '7', '5', '0', '0', '0', '0', ' ', '3', '3', 0 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
552 ASSERT (result != NULL); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
553 ASSERT (u32_strcmp (result, expected) == 0); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
554 free (result); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
555 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
556 |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
557 { /* Precision. */ |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
558 uint32_t *result = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
559 my_xasprintf ("%.F %d", 1234.0, 33, 44, 55); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
560 static const uint32_t expected[] = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
561 { '1', '2', '3', '4', ' ', '3', '3', 0 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
562 ASSERT (result != NULL); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
563 ASSERT (u32_strcmp (result, expected) == 0); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
564 free (result); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
565 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
566 |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
567 { /* A positive number. */ |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
568 uint32_t *result = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
569 my_xasprintf ("%LF %d", 12.75L, 33, 44, 55); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
570 static const uint32_t expected[] = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
571 { '1', '2', '.', '7', '5', '0', '0', '0', '0', ' ', '3', '3', 0 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
572 ASSERT (result != NULL); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
573 ASSERT (u32_strcmp (result, expected) == 0); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
574 free (result); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
575 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
576 |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
577 { /* Precision. */ |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
578 uint32_t *result = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
579 my_xasprintf ("%.LF %d", 1234.0L, 33, 44, 55); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
580 static const uint32_t expected[] = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
581 { '1', '2', '3', '4', ' ', '3', '3', 0 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
582 ASSERT (result != NULL); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
583 ASSERT (u32_strcmp (result, expected) == 0); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
584 free (result); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
585 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
586 |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
587 /* Test the support of the %e format directive. */ |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
588 |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
589 { /* A positive number. */ |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
590 uint32_t *result = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
591 my_xasprintf ("%e %d", 12.75, 33, 44, 55); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
592 static const uint32_t expected1[] = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
593 { '1', '.', '2', '7', '5', '0', '0', '0', 'e', '+', |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
594 '0', '1', ' ', '3', '3', 0 |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
595 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
596 static const uint32_t expected2[] = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
597 { '1', '.', '2', '7', '5', '0', '0', '0', 'e', '+', |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
598 '0', '0', '1', ' ', '3', '3', 0 |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
599 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
600 ASSERT (result != NULL); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
601 ASSERT (u32_strcmp (result, expected1) == 0 |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
602 || u32_strcmp (result, expected2) == 0); |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
603 free (result); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
604 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
605 |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
606 { /* Width. */ |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
607 uint32_t *result = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
608 my_xasprintf ("%15e %d", 1.75, 33, 44, 55); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
609 static const uint32_t expected1[] = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
610 { ' ', ' ', ' ', '1', '.', '7', '5', '0', '0', '0', |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
611 '0', 'e', '+', '0', '0', ' ', '3', '3', 0 |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
612 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
613 static const uint32_t expected2[] = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
614 { ' ', ' ', '1', '.', '7', '5', '0', '0', '0', '0', |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
615 'e', '+', '0', '0', '0', ' ', '3', '3', 0 |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
616 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
617 ASSERT (result != NULL); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
618 ASSERT (u32_strcmp (result, expected1) == 0 |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
619 || u32_strcmp (result, expected2) == 0); |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
620 free (result); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
621 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
622 |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
623 { /* Precision. */ |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
624 uint32_t *result = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
625 my_xasprintf ("%.e %d", 1234.0, 33, 44, 55); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
626 static const uint32_t expected1[] = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
627 { '1', 'e', '+', '0', '3', ' ', '3', '3', 0 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
628 static const uint32_t expected2[] = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
629 { '1', 'e', '+', '0', '0', '3', ' ', '3', '3', 0 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
630 ASSERT (result != NULL); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
631 ASSERT (u32_strcmp (result, expected1) == 0 |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
632 || u32_strcmp (result, expected2) == 0); |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
633 free (result); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
634 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
635 |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
636 { /* A positive number. */ |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
637 uint32_t *result = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
638 my_xasprintf ("%Le %d", 12.75L, 33, 44, 55); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
639 static const uint32_t expected[] = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
640 { '1', '.', '2', '7', '5', '0', '0', '0', 'e', '+', |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
641 '0', '1', ' ', '3', '3', 0 |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
642 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
643 ASSERT (result != NULL); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
644 ASSERT (u32_strcmp (result, expected) == 0); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
645 free (result); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
646 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
647 |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
648 { /* Width. */ |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
649 uint32_t *result = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
650 my_xasprintf ("%15Le %d", 1.75L, 33, 44, 55); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
651 static const uint32_t expected[] = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
652 { ' ', ' ', ' ', '1', '.', '7', '5', '0', '0', '0', |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
653 '0', 'e', '+', '0', '0', ' ', '3', '3', 0 |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
654 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
655 ASSERT (result != NULL); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
656 ASSERT (u32_strcmp (result, expected) == 0); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
657 free (result); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
658 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
659 |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
660 { /* Precision. */ |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
661 uint32_t *result = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
662 my_xasprintf ("%.Le %d", 1234.0L, 33, 44, 55); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
663 static const uint32_t expected[] = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
664 { '1', 'e', '+', '0', '3', ' ', '3', '3', 0 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
665 ASSERT (result != NULL); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
666 ASSERT (u32_strcmp (result, expected) == 0); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
667 free (result); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
668 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
669 |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
670 /* Test the support of the %g format directive. */ |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
671 |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
672 { /* A positive number. */ |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
673 uint32_t *result = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
674 my_xasprintf ("%g %d", 12.75, 33, 44, 55); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
675 static const uint32_t expected[] = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
676 { '1', '2', '.', '7', '5', ' ', '3', '3', 0 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
677 ASSERT (result != NULL); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
678 ASSERT (u32_strcmp (result, expected) == 0); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
679 free (result); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
680 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
681 |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
682 { /* Width. */ |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
683 uint32_t *result = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
684 my_xasprintf ("%10g %d", 1.75, 33, 44, 55); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
685 static const uint32_t expected[] = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
686 { ' ', ' ', ' ', ' ', ' ', ' ', '1', '.', '7', '5', ' ', '3', '3', 0 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
687 ASSERT (result != NULL); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
688 ASSERT (u32_strcmp (result, expected) == 0); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
689 free (result); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
690 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
691 |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
692 { /* Precision. */ |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
693 uint32_t *result = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
694 my_xasprintf ("%.g %d", 1234.0, 33, 44, 55); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
695 static const uint32_t expected1[] = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
696 { '1', 'e', '+', '0', '3', ' ', '3', '3', 0 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
697 static const uint32_t expected2[] = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
698 { '1', 'e', '+', '0', '0', '3', ' ', '3', '3', 0 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
699 ASSERT (result != NULL); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
700 ASSERT (u32_strcmp (result, expected1) == 0 |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
701 || u32_strcmp (result, expected2) == 0); |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
702 free (result); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
703 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
704 |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
705 { /* A positive number. */ |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
706 uint32_t *result = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
707 my_xasprintf ("%Lg %d", 12.75L, 33, 44, 55); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
708 static const uint32_t expected[] = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
709 { '1', '2', '.', '7', '5', ' ', '3', '3', 0 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
710 ASSERT (result != NULL); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
711 ASSERT (u32_strcmp (result, expected) == 0); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
712 free (result); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
713 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
714 |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
715 { /* Width. */ |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
716 uint32_t *result = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
717 my_xasprintf ("%10Lg %d", 1.75L, 33, 44, 55); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
718 static const uint32_t expected[] = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
719 { ' ', ' ', ' ', ' ', ' ', ' ', '1', '.', '7', '5', ' ', '3', '3', 0 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
720 ASSERT (result != NULL); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
721 ASSERT (u32_strcmp (result, expected) == 0); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
722 free (result); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
723 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
724 |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
725 { /* Precision. */ |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
726 uint32_t *result = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
727 my_xasprintf ("%.Lg %d", 1234.0L, 33, 44, 55); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
728 static const uint32_t expected[] = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
729 { '1', 'e', '+', '0', '3', ' ', '3', '3', 0 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
730 ASSERT (result != NULL); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
731 ASSERT (u32_strcmp (result, expected) == 0); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
732 free (result); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
733 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
734 |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
735 /* Test the support of the %n format directive. */ |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
736 |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
737 { |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
738 int count = -1; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
739 uint32_t *result = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
740 my_xasprintf ("%d %n", 123, &count, 33, 44, 55); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
741 static const uint32_t expected[] = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
742 { '1', '2', '3', ' ', 0 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
743 ASSERT (result != NULL); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
744 ASSERT (u32_strcmp (result, expected) == 0); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
745 ASSERT (count == 4); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
746 free (result); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
747 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
748 |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
749 /* Test the support of the POSIX/XSI format strings with positions. */ |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
750 |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
751 { |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
752 uint32_t *result = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
753 my_xasprintf ("%2$d %1$d", 33, 55); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
754 static const uint32_t expected[] = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
755 { '5', '5', ' ', '3', '3', 0 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
756 ASSERT (result != NULL); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
757 ASSERT (u32_strcmp (result, expected) == 0); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
758 free (result); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
759 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
760 |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
761 /* Test the support of the grouping flag. */ |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
762 |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
763 { |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
764 uint32_t *result = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
765 my_xasprintf ("%'d %d", 1234567, 99); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
766 ASSERT (result != NULL); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
767 ASSERT (result[u32_strlen (result) - 1] == '9'); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
768 free (result); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
769 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
770 |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
771 /* Test the support of the 'U' conversion specifier for Unicode strings. */ |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
772 |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
773 { |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
774 static const uint8_t unicode_string[] = "Rafa\305\202 Maszkowski"; /* Rafał Maszkowski */ |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
775 { |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
776 uint32_t *result = |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
777 my_xasprintf ("%U %d", unicode_string, 33, 44, 55); |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
778 static const uint32_t expected[] = |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
779 { 'R', 'a', 'f', 'a', 0x0142, ' ', 'M', 'a', 's', 'z', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
780 'k', 'o', 'w', 's', 'k', 'i', ' ', '3', '3', 0 |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
781 }; |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
782 ASSERT (result != NULL); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
783 ASSERT (u32_strcmp (result, expected) == 0); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
784 free (result); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
785 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
786 { /* Width. */ |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
787 uint32_t *result = |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
788 my_xasprintf ("%20U %d", unicode_string, 33, 44, 55); |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
789 static const uint32_t expected[] = |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
790 { ' ', ' ', ' ', ' ', 'R', 'a', 'f', 'a', 0x0142, ' ', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
791 'M', 'a', 's', 'z', 'k', 'o', 'w', 's', 'k', 'i', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
792 ' ', '3', '3', 0 |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
793 }; |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
794 ASSERT (result != NULL); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
795 ASSERT (u32_strcmp (result, expected) == 0); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
796 free (result); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
797 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
798 { /* FLAG_LEFT. */ |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
799 uint32_t *result = |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
800 my_xasprintf ("%-20U %d", unicode_string, 33, 44, 55); |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
801 static const uint32_t expected[] = |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
802 { 'R', 'a', 'f', 'a', 0x0142, ' ', 'M', 'a', 's', 'z', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
803 'k', 'o', 'w', 's', 'k', 'i', ' ', ' ', ' ', ' ', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
804 ' ', '3', '3', 0 |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
805 }; |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
806 ASSERT (result != NULL); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
807 ASSERT (u32_strcmp (result, expected) == 0); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
808 free (result); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
809 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
810 { /* FLAG_ZERO: no effect. */ |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
811 uint32_t *result = |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
812 my_xasprintf ("%020U %d", unicode_string, 33, 44, 55); |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
813 static const uint32_t expected[] = |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
814 { ' ', ' ', ' ', ' ', 'R', 'a', 'f', 'a', 0x0142, ' ', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
815 'M', 'a', 's', 'z', 'k', 'o', 'w', 's', 'k', 'i', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
816 ' ', '3', '3', 0 |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
817 }; |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
818 ASSERT (result != NULL); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
819 ASSERT (u32_strcmp (result, expected) == 0); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
820 free (result); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
821 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
822 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
823 |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
824 { |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
825 static const uint16_t unicode_string[] = /* Rafał Maszkowski */ |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
826 { |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
827 'R', 'a', 'f', 'a', 0x0142, ' ', 'M', 'a', 's', 'z', 'k', 'o', 'w', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
828 's', 'k', 'i', 0 |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
829 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
830 { |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
831 uint32_t *result = |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
832 my_xasprintf ("%lU %d", unicode_string, 33, 44, 55); |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
833 static const uint32_t expected[] = |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
834 { 'R', 'a', 'f', 'a', 0x0142, ' ', 'M', 'a', 's', 'z', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
835 'k', 'o', 'w', 's', 'k', 'i', ' ', '3', '3', 0 |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
836 }; |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
837 ASSERT (result != NULL); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
838 ASSERT (u32_strcmp (result, expected) == 0); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
839 free (result); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
840 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
841 { /* Width. */ |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
842 uint32_t *result = |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
843 my_xasprintf ("%20lU %d", unicode_string, 33, 44, 55); |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
844 static const uint32_t expected[] = |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
845 { ' ', ' ', ' ', ' ', 'R', 'a', 'f', 'a', 0x0142, ' ', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
846 'M', 'a', 's', 'z', 'k', 'o', 'w', 's', 'k', 'i', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
847 ' ', '3', '3', 0 |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
848 }; |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
849 ASSERT (result != NULL); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
850 ASSERT (u32_strcmp (result, expected) == 0); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
851 free (result); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
852 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
853 { /* FLAG_LEFT. */ |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
854 uint32_t *result = |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
855 my_xasprintf ("%-20lU %d", unicode_string, 33, 44, 55); |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
856 static const uint32_t expected[] = |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
857 { 'R', 'a', 'f', 'a', 0x0142, ' ', 'M', 'a', 's', 'z', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
858 'k', 'o', 'w', 's', 'k', 'i', ' ', ' ', ' ', ' ', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
859 ' ', '3', '3', 0 |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
860 }; |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
861 ASSERT (result != NULL); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
862 ASSERT (u32_strcmp (result, expected) == 0); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
863 free (result); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
864 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
865 { /* FLAG_ZERO: no effect. */ |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
866 uint32_t *result = |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
867 my_xasprintf ("%020lU %d", unicode_string, 33, 44, 55); |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
868 static const uint32_t expected[] = |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
869 { ' ', ' ', ' ', ' ', 'R', 'a', 'f', 'a', 0x0142, ' ', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
870 'M', 'a', 's', 'z', 'k', 'o', 'w', 's', 'k', 'i', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
871 ' ', '3', '3', 0 |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
872 }; |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
873 ASSERT (result != NULL); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
874 ASSERT (u32_strcmp (result, expected) == 0); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
875 free (result); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
876 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
877 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
878 |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
879 { |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
880 static const uint32_t unicode_string[] = /* Rafał Maszkowski */ |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
881 { |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
882 'R', 'a', 'f', 'a', 0x0142, ' ', 'M', 'a', 's', 'z', 'k', 'o', 'w', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
883 's', 'k', 'i', 0 |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
884 }; |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
885 { |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
886 uint32_t *result = |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
887 my_xasprintf ("%llU %d", unicode_string, 33, 44, 55); |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
888 static const uint32_t expected[] = |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
889 { 'R', 'a', 'f', 'a', 0x0142, ' ', 'M', 'a', 's', 'z', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
890 'k', 'o', 'w', 's', 'k', 'i', ' ', '3', '3', 0 |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
891 }; |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
892 ASSERT (result != NULL); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
893 ASSERT (u32_strcmp (result, expected) == 0); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
894 free (result); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
895 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
896 { /* Width. */ |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
897 uint32_t *result = |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
898 my_xasprintf ("%20llU %d", unicode_string, 33, 44, 55); |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
899 static const uint32_t expected[] = |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
900 { ' ', ' ', ' ', ' ', 'R', 'a', 'f', 'a', 0x0142, ' ', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
901 'M', 'a', 's', 'z', 'k', 'o', 'w', 's', 'k', 'i', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
902 ' ', '3', '3', 0 |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
903 }; |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
904 ASSERT (result != NULL); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
905 ASSERT (u32_strcmp (result, expected) == 0); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
906 free (result); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
907 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
908 { /* FLAG_LEFT. */ |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
909 uint32_t *result = |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
910 my_xasprintf ("%-20llU %d", unicode_string, 33, 44, 55); |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
911 static const uint32_t expected[] = |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
912 { 'R', 'a', 'f', 'a', 0x0142, ' ', 'M', 'a', 's', 'z', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
913 'k', 'o', 'w', 's', 'k', 'i', ' ', ' ', ' ', ' ', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
914 ' ', '3', '3', 0 |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
915 }; |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
916 ASSERT (result != NULL); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
917 ASSERT (u32_strcmp (result, expected) == 0); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
918 free (result); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
919 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
920 { /* FLAG_ZERO: no effect. */ |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
921 uint32_t *result = |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
922 my_xasprintf ("%020llU %d", unicode_string, 33, 44, 55); |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
923 static const uint32_t expected[] = |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
924 { ' ', ' ', ' ', ' ', 'R', 'a', 'f', 'a', 0x0142, ' ', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
925 'M', 'a', 's', 'z', 'k', 'o', 'w', 's', 'k', 'i', |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
926 ' ', '3', '3', 0 |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
927 }; |
9030
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
928 ASSERT (result != NULL); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
929 ASSERT (u32_strcmp (result, expected) == 0); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
930 free (result); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
931 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
932 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
933 |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
934 /* Test non-ASCII characters in the format string. */ |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
935 |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
936 { |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
937 uint32_t *result = |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
938 my_xasprintf ("\304rger", 33, 44, 55); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
939 ASSERT (result == NULL && errno == EINVAL); |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
940 } |
870029929d86
Formatted output functions for Unicode strings.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
941 } |