Page MenuHomePhabricator

Make tests independent of whether CHECKDATASIG is included in mandatory or standard flags
ClosedPublic

Authored by Mengerian on May 17 2019, 16:49.

Details

Summary

Currently, in addition to testing the functioning of CHECKDATASIG,
sigopcount_tests.cpp and checkdatasig_tests.cpp implicitly test that
CHECKDATASIG is not included in standard or mandatory flags.

Change this to make the CHECKDATASIG tests independent of whether CHECKDATASIG
is included in standard or mandatory flags. To maintain test coverage, also
add a test to explicitly test whether CHECKDATASIG is included in standard or
mandatory flags.

Test Plan

make check - passes
Try adding CHECKDATASIG to standard flags - make check - test fails.
Try adding CHECKDATASIG to mandatory flags - make check - test fails.

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

I realized it makes more sense to combine the code and test changes together in one Diff.

Add test for CHECKDATASIG inclusion in standard or mandatory flags.

Mengerian retitled this revision from Make tests independent of whether CHECKDATASIG is included in flag set to Make tests independent of whether CHECKDATASIG is included in mandatory or standard flags.May 20 2019, 21:02
Mengerian edited the summary of this revision. (Show Details)
Mengerian edited the test plan for this revision. (Show Details)
Mengerian added a reviewer: markblundeberg.

I'm happy with this general direction. Given the severity of consequences of not including it in standardness, the checkdatasig_inclusion_in_standard_and_mandatory_flags is nice to have as a fool-proof check. :)

src/test/checkdatasig_tests.cpp
260 ↗(On Diff #8752)

nit: I would have done
BOOST_CHECK(!(STANDARD_SCRIPT_VERIFY_FLAGS & SCRIPT_ENABLE_CHECKDATASIG))

Simplify boolean logic per Mark's suggestion.

need to fix build

This revision is now accepted and ready to land.May 21 2019, 21:19