File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -198,6 +198,24 @@ BOOST_AUTO_TEST_CASE(util_HexStr)
198
198
BOOST_CHECK_EQUAL (HexStr (in_s), out_exp);
199
199
BOOST_CHECK_EQUAL (HexStr (in_b), out_exp);
200
200
}
201
+
202
+ {
203
+ auto input = std::string ();
204
+ for (size_t i=0 ; i<256 ; ++i) {
205
+ input.push_back (static_cast <char >(i));
206
+ }
207
+
208
+ auto hex = HexStr (input);
209
+ BOOST_TEST_REQUIRE (hex.size () == 512 );
210
+ static constexpr auto hexmap = std::string_view (" 0123456789abcdef" );
211
+ for (size_t i = 0 ; i < 256 ; ++i) {
212
+ auto upper = hexmap.find (hex[i * 2 ]);
213
+ auto lower = hexmap.find (hex[i * 2 + 1 ]);
214
+ BOOST_TEST_REQUIRE (upper != std::string_view::npos);
215
+ BOOST_TEST_REQUIRE (lower != std::string_view::npos);
216
+ BOOST_TEST_REQUIRE (i == upper*16 + lower);
217
+ }
218
+ }
201
219
}
202
220
203
221
BOOST_AUTO_TEST_CASE (span_write_bytes)
You can’t perform that action at this time.
0 commit comments