Page MenuHomePhabricator

fix ineffective checkdatasig_tests
ClosedPublic

Authored by markblundeberg on Feb 2 2019, 15:37.

Details

Reviewers
deadalnix
Group Reviewers
Restricted Project
Commits
rABC6bcf11b84499: fix ineffective checkdatasig_tests
Summary

These tests were totally broken:

  • Only did 1 iteration because it set flags |= ENABLE_CHECKDATASIG at start
  • Wasn't aware of SCRIPT_VERIFY_COMPRESSED_PUBKEYTYPE
  • Missed some SCRIPT_VERIFY_NULLFAIL cases

Also I changed it to use pseudorandom flags generator since the original intent of 262000 iterations would have been way way too slow anyway. Runtime is now ~3 sec, would have been 3 minutes (dominating test_bitcoin runtime) if original iter count ever actually worked.

Test Plan

test_bitcoin

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

markblundeberg created this revision.Feb 2 2019, 15:37
Herald added a reviewer: Restricted Project. · View Herald TranscriptFeb 2 2019, 15:37
Herald added a subscriber: schancel. · View Herald Transcript
deadalnix requested changes to this revision.Feb 2 2019, 15:43

Some minor changes, but overall LGTM.

src/test/checkdatasig_tests.cpp
48 ↗(On Diff #7121)

Keep the check equal.

50 ↗(On Diff #7121)

Do not try to format tthese is specific format, especially not with colors.

63 ↗(On Diff #7121)

dito

This revision now requires changes to proceed.Feb 2 2019, 15:43
markblundeberg updated this revision to Diff 7122.Feb 2 2019, 15:49
markblundeberg marked 2 inline comments as done.

remove custom messaging

markblundeberg marked an inline comment as done.Feb 2 2019, 15:49
deadalnix accepted this revision.Feb 2 2019, 16:06
This revision is now accepted and ready to land.Feb 2 2019, 16:06
This revision was automatically updated to reflect the committed changes.