diff options
author | MacroFake <falke.marco@gmail.com> | 2022-10-06 16:01:12 +0200 |
---|---|---|
committer | MacroFake <falke.marco@gmail.com> | 2022-10-06 16:01:17 +0200 |
commit | 73b61717a977fc9d23f1bae3f8620641a9dee1f3 (patch) | |
tree | ea1dd87fc89081b7256bb70d27480cca533cbab4 /src | |
parent | 292f652d53b72193a000cfd080dba4639ce02258 (diff) | |
parent | 97007e2b9b7a578315df2b1549cd6075130e8f05 (diff) | |
download | bitcoin-73b61717a977fc9d23f1bae3f8620641a9dee1f3.tar.xz |
Merge bitcoin/bitcoin#26272: test: Prevent UB in `minisketch_tests.cpp`
97007e2b9b7a578315df2b1549cd6075130e8f05 test: Prevent UB in `minisketch_tests.cpp` (Hennadii Stepanov)
Pull request description:
[`std::optional::operator*`](https://en.cppreference.com/w/cpp/utility/optional/operator*), which follows after the changed line, can cause UB.
This PR addresses https://github.com/bitcoin/bitcoin/issues/26262#issuecomment-1268855418
ACKs for top commit:
stickies-v:
ACK 97007e2b9b7a578315df2b1549cd6075130e8f05
Tree-SHA512: a7dde8dac0cbdfa362fa1158b4564eccff9405852612227d581690c9a34084b3467ae6d4c0269262688d75339dcea90aaa38fccbba9be92d2643c2113860f3d6
Diffstat (limited to 'src')
-rw-r--r-- | src/test/minisketch_tests.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/test/minisketch_tests.cpp b/src/test/minisketch_tests.cpp index 9c53ace633..81f2aad623 100644 --- a/src/test/minisketch_tests.cpp +++ b/src/test/minisketch_tests.cpp @@ -40,7 +40,7 @@ BOOST_AUTO_TEST_CASE(minisketch_test) Minisketch sketch_c = std::move(sketch_ar); sketch_c.Merge(sketch_br); auto dec = sketch_c.Decode(errors); - BOOST_CHECK(dec.has_value()); + BOOST_REQUIRE(dec.has_value()); auto sols = std::move(*dec); std::sort(sols.begin(), sols.end()); for (uint32_t i = 0; i < a_not_b; ++i) BOOST_CHECK_EQUAL(sols[i], start_a + i); |