8
8
#include < random.h>
9
9
#include < streams.h>
10
10
#include < util/irange.h>
11
+ #include < util/strencodings.h>
11
12
12
13
#include < boost/test/unit_test.hpp>
13
14
@@ -501,14 +502,7 @@ class DummyBLS
501
502
void Reset () { data.fill (0 ); }
502
503
503
504
// 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); }
512
506
513
507
// Equality operator.
514
508
bool operator ==(const DummyBLS& other) const { return data == other.data ; }
@@ -532,7 +526,7 @@ BOOST_AUTO_TEST_CASE(test_non_default_vs_default)
532
526
LazyDummyBLS lazy_default;
533
527
LazyDummyBLS lazy_set;
534
528
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
536
530
lazy_set.Set (obj, false );
537
531
BOOST_CHECK (!(lazy_default == lazy_set));
538
532
BOOST_CHECK (lazy_default != lazy_set);
@@ -599,4 +593,4 @@ BOOST_AUTO_TEST_CASE(test_get_hash_consistency)
599
593
BOOST_CHECK (hash1 == hash2);
600
594
}
601
595
602
- BOOST_AUTO_TEST_SUITE_END ()
596
+ BOOST_AUTO_TEST_SUITE_END ()
0 commit comments