aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpracticalswift <practicalswift@users.noreply.github.com>2020-03-10 12:12:35 +0000
committerpracticalswift <practicalswift@users.noreply.github.com>2020-03-11 12:51:26 +0000
commit117a706faba586f2095f97cf630b709b3e29a947 (patch)
treebaf905603468136b04170728194b2360dcecf851
parent81b58a3161c5d558dadd2b7093e4fc9687844cd9 (diff)
tests: Fuzz RecursiveDynamicUsage(const std::shared_ptr<X>& p)
-rw-r--r--src/test/fuzz/block.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/test/fuzz/block.cpp b/src/test/fuzz/block.cpp
index 431248de4a..4a97eca18a 100644
--- a/src/test/fuzz/block.cpp
+++ b/src/test/fuzz/block.cpp
@@ -15,6 +15,7 @@
#include <version.h>
#include <cassert>
+#include <memory>
#include <string>
void initialize()
@@ -59,5 +60,7 @@ void test_one_input(const std::vector<uint8_t>& buffer)
}
(void)GetBlockWeight(block);
(void)GetWitnessCommitmentIndex(block);
- (void)RecursiveDynamicUsage(block);
+ const size_t raw_memory_size = RecursiveDynamicUsage(block);
+ const size_t raw_memory_size_as_shared_ptr = RecursiveDynamicUsage(std::make_shared<CBlock>(block));
+ assert(raw_memory_size_as_shared_ptr > raw_memory_size);
}