88#include < random.h>
99#include < streams.h>
1010#include < util/irange.h>
11+ #include < util/strencodings.h>
1112
1213#include < boost/test/unit_test.hpp>
1314
@@ -501,14 +502,7 @@ class DummyBLS
501502 void Reset () { data.fill (0 ); }
502503
503504 // Produce a string representation.
504- std::string ToString (bool /* legacy*/ ) const
505- {
506- std::ostringstream oss;
507- for (auto b : data) {
508- oss << std::setfill (' 0' ) << std::setw (2 ) << std::hex << static_cast <int >(b);
509- }
510- return oss.str ();
511- }
505+ std::string ToString (bool /* legacy*/ ) const { return HexStr (data); }
512506
513507 // Equality operator.
514508 bool operator ==(const DummyBLS& other) const { return data == other.data ; }
@@ -532,7 +526,7 @@ BOOST_AUTO_TEST_CASE(test_non_default_vs_default)
532526 LazyDummyBLS lazy_default;
533527 LazyDummyBLS lazy_set;
534528 DummyBLS obj;
535- obj.data = {1 , 2 , 3 , 4 }; // nonzero data makes the object valid
529+ obj.data = {1 , 0 , 0 , 0 }; // nonzero data makes the object valid
536530 lazy_set.Set (obj, false );
537531 BOOST_CHECK (!(lazy_default == lazy_set));
538532 BOOST_CHECK (lazy_default != lazy_set);
@@ -599,4 +593,4 @@ BOOST_AUTO_TEST_CASE(test_get_hash_consistency)
599593 BOOST_CHECK (hash1 == hash2);
600594}
601595
602- BOOST_AUTO_TEST_SUITE_END ()
596+ BOOST_AUTO_TEST_SUITE_END ()
0 commit comments