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 "unistr.h"
22
23 #include "macros.h"
24
25 int
26 main ()
27 {
28 int ret;
29
30
31 {
32 static const uint8_t input[] = "";
33 ret = u8_strmblen (input);
34 ASSERT (ret == 0);
35 }
36
37
38 {
39 ucs4_t c;
40 uint8_t buf[2];
41
42 for (c = 1; c < 0x80; c++)
43 {
44 buf[0] = c;
45 buf[1] = 0;
46 ret = u8_strmblen (buf);
47 ASSERT (ret == 1);
48 }
49 }
50
51
52 {
53 static const uint8_t input[] = { 0xC3, 0x97, 0 };
54 ret = u8_strmblen (input);
55 ASSERT (ret == 2);
56 }
57
58
59 {
60 static const uint8_t input[] = { 0xE2, 0x82, 0xAC, 0 };
61 ret = u8_strmblen (input);
62 ASSERT (ret == 3);
63 }
64
65
66 {
67 static const uint8_t input[] = { 0xF4, 0x8F, 0xBF, 0xBD, 0 };
68 ret = u8_strmblen (input);
69 ASSERT (ret == 4);
70 }
71
72
73 {
74 static const uint8_t input[] = { 0xC1, 0 };
75 ret = u8_strmblen (input);
76 ASSERT (ret == -1);
77 }
78 {
79 static const uint8_t input[] = { 0xC3, 0 };
80 ret = u8_strmblen (input);
81 ASSERT (ret == -1);
82 }
83 {
84 static const uint8_t input[] = { 0xE2, 0 };
85 ret = u8_strmblen (input);
86 ASSERT (ret == -1);
87 }
88 {
89 static const uint8_t input[] = { 0xF4, 0 };
90 ret = u8_strmblen (input);
91 ASSERT (ret == -1);
92 }
93 {
94 static const uint8_t input[] = { 0xFE, 0 };
95 ret = u8_strmblen (input);
96 ASSERT (ret == -1);
97 }
98
99
100 {
101 static const uint8_t input[] = { 0xE0, 0x9F, 0 };
102 ret = u8_strmblen (input);
103 ASSERT (ret == -1);
104 }
105 {
106 static const uint8_t input[] = { 0xE2, 0x82, 0 };
107 ret = u8_strmblen (input);
108 ASSERT (ret == -1);
109 }
110 {
111 static const uint8_t input[] = { 0xE2, 0xD0, 0 };
112 ret = u8_strmblen (input);
113 ASSERT (ret == -1);
114 }
115 {
116 static const uint8_t input[] = { 0xF0, 0x8F, 0 };
117 ret = u8_strmblen (input);
118 ASSERT (ret == -1);
119 }
120 {
121 static const uint8_t input[] = { 0xF3, 0x8F, 0 };
122 ret = u8_strmblen (input);
123 ASSERT (ret == -1);
124 }
125 {
126 static const uint8_t input[] = { 0xF3, 0xD0, 0 };
127 ret = u8_strmblen (input);
128 ASSERT (ret == -1);
129 }
130
131
132 {
133 static const uint8_t input[] = { 0xF3, 0x8F, 0xBF, 0 };
134 ret = u8_strmblen (input);
135 ASSERT (ret == -1);
136 }
137 {
138 static const uint8_t input[] = { 0xF3, 0xD0, 0xBF, 0 };
139 ret = u8_strmblen (input);
140 ASSERT (ret == -1);
141 }
142 {
143 static const uint8_t input[] = { 0xF3, 0x8F, 0xD0, 0 };
144 ret = u8_strmblen (input);
145 ASSERT (ret == -1);
146 }
147
148 return 0;
149 }