Skip to content

Commit c2dc952

Browse files
committed
Use BOOST_REQUIRE vs. BOOST_CHECK.
1 parent df87d9f commit c2dc952

3 files changed

Lines changed: 15 additions & 15 deletions

File tree

test/protocols/electrum/electrum_addresses.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -201,23 +201,23 @@ BOOST_AUTO_TEST_CASE(electrum__blockchain_address_get_history__confirmed_and_unc
201201
const auto& tx1 = history.at(0).as_object();
202202
REQUIRE_NO_THROW_TRUE(tx1.at("height").is_int64());
203203
REQUIRE_NO_THROW_TRUE(tx1.at("tx_hash").is_string());
204-
BOOST_CHECK(!tx1.contains("fee"));
204+
BOOST_REQUIRE(!tx1.contains("fee"));
205205
BOOST_REQUIRE_EQUAL(tx1.at("height").as_int64(), 10);
206206
BOOST_REQUIRE_EQUAL(tx1.at("tx_hash").as_string(), encode_hash(hash1));
207207

208208
const auto hash2 = test::bogus_block11.transactions_ptr()->at(0)->hash(false);
209209
const auto& tx2 = history.at(1).as_object();
210210
REQUIRE_NO_THROW_TRUE(tx2.at("height").is_int64());
211211
REQUIRE_NO_THROW_TRUE(tx2.at("tx_hash").is_string());
212-
BOOST_CHECK_EQUAL(tx2.at("fee").as_int64(), floored_subtract(5'000'000'000 + 5'000'000'000, 0x10 + 0x11 + 0x12 + 0x13 + 0x14));
212+
BOOST_REQUIRE_EQUAL(tx2.at("fee").as_int64(), floored_subtract(5'000'000'000 + 5'000'000'000, 0x10 + 0x11 + 0x12 + 0x13 + 0x14));
213213
BOOST_REQUIRE_EQUAL(tx2.at("height").as_int64(), 0); // rooted
214214
BOOST_REQUIRE_EQUAL(tx2.at("tx_hash").as_string(), encode_hash(hash2));
215215

216216
const auto hash3 = test::bogus_block12.transactions_ptr()->at(0)->hash(false);
217217
const auto& tx3 = history.at(2).as_object();
218218
REQUIRE_NO_THROW_TRUE(tx3.at("height").is_int64());
219219
REQUIRE_NO_THROW_TRUE(tx3.at("tx_hash").is_string());
220-
BOOST_CHECK_EQUAL(tx3.at("fee").as_int64(), floored_subtract(0x10 + 0x11, 0x0a));
220+
BOOST_REQUIRE_EQUAL(tx3.at("fee").as_int64(), floored_subtract(0x10 + 0x11, 0x0a));
221221
BOOST_REQUIRE_EQUAL(tx3.at("height").as_int64(), -1); // not rooted
222222
BOOST_REQUIRE_EQUAL(tx3.at("tx_hash").as_string(), encode_hash(hash3));
223223
}
@@ -281,15 +281,15 @@ BOOST_AUTO_TEST_CASE(electrum__blockchain_address_get_mempool__confirmed_and_unc
281281
const auto& tx1 = history.at(0).as_object();
282282
REQUIRE_NO_THROW_TRUE(tx1.at("height").is_int64());
283283
REQUIRE_NO_THROW_TRUE(tx1.at("tx_hash").is_string());
284-
BOOST_CHECK_EQUAL(tx1.at("fee").as_int64(), floored_subtract(5'000'000'000 + 5'000'000'000, 0x10 + 0x11 + 0x12 + 0x13 + 0x14));
284+
BOOST_REQUIRE_EQUAL(tx1.at("fee").as_int64(), floored_subtract(5'000'000'000 + 5'000'000'000, 0x10 + 0x11 + 0x12 + 0x13 + 0x14));
285285
BOOST_REQUIRE_EQUAL(tx1.at("height").as_int64(), 0); // rooted
286286
BOOST_REQUIRE_EQUAL(tx1.at("tx_hash").as_string(), encode_hash(hash1));
287287

288288
const auto hash2 = test::bogus_block12.transactions_ptr()->at(0)->hash(false);
289289
const auto& tx2 = history.at(1).as_object();
290290
REQUIRE_NO_THROW_TRUE(tx2.at("height").is_int64());
291291
REQUIRE_NO_THROW_TRUE(tx2.at("tx_hash").is_string());
292-
BOOST_CHECK_EQUAL(tx2.at("fee").as_int64(), floored_subtract(0x10 + 0x11, 0x0a));
292+
BOOST_REQUIRE_EQUAL(tx2.at("fee").as_int64(), floored_subtract(0x10 + 0x11, 0x0a));
293293
BOOST_REQUIRE_EQUAL(tx2.at("height").as_int64(), -1); // not rooted
294294
BOOST_REQUIRE_EQUAL(tx2.at("tx_hash").as_string(), encode_hash(hash2));
295295
}

