mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-13 11:35:20 +01:00
test: add static test for util::Result memory usage
Suggested by Martin Leitner-Ankerl <martin.ankerl@gmail.com> https://github.com/bitcoin/bitcoin/pull/25722#discussion_r1174298529 Co-authored-by: Martin Leitner-Ankerl <martin.ankerl@gmail.com>
This commit is contained in:
parent
4599760cc6
commit
69b14c8122
1 changed files with 6 additions and 0 deletions
|
@ -182,6 +182,12 @@ void ExpectFail(const util::Result<T, F>& result, bilingual_str str, Args&&... a
|
|||
BOOST_CHECK_EQUAL(result.GetFailure(), expect_failure);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(check_sizes)
|
||||
{
|
||||
static_assert(sizeof(util::Result<int>) == sizeof(void*)*2);
|
||||
static_assert(sizeof(util::Result<void>) == sizeof(void*));
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(check_returned)
|
||||
{
|
||||
ExpectResult(VoidSuccessFn(), true, {});
|
||||
|
|
Loading…
Add table
Reference in a new issue