fuzz: Add assert(script == decompressed_script)

This commit is contained in:
MarcoFalke 2020-03-07 17:03:47 -05:00
parent 5e12a61044
commit fab0e5ba7f
No known key found for this signature in database
GPG Key ID: CE2B75697E69A548

View File

@ -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) {