From 5d35e7a820a9db144aa02153b939d839a3cffbff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Wo=C5=BAniak?= Date: Fri, 29 Jun 2018 00:23:25 +0200 Subject: [PATCH] Fix p2pkh tests asserts (#2153) Even the results were as expected, IsPayToPublicKeyHash() breaks at size checking step now, as was intended. Also removes compile time array-bounds warning. --- src/test/script_P2PKH_tests.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/script_P2PKH_tests.cpp b/src/test/script_P2PKH_tests.cpp index d2c5186c93bad..4cd6e2745154a 100644 --- a/src/test/script_P2PKH_tests.cpp +++ b/src/test/script_P2PKH_tests.cpp @@ -47,12 +47,12 @@ BOOST_AUTO_TEST_CASE(IsPayToPublicKeyHash) static const unsigned char missing2[] = { OP_DUP, OP_HASH160, 20, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; - BOOST_CHECK(!CScript(missing2, missing2+sizeof(missing)).IsPayToPublicKeyHash()); + BOOST_CHECK(!CScript(missing2, missing2+sizeof(missing2)).IsPayToPublicKeyHash()); static const unsigned char tooshort[] = { OP_DUP, OP_HASH160, 2, 0,0, OP_EQUALVERIFY, OP_CHECKSIG }; - BOOST_CHECK(!CScript(tooshort, tooshort+sizeof(direct)).IsPayToPublicKeyHash()); + BOOST_CHECK(!CScript(tooshort, tooshort+sizeof(tooshort)).IsPayToPublicKeyHash()); }