DRY: Avoid repetitions in script_test #4994

pull jtimon wants to merge 1 commits into bitcoin:master from jtimon:dry changing 1 files +7 −30
  1. jtimon commented at 4:53 AM on September 28, 2014: contributor

    Simple "don't repeat yourself" changes in script_test.

  2. sipa commented at 4:59 AM on September 28, 2014: member

    utACK

  3. in src/test/script_tests.cpp:None in 5b7a8c2e2a outdated
     201 | @@ -202,6 +202,25 @@ sign_multisig(CScript scriptPubKey, const CKey &key, CTransaction transaction)
     202 |      return sign_multisig(scriptPubKey, keys, transaction);
     203 |  }
     204 |  
     205 | +CMutableTransaction buildTxFrom(CScript scriptPubKey)
    


    Diapolo commented at 2:30 PM on September 28, 2014:

    Nit: Could be a const reference I guess, not that it matters hard here...

  4. jtimon force-pushed on Sep 29, 2014
  5. BitcoinPullTester commented at 10:52 PM on September 29, 2014: none

    Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/p4994_0257becd37fd0594e8e75fa192b212a2cbb46ef0/ for binaries and test log. This test script verifies pulls every time they are updated. It, however, dies sometimes and fails to test properly. If you are waiting on a test, please check timestamps to verify that the test.log is moving at http://jenkins.bluematt.me/pull-tester/current/ Contact BlueMatt on freenode if something looks broken.

  6. sipa commented at 5:27 AM on September 30, 2014: member

    @jtimon I have an extra commit in https://github.com/sipa/bitcoin/commits/dry on top that removes even more duplication.

  7. jtimon force-pushed on Oct 1, 2014
  8. jtimon commented at 6:52 PM on October 1, 2014: contributor

    I included your commit, though it needed to be rebased.

  9. sipa commented at 2:07 AM on October 2, 2014: member

    Rebase is welcome.

  10. in src/test/script_tests.cpp:None in d85979b631 outdated
      91 | @@ -92,6 +92,11 @@ void DoTest(const CScript& scriptPubKey, const CScript& scriptSig, int flags, bo
      92 |      BOOST_CHECK_MESSAGE(VerifyScript(scriptSig, scriptPubKey, BuildSpendingTransaction(scriptSig, BuildCreditingTransaction(scriptPubKey)), 0, flags) == expect, message);
      93 |  }
      94 |  
      95 | +void DoTest2(const CScript& scriptPubKey, const CScript& scriptSig, int flags, bool expect, const std::string& message)
      96 | +{
      97 | +    BOOST_CHECK_MESSAGE(VerifyScript(scriptSig, scriptPubKey, BuildSpendingTransaction(scriptSig, BuildCreditingTransaction(scriptPubKey)), 0, flags) == expect, strTest);
      98 | +}
      99 | +
    


    TheBlueMatt commented at 6:34 AM on October 2, 2014:

    Wait...am I too tired or is this the same as the above?

  11. in src/test/script_tests.cpp:None in d85979b631 outdated
      91 | @@ -92,6 +92,11 @@ void DoTest(const CScript& scriptPubKey, const CScript& scriptSig, int flags, bo
      92 |      BOOST_CHECK_MESSAGE(VerifyScript(scriptSig, scriptPubKey, BuildSpendingTransaction(scriptSig, BuildCreditingTransaction(scriptPubKey)), 0, flags) == expect, message);
      93 |  }
      94 |  
      95 | +void DoTest2(const CScript& scriptPubKey, const CScript& scriptSig, int flags, bool expect, const std::string& message)
    


    laanwj commented at 7:10 AM on October 2, 2014:

    can we please have a more descriptive name than DoTest2?

  12. jtimon force-pushed on Oct 2, 2014
  13. jtimon commented at 7:48 PM on October 2, 2014: contributor

    Sorry, I got confused when rebasing sipa's commit, but DoTest2 wasn't necessary. I squashed @sipa 's commit so now it should be more readable.

  14. DRY: Avoid repetitions in script_test 54510f2672
  15. jtimon force-pushed on Oct 2, 2014
  16. TheBlueMatt commented at 8:40 PM on October 2, 2014: member

    utACK

  17. sipa commented at 8:41 PM on October 2, 2014: member

    re-utACK

  18. laanwj merged this on Oct 2, 2014
  19. laanwj closed this on Oct 2, 2014

  20. laanwj referenced this in commit 29f96e8bc6 on Oct 2, 2014
  21. MarcoFalke locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-17 15:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me