test: Misc refactor to get rid of &foo[0] raw pointers #21840

pull MarcoFalke wants to merge 3 commits into bitcoin:master from MarcoFalke:2105-testRefactor changing 3 files +20 −31
  1. MarcoFalke commented at 9:52 am on May 3, 2021: member
    Simplify test code
  2. test: Use loop to register RPCs
    The same loop is used by the server, so no need for
    the tests to do this differently.
    fa2197c8b3
  3. test: Use throwing variant accessor
    It does not matter if the tests fail due to a BOOST_CHECK failure or
    due to a thrown exception. Prefer the exception because it is less
    code.
    
    Example fail with the throwing accessor:
    
    unknown location(0): fatal error: in "script_standard_tests/script_standard_ExtractDestinations": std::bad_variant_access: std::get: wrong index for variant
    test/script_standard_tests.cpp(314): last checkpoint
    
    *** 1 failure is detected in the test module "Bitcoin Core Test Suite"
    000098f964
  4. bench: Remove duplicate constants fa8a88849c
  5. MarcoFalke renamed this:
    test: Misc refactor to get rid of &foo[0] raw byte pointers
    test: Misc refactor to get rid of &foo[0] raw pointers
    on May 3, 2021
  6. fanquake added the label Tests on May 3, 2021
  7. practicalswift commented at 10:20 am on May 3, 2021: contributor
    Concept ACK
  8. Empact commented at 4:10 pm on May 3, 2021: member

    Code Review ACK fa8a88849c08c810a82338bf0e70738eb6748906

    Re: 000098f, this is a stricter check, always applied, so seems an improvement to me.

  9. MarcoFalke commented at 4:37 pm on May 3, 2021: member

    000098f, this is a stricter check

    It should be equally strict. Both would pass/fail the unit tests under the same conditions.

  10. Empact commented at 5:02 pm on May 3, 2021: member
    Agreed, thanks.
  11. practicalswift commented at 6:10 pm on May 3, 2021: contributor
    cr ACK fa8a88849c08c810a82338bf0e70738eb6748906
  12. in src/qt/test/rpcnestedtests.cpp:38 in fa2197c8b3 outdated
    34@@ -35,14 +35,16 @@ static RPCHelpMan rpcNestedTest_rpc()
    35 }
    36 
    37 static const CRPCCommand vRPCCommands[] = {
    38-    {"test", &rpcNestedTest_rpc},
    39+    {"rpcNestedTest", &rpcNestedTest_rpc},
    


    promag commented at 0:07 am on May 4, 2021:

    fa2197c8b3178787d99e2acb5c3c717df14ddabf

    nit, change to category seems unnecessary.


    MarcoFalke commented at 4:48 am on May 4, 2021:
    Ah right. :facepalm: I thought this is the name and needs to be adjusted, but yeah. Going to leave as is, because it doesn’t matter.
  13. promag commented at 0:12 am on May 4, 2021: member
    Code review ACK fa8a88849c08c810a82338bf0e70738eb6748906.
  14. MarcoFalke merged this on May 4, 2021
  15. MarcoFalke closed this on May 4, 2021

  16. MarcoFalke deleted the branch on May 4, 2021
  17. sidhujag referenced this in commit 276e41efa8 on May 4, 2021
  18. gwillen referenced this in commit 5a7343536d on Jun 1, 2022
  19. DrahtBot locked this on Aug 18, 2022

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: 2024-11-17 18:12 UTC

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