This source file includes following definitions.
- main
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 #include <config.h>
20
21 #include "uninorm/decompose-internal.h"
22
23 #include "uninorm.h"
24 #include "macros.h"
25
26 int
27 main ()
28 {
29 ucs4_t decomposed[UC_DECOMPOSITION_MAX_LENGTH];
30 int ret;
31
32
33 ret = uc_compat_decomposition (0x0020, decomposed);
34 ASSERT (ret == -1);
35
36
37 ret = uc_compat_decomposition (0x00C4, decomposed);
38 ASSERT (ret == 2);
39 ASSERT (decomposed[0] == 0x0041);
40 ASSERT (decomposed[1] == 0x0308);
41
42
43 ret = uc_compat_decomposition (0x01DE, decomposed);
44 ASSERT (ret == 2);
45 ASSERT (decomposed[0] == 0x00C4);
46 ASSERT (decomposed[1] == 0x0304);
47
48
49 ret = uc_compat_decomposition (0x1FC1, decomposed);
50 ASSERT (ret == 2);
51 ASSERT (decomposed[0] == 0x00A8);
52 ASSERT (decomposed[1] == 0x0342);
53
54
55 ret = uc_compat_decomposition (0x2113, decomposed);
56 ASSERT (ret == 1);
57 ASSERT (decomposed[0] == 0x006C);
58
59
60 ret = uc_compat_decomposition (0x00A0, decomposed);
61 ASSERT (ret == 1);
62 ASSERT (decomposed[0] == 0x0020);
63
64
65 ret = uc_compat_decomposition (0xFB6C, decomposed);
66 ASSERT (ret == 1);
67 ASSERT (decomposed[0] == 0x06A4);
68
69
70 ret = uc_compat_decomposition (0xFB6D, decomposed);
71 ASSERT (ret == 1);
72 ASSERT (decomposed[0] == 0x06A4);
73
74
75 ret = uc_compat_decomposition (0xFB6B, decomposed);
76 ASSERT (ret == 1);
77 ASSERT (decomposed[0] == 0x06A4);
78
79
80 ret = uc_compat_decomposition (0xFB6A, decomposed);
81 ASSERT (ret == 1);
82 ASSERT (decomposed[0] == 0x06A4);
83
84
85 ret = uc_compat_decomposition (0x246E, decomposed);
86 ASSERT (ret == 2);
87 ASSERT (decomposed[0] == 0x0031);
88 ASSERT (decomposed[1] == 0x0035);
89
90
91 ret = uc_compat_decomposition (0x2122, decomposed);
92 ASSERT (ret == 2);
93 ASSERT (decomposed[0] == 0x0054);
94 ASSERT (decomposed[1] == 0x004D);
95
96
97 ret = uc_compat_decomposition (0x1D62, decomposed);
98 ASSERT (ret == 1);
99 ASSERT (decomposed[0] == 0x0069);
100
101
102 ret = uc_compat_decomposition (0xFE35, decomposed);
103 ASSERT (ret == 1);
104 ASSERT (decomposed[0] == 0x0028);
105
106
107 ret = uc_compat_decomposition (0xFF21, decomposed);
108 ASSERT (ret == 1);
109 ASSERT (decomposed[0] == 0x0041);
110
111
112 ret = uc_compat_decomposition (0xFF64, decomposed);
113 ASSERT (ret == 1);
114 ASSERT (decomposed[0] == 0x3001);
115
116
117 ret = uc_compat_decomposition (0xFE51, decomposed);
118 ASSERT (ret == 1);
119 ASSERT (decomposed[0] == 0x3001);
120
121
122 ret = uc_compat_decomposition (0x3392, decomposed);
123 ASSERT (ret == 3);
124 ASSERT (decomposed[0] == 0x004D);
125 ASSERT (decomposed[1] == 0x0048);
126 ASSERT (decomposed[2] == 0x007A);
127
128
129 ret = uc_compat_decomposition (0x215C, decomposed);
130 ASSERT (ret == 3);
131 ASSERT (decomposed[0] == 0x0033);
132 ASSERT (decomposed[1] == 0x2044);
133 ASSERT (decomposed[2] == 0x0038);
134
135
136 ret = uc_compat_decomposition (0x00B5, decomposed);
137 ASSERT (ret == 1);
138 ASSERT (decomposed[0] == 0x03BC);
139
140
141 ret = uc_compat_decomposition (0xFDFA, decomposed);
142 ASSERT (ret == 18);
143 ASSERT (decomposed[0] == 0x0635);
144 ASSERT (decomposed[1] == 0x0644);
145 ASSERT (decomposed[2] == 0x0649);
146 ASSERT (decomposed[3] == 0x0020);
147 ASSERT (decomposed[4] == 0x0627);
148 ASSERT (decomposed[5] == 0x0644);
149 ASSERT (decomposed[6] == 0x0644);
150 ASSERT (decomposed[7] == 0x0647);
151 ASSERT (decomposed[8] == 0x0020);
152 ASSERT (decomposed[9] == 0x0639);
153 ASSERT (decomposed[10] == 0x0644);
154 ASSERT (decomposed[11] == 0x064A);
155 ASSERT (decomposed[12] == 0x0647);
156 ASSERT (decomposed[13] == 0x0020);
157 ASSERT (decomposed[14] == 0x0648);
158 ASSERT (decomposed[15] == 0x0633);
159 ASSERT (decomposed[16] == 0x0644);
160 ASSERT (decomposed[17] == 0x0645);
161
162
163 ret = uc_compat_decomposition (0xAE00, decomposed);
164
165
166 #if 1
167 ASSERT (ret == 2);
168 ASSERT (decomposed[0] == 0xADF8);
169 ASSERT (decomposed[1] == 0x11AF);
170 #else
171 ASSERT (ret == 3);
172 ASSERT (decomposed[0] == 0x1100);
173 ASSERT (decomposed[1] == 0x1173);
174 ASSERT (decomposed[2] == 0x11AF);
175 #endif
176
177
178 ret = uc_compat_decomposition (0xADF8, decomposed);
179 ASSERT (ret == 2);
180 ASSERT (decomposed[0] == 0x1100);
181 ASSERT (decomposed[1] == 0x1173);
182
183 return 0;
184 }