Skip to content

Conversation

@maflcko
Copy link
Member

@maflcko maflcko commented May 3, 2021

Simplify test code

MarcoFalke added 3 commits May 3, 2021 11:50
The same loop is used by the server, so no need for
the tests to do this differently.
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"
@maflcko maflcko changed the title test: Misc refactor to get rid of &foo[0] raw byte pointers test: Misc refactor to get rid of &foo[0] raw pointers May 3, 2021
@fanquake fanquake added the Tests label May 3, 2021
@practicalswift
Copy link
Contributor

Concept ACK

@Empact
Copy link
Contributor

Empact commented May 3, 2021

Code Review ACK fa8a888

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

@maflcko
Copy link
Member Author

maflcko commented May 3, 2021

000098f, this is a stricter check

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

@Empact
Copy link
Contributor

Empact commented May 3, 2021

Agreed, thanks.

@practicalswift
Copy link
Contributor

cr ACK fa8a888

Copy link
Contributor

@promag promag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review ACK fa8a888.


static const CRPCCommand vRPCCommands[] = {
{"test", &rpcNestedTest_rpc},
{"rpcNestedTest", &rpcNestedTest_rpc},
Copy link
Contributor

@promag promag May 4, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fa2197c

nit, change to category seems unnecessary.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah right. 🤦 I thought this is the name and needs to be adjusted, but yeah. Going to leave as is, because it doesn't matter.

@maflcko maflcko merged commit e2d4e67 into bitcoin:master May 4, 2021
@maflcko maflcko deleted the 2105-testRefactor branch May 4, 2021 04:51
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request May 4, 2021
…inters

fa8a888 bench: Remove duplicate constants (MarcoFalke)
000098f test: Use throwing variant accessor (MarcoFalke)
fa2197c test: Use loop to register RPCs (MarcoFalke)

Pull request description:

  Simplify test code

ACKs for top commit:
  Empact:
    Code Review ACK fa8a888
  practicalswift:
    cr ACK fa8a888
  promag:
    Code review ACK fa8a888.

Tree-SHA512: 6a5bebaa9a3f43e9c332f4fbff606e9ece6dc8b95a769980082cc022f8e9bde6083c1e4a0145dcbf3741f514d6e97b4198f201a1bf1370ebf43bd3a5c0f85981
gwillen pushed a commit to ElementsProject/elements that referenced this pull request Jun 1, 2022
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Aug 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants