Skip to content

Commit

Permalink
suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
UdjinM6 authored and PastaPastaPasta committed Feb 24, 2025
1 parent 56ac184 commit 0cf8a46
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/test/bls_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <random.h>
#include <streams.h>
#include <util/irange.h>
#include <util/strencodings.h>

#include <boost/test/unit_test.hpp>

Expand Down Expand Up @@ -501,14 +502,7 @@ class DummyBLS
void Reset() { data.fill(0); }

// Produce a string representation.
std::string ToString(bool /*legacy*/) const
{
std::ostringstream oss;
for (auto b : data) {
oss << std::setfill('0') << std::setw(2) << std::hex << static_cast<int>(b);
}
return oss.str();
}
std::string ToString(bool /*legacy*/) const { return HexStr(data); }

// Equality operator.
bool operator==(const DummyBLS& other) const { return data == other.data; }
Expand All @@ -532,7 +526,7 @@ BOOST_AUTO_TEST_CASE(test_non_default_vs_default)
LazyDummyBLS lazy_default;
LazyDummyBLS lazy_set;
DummyBLS obj;
obj.data = {1, 2, 3, 4}; // nonzero data makes the object valid
obj.data = {1, 0, 0, 0}; // nonzero data makes the object valid
lazy_set.Set(obj, false);
BOOST_CHECK(!(lazy_default == lazy_set));
BOOST_CHECK(lazy_default != lazy_set);
Expand Down Expand Up @@ -599,4 +593,4 @@ BOOST_AUTO_TEST_CASE(test_get_hash_consistency)
BOOST_CHECK(hash1 == hash2);
}

BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_SUITE_END()

0 comments on commit 0cf8a46

Please sign in to comment.