@@ -162,14 +162,10 @@ BOOST_AUTO_TEST_CASE(streams_serializedata_xor)
162
162
{
163
163
std::vector<std::byte> in;
164
164
std::vector<char > expected_xor;
165
- std::vector<unsigned char > key;
166
165
CDataStream ds (in, 0 , 0 );
167
166
168
167
// Degenerate case
169
-
170
- key.push_back (' \x00 ' );
171
- key.push_back (' \x00 ' );
172
- ds.Xor (key);
168
+ ds.Xor ({0x00 , 0x00 });
173
169
BOOST_CHECK_EQUAL (
174
170
std::string (expected_xor.begin (), expected_xor.end ()),
175
171
ds.str ());
@@ -183,10 +179,8 @@ BOOST_AUTO_TEST_CASE(streams_serializedata_xor)
183
179
184
180
ds.clear ();
185
181
ds.insert (ds.begin (), in.begin (), in.end ());
186
- key.clear ();
187
182
188
- key.push_back (' \xff ' );
189
- ds.Xor (key);
183
+ ds.Xor ({0xff });
190
184
BOOST_CHECK_EQUAL (
191
185
std::string (expected_xor.begin (), expected_xor.end ()),
192
186
ds.str ());
@@ -203,11 +197,7 @@ BOOST_AUTO_TEST_CASE(streams_serializedata_xor)
203
197
ds.clear ();
204
198
ds.insert (ds.begin (), in.begin (), in.end ());
205
199
206
- key.clear ();
207
- key.push_back (' \xff ' );
208
- key.push_back (' \x0f ' );
209
-
210
- ds.Xor (key);
200
+ ds.Xor ({0xff , 0x0f });
211
201
BOOST_CHECK_EQUAL (
212
202
std::string (expected_xor.begin (), expected_xor.end ()),
213
203
ds.str ());
@@ -421,7 +411,7 @@ BOOST_AUTO_TEST_CASE(streams_buffered_file_rand)
421
411
size_t find = currentPos + InsecureRandRange (8 );
422
412
if (find >= fileSize)
423
413
find = fileSize - 1 ;
424
- bf.FindByte (static_cast < char > (find));
414
+ bf.FindByte (uint8_t (find));
425
415
// The value at each offset is the offset.
426
416
BOOST_CHECK_EQUAL (bf.GetPos (), find);
427
417
currentPos = find;
0 commit comments