Skip to content

Commit 7060117

Browse files
committed
fix compiler warnings
1 parent 4a531d2 commit 7060117

1 file changed

Lines changed: 26 additions & 26 deletions

File tree

tests/unit/src/unicode.cpp

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -115,80 +115,80 @@ const tst::set set("unicode", [](tst::suite& suite) {
115115
},
116116
SL
117117
);
118-
tst::check_eq(ret[2], char(0xb5), SL);
119-
tst::check_eq(ret[3], char(0), SL);
118+
tst::check_eq(uint8_t(ret[2]), uint8_t(0xb5), SL);
119+
tst::check_eq(uint8_t(ret[3]), uint8_t(0), SL);
120120
});
121121

122122
suite.add("utf32_to_utf8_four_byte", []() {
123123
auto ret = utki::to_utf8(0x26218); // 𦈘
124124
tst::check_eq(
125-
ret[0],
126-
char(0xf0),
125+
uint8_t(ret[0]),
126+
uint8_t(0xf0),
127127
[&](auto& o) {
128128
o << "ret[0] = 0x" << std::hex << (unsigned(ret[0]) & 0xff);
129129
},
130130
SL
131131
);
132132
tst::check_eq(
133-
ret[1],
134-
char(0xa6),
133+
uint8_t(ret[1]),
134+
uint8_t(0xa6),
135135
[&](auto& o) {
136136
o << "ret[1] = 0x" << std::hex << (unsigned(ret[1]) & 0xff);
137137
},
138138
SL
139139
);
140-
tst::check_eq(ret[2], char(0x88), SL);
141-
tst::check_eq(ret[3], char(0x98), SL);
142-
tst::check_eq(ret[4], char(0), SL);
140+
tst::check_eq(uint8_t(ret[2]), uint8_t(0x88), SL);
141+
tst::check_eq(uint8_t(ret[3]), uint8_t(0x98), SL);
142+
tst::check_eq(uint8_t(ret[4]), uint8_t(0), SL);
143143
});
144144

145145
suite.add("utf32_to_utf8_five_byte", []() {
146146
auto ret = utki::to_utf8(0x3FFFFFF);
147147
tst::check_eq(
148-
ret[0],
149-
char(0xfb),
148+
uint8_t(ret[0]),
149+
uint8_t(0xfb),
150150
[&](auto& o) {
151151
o << "ret[0] = 0x" << std::hex << (unsigned(ret[0]) & 0xff);
152152
},
153153
SL
154154
);
155155
tst::check_eq(
156-
ret[1],
157-
char(0xbf),
156+
uint8_t(ret[1]),
157+
uint8_t(0xbf),
158158
[&](auto& o) {
159159
o << "ret[1] = 0x" << std::hex << (unsigned(ret[1]) & 0xff);
160160
},
161161
SL
162162
);
163-
tst::check_eq(ret[2], char(0xbf), SL);
164-
tst::check_eq(ret[3], char(0xbf), SL);
165-
tst::check_eq(ret[4], char(0xbf), SL);
166-
tst::check_eq(ret[5], char(0), SL);
163+
tst::check_eq(uint8_t(ret[2]), uint8_t(0xbf), SL);
164+
tst::check_eq(uint8_t(ret[3]), uint8_t(0xbf), SL);
165+
tst::check_eq(uint8_t(ret[4]), uint8_t(0xbf), SL);
166+
tst::check_eq(uint8_t(ret[5]), uint8_t(0), SL);
167167
});
168168

169169
suite.add("utf32_to_utf8_six_byte", []() {
170170
auto ret = utki::to_utf8(0x7FFFFFFF);
171171
tst::check_eq(
172-
ret[0],
173-
char(0xfd),
172+
uint8_t(ret[0]),
173+
uint8_t(0xfd),
174174
[&](auto& o) {
175175
o << "ret[0] = 0x" << std::hex << (unsigned(ret[0]) & 0xff);
176176
},
177177
SL
178178
);
179179
tst::check_eq(
180-
ret[1],
181-
char(0xbf),
180+
uint8_t(ret[1]),
181+
uint8_t(0xbf),
182182
[&](auto& o) {
183183
o << "ret[1] = 0x" << std::hex << (unsigned(ret[1]) & 0xff);
184184
},
185185
SL
186186
);
187-
tst::check_eq(ret[2], char(0xbf), SL);
188-
tst::check_eq(ret[3], char(0xbf), SL);
189-
tst::check_eq(ret[4], char(0xbf), SL);
190-
tst::check_eq(ret[5], char(0xbf), SL);
191-
tst::check_eq(ret[6], char(0), SL);
187+
tst::check_eq(uint8_t(ret[2]), uint8_t(0xbf), SL);
188+
tst::check_eq(uint8_t(ret[3]), uint8_t(0xbf), SL);
189+
tst::check_eq(uint8_t(ret[4]), uint8_t(0xbf), SL);
190+
tst::check_eq(uint8_t(ret[5]), uint8_t(0xbf), SL);
191+
tst::check_eq(uint8_t(ret[6]), uint8_t(0), SL);
192192
});
193193

194194
suite.add("utf32_to_utf8", []() {

0 commit comments

Comments
 (0)