Skip to content

Commit

Permalink
fuzz: Add assert(script == decompressed_script)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoFalke committed Mar 7, 2020
1 parent 5e12a61 commit fab0e5b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/test/fuzz/script.cpp
Expand Up @@ -33,10 +33,12 @@ void test_one_input(const std::vector<uint8_t>& buffer)
std::vector<unsigned char> compressed;
if (CompressScript(script, compressed)) {
const unsigned int size = compressed[0];
compressed.erase(compressed.begin());
assert(size >= 0 && size <= 5);
CScript decompressed_script;
const bool ok = DecompressScript(decompressed_script, size, compressed);
assert(ok);
assert(script == decompressed_script);
}

for (unsigned int size = 0; size < 6; ++size) {
Expand Down

0 comments on commit fab0e5b

Please sign in to comment.