test/protocols/electrum/electrum_scripthash.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -223,23 +223,23 @@ BOOST_AUTO_TEST_CASE(electrum__blockchain_scripthash_get_history__confirmed_and_
223223
const auto& tx1 = history.at(0).as_object();
224224
REQUIRE_NO_THROW_TRUE(tx1.at("height").is_int64());
225225
REQUIRE_NO_THROW_TRUE(tx1.at("tx_hash").is_string());
226-
BOOST_CHECK(!tx1.contains("fee"));
226+
BOOST_REQUIRE(!tx1.contains("fee"));
227227
BOOST_REQUIRE_EQUAL(tx1.at("height").as_int64(), 10);
228228
BOOST_REQUIRE_EQUAL(tx1.at("tx_hash").as_string(), encode_hash(hash1));
229229

230230
const auto hash2 = test::bogus_block11.transactions_ptr()->at(0)->hash(false);
231231
const auto& tx2 = history.at(1).as_object();
232232
REQUIRE_NO_THROW_TRUE(tx2.at("height").is_int64());
233233
REQUIRE_NO_THROW_TRUE(tx2.at("tx_hash").is_string());
234-
BOOST_CHECK_EQUAL(tx2.at("fee").as_int64(), floored_subtract(5'000'000'000 + 5'000'000'000, 0x10 + 0x11 + 0x12 + 0x13 + 0x14));
234+
BOOST_REQUIRE_EQUAL(tx2.at("fee").as_int64(), floored_subtract(5'000'000'000 + 5'000'000'000, 0x10 + 0x11 + 0x12 + 0x13 + 0x14));
235235
BOOST_REQUIRE_EQUAL(tx2.at("height").as_int64(), 0); // rooted
236236
BOOST_REQUIRE_EQUAL(tx2.at("tx_hash").as_string(), encode_hash(hash2));
237237

238238
const auto hash3 = test::bogus_block12.transactions_ptr()->at(0)->hash(false);
239239
const auto& tx3 = history.at(2).as_object();
240240
REQUIRE_NO_THROW_TRUE(tx3.at("height").is_int64());
241241
REQUIRE_NO_THROW_TRUE(tx3.at("tx_hash").is_string());
242-
BOOST_CHECK_EQUAL(tx3.at("fee").as_int64(), floored_subtract(0x10 + 0x11, 0x0a));
242+
BOOST_REQUIRE_EQUAL(tx3.at("fee").as_int64(), floored_subtract(0x10 + 0x11, 0x0a));
243243
BOOST_REQUIRE_EQUAL(tx3.at("height").as_int64(), -1); // not rooted
244244
BOOST_REQUIRE_EQUAL(tx3.at("tx_hash").as_string(), encode_hash(hash3));
245245
}
@@ -313,15 +313,15 @@ BOOST_AUTO_TEST_CASE(electrum__blockchain_scripthash_get_mempool__confirmed_and_
313313
const auto& tx1 = history.at(0).as_object();
314314
REQUIRE_NO_THROW_TRUE(tx1.at("height").is_int64());
315315
REQUIRE_NO_THROW_TRUE(tx1.at("tx_hash").is_string());
316-
BOOST_CHECK_EQUAL(tx1.at("fee").as_int64(), floored_subtract(5'000'000'000 + 5'000'000'000, 0x10 + 0x11 + 0x12 + 0x13 + 0x14));
316+
BOOST_REQUIRE_EQUAL(tx1.at("fee").as_int64(), floored_subtract(5'000'000'000 + 5'000'000'000, 0x10 + 0x11 + 0x12 + 0x13 + 0x14));
317317
BOOST_REQUIRE_EQUAL(tx1.at("height").as_int64(), 0); // rooted
318318
BOOST_REQUIRE_EQUAL(tx1.at("tx_hash").as_string(), encode_hash(hash1));
319319

320320
const auto hash2 = test::bogus_block12.transactions_ptr()->at(0)->hash(false);
321321
const auto& tx2 = history.at(1).as_object();
322322
REQUIRE_NO_THROW_TRUE(tx2.at("height").is_int64());
323323
REQUIRE_NO_THROW_TRUE(tx2.at("tx_hash").is_string());
324-
BOOST_CHECK_EQUAL(tx1.at("fee").as_int64(), floored_subtract(5'000'000'000 + 5'000'000'000, 0x10 + 0x11 + 0x12 + 0x13 + 0x14));
324+
BOOST_REQUIRE_EQUAL(tx1.at("fee").as_int64(), floored_subtract(5'000'000'000 + 5'000'000'000, 0x10 + 0x11 + 0x12 + 0x13 + 0x14));
325325
BOOST_REQUIRE_EQUAL(tx2.at("height").as_int64(), -1); // not rooted
326326
BOOST_REQUIRE_EQUAL(tx2.at("tx_hash").as_string(), encode_hash(hash2));
327327
}

