@@ -162,14 +162,10 @@ BOOST_AUTO_TEST_CASE(streams_serializedata_xor)
162162{
163163 std::vector<std::byte> in;
164164 std::vector<char > expected_xor;
165- std::vector<unsigned char > key;
166165 CDataStream ds (in, 0 , 0 );
167166
168167 // Degenerate case
169-
170- key.push_back (' \x00 ' );
171- key.push_back (' \x00 ' );
172- ds.Xor (key);
168+ ds.Xor ({0x00 , 0x00 });
173169 BOOST_CHECK_EQUAL (
174170 std::string (expected_xor.begin (), expected_xor.end ()),
175171 ds.str ());
@@ -183,10 +179,8 @@ BOOST_AUTO_TEST_CASE(streams_serializedata_xor)
183179
184180 ds.clear ();
185181 ds.insert (ds.begin (), in.begin (), in.end ());
186- key.clear ();
187182
188- key.push_back (' \xff ' );
189- ds.Xor (key);
183+ ds.Xor ({0xff });
190184 BOOST_CHECK_EQUAL (
191185 std::string (expected_xor.begin (), expected_xor.end ()),
192186 ds.str ());
@@ -203,11 +197,7 @@ BOOST_AUTO_TEST_CASE(streams_serializedata_xor)
203197 ds.clear ();
204198 ds.insert (ds.begin (), in.begin (), in.end ());
205199
206- key.clear ();
207- key.push_back (' \xff ' );
208- key.push_back (' \x0f ' );
209-
210- ds.Xor (key);
200+ ds.Xor ({0xff , 0x0f });
211201 BOOST_CHECK_EQUAL (
212202 std::string (expected_xor.begin (), expected_xor.end ()),
213203 ds.str ());
@@ -421,7 +411,7 @@ BOOST_AUTO_TEST_CASE(streams_buffered_file_rand)
421411 size_t find = currentPos + InsecureRandRange (8 );
422412 if (find >= fileSize)
423413 find = fileSize - 1 ;
424- bf.FindByte (static_cast < char > (find));
414+ bf.FindByte (uint8_t (find));
425415 // The value at each offset is the offset.
426416 BOOST_CHECK_EQUAL (bf.GetPos (), find);
427417 currentPos = find;
0 commit comments