unit_tests: check return values on test data parsing

Won't trigger in practice, but you never know when that code changes

Coverity 199723, 199685
This commit is contained in:
moneromooo-monero 2019-07-01 11:58:22 +00:00
parent c8709fe52f
commit 7b18e838ea
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3

View file

@ -162,7 +162,7 @@ protected:
{ {
block bl; block bl;
blobdata bd = h2b(i); blobdata bd = h2b(i);
parse_and_validate_block_from_blob(bd, bl); CHECK_AND_ASSERT_THROW_MES(parse_and_validate_block_from_blob(bd, bl), "Invalid block");
m_blocks.push_back(std::make_pair(bl, bd)); m_blocks.push_back(std::make_pair(bl, bd));
} }
for (auto& i : t_transactions) for (auto& i : t_transactions)
@ -172,7 +172,7 @@ protected:
{ {
transaction tx; transaction tx;
blobdata bd = h2b(j); blobdata bd = h2b(j);
parse_and_validate_tx_from_blob(bd, tx); CHECK_AND_ASSERT_THROW_MES(parse_and_validate_tx_from_blob(bd, tx), "Invalid transaction");
txs.push_back(std::make_pair(tx, bd)); txs.push_back(std::make_pair(tx, bd));
} }
m_txs.push_back(txs); m_txs.push_back(txs);