test/protocols/electrum/electrum_scripts.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -225,23 +225,23 @@ BOOST_AUTO_TEST_CASE(electrum__blockchain_scriptpubkey_get_history__confirmed_an
225225
const auto& tx1 = history.at(0).as_object();
226226
REQUIRE_NO_THROW_TRUE(tx1.at("height").is_int64());
227227
REQUIRE_NO_THROW_TRUE(tx1.at("tx_hash").is_string());
228-
BOOST_CHECK(!tx1.contains("fee"));
228+
BOOST_REQUIRE(!tx1.contains("fee"));
229229
BOOST_REQUIRE_EQUAL(tx1.at("height").as_int64(), 10);
230230
BOOST_REQUIRE_EQUAL(tx1.at("tx_hash").as_string(), encode_hash(hash1));
231231

232232
const auto hash2 = test::bogus_block11.transactions_ptr()->at(0)->hash(false);
233233
const auto& tx2 = history.at(1).as_object();
234234
REQUIRE_NO_THROW_TRUE(tx2.at("height").is_int64());
235235
REQUIRE_NO_THROW_TRUE(tx2.at("tx_hash").is_string());
236-
BOOST_CHECK_EQUAL(tx2.at("fee").as_int64(), floored_subtract(5'000'000'000 + 5'000'000'000, 0x10 + 0x11 + 0x12 + 0x13 + 0x14));
236+
BOOST_REQUIRE_EQUAL(tx2.at("fee").as_int64(), floored_subtract(5'000'000'000 + 5'000'000'000, 0x10 + 0x11 + 0x12 + 0x13 + 0x14));
237237
BOOST_REQUIRE_EQUAL(tx2.at("height").as_int64(), 0); // rooted
238238
BOOST_REQUIRE_EQUAL(tx2.at("tx_hash").as_string(), encode_hash(hash2));
239239

240240
const auto hash3 = test::bogus_block12.transactions_ptr()->at(0)->hash(false);
241241
const auto& tx3 = history.at(2).as_object();
242242
REQUIRE_NO_THROW_TRUE(tx3.at("height").is_int64());
243243
REQUIRE_NO_THROW_TRUE(tx3.at("tx_hash").is_string());
244-
BOOST_CHECK_EQUAL(tx2.at("fee").as_int64(), floored_subtract(5'000'000'000 + 5'000'000'000, 0x10 + 0x11 + 0x12 + 0x13 + 0x14));
244+
BOOST_REQUIRE_EQUAL(tx2.at("fee").as_int64(), floored_subtract(5'000'000'000 + 5'000'000'000, 0x10 + 0x11 + 0x12 + 0x13 + 0x14));
245245
BOOST_REQUIRE_EQUAL(tx3.at("height").as_int64(), -1); // not rooted
246246
BOOST_REQUIRE_EQUAL(tx3.at("tx_hash").as_string(), encode_hash(hash3));
247247
}
@@ -315,14 +315,14 @@ BOOST_AUTO_TEST_CASE(electrum__blockchain_scriptpubkey_get_mempool__confirmed_an
315315
const auto& tx1 = history.at(0).as_object();
316316
REQUIRE_NO_THROW_TRUE(tx1.at("height").is_int64());
317317
REQUIRE_NO_THROW_TRUE(tx1.at("tx_hash").is_string());
318-
BOOST_CHECK_EQUAL(tx1.at("fee").as_int64(), floored_subtract(5'000'000'000 + 5'000'000'000, 0x10 + 0x11 + 0x12 + 0x13 + 0x14));
318+
BOOST_REQUIRE_EQUAL(tx1.at("fee").as_int64(), floored_subtract(5'000'000'000 + 5'000'000'000, 0x10 + 0x11 + 0x12 + 0x13 + 0x14));
319319
BOOST_REQUIRE_EQUAL(tx1.at("tx_hash").as_string(), encode_hash(hash1));
320320

321321
const auto hash2 = test::bogus_block12.transactions_ptr()->at(0)->hash(false);
322322
const auto& tx2 = history.at(1).as_object();
323323
REQUIRE_NO_THROW_TRUE(tx2.at("height").is_int64());
324324
REQUIRE_NO_THROW_TRUE(tx2.at("tx_hash").is_string());
325-
BOOST_CHECK_EQUAL(tx2.at("fee").as_int64(), floored_subtract(0x10 + 0x11, 0x0a));
325+
BOOST_REQUIRE_EQUAL(tx2.at("fee").as_int64(), floored_subtract(0x10 + 0x11, 0x0a));
326326
BOOST_REQUIRE_EQUAL(tx2.at("height").as_int64(), -1); // not rooted
327327
BOOST_REQUIRE_EQUAL(tx2.at("tx_hash").as_string(), encode_hash(hash2));
328328
}

0 commit comments

Comments
 (0)