From 037fa2dd14dd9ce806496e984f30946a831a3c8e Mon Sep 17 00:00:00 2001 From: fanquake Date: Sat, 11 Jan 2020 07:37:33 +0800 Subject: [PATCH] Merge #17893: qa: Fix double-negative arg test 8b2f471a1bff753cc4df29805ef38c3623f64f6e qa: Fix double-negative arg test (Hennadii Stepanov) Pull request description: Commit 67518f7cc61bf59ddfa0fd7c8dbbdec3653b9556 tests do not catch that a pointer is returned instead of a value. This PR makes test to not accept trailing characters after 0. From [IRC](http://www.erisian.com.au/bitcoin-core-dev/log-2020-01-07.html#l-358): > \ ryanofsky: hmm, why test/functional/feature_config_args.py passed on 67518f7cc61bf59ddfa0fd7c8dbbdec3653b9556 ? > \ I see now: test is broken. > \ test should be unaffected by that change, do you see a break somewhere? > \ yes: "-connect=0x7fff50369968" != "-connect=0" > ... > \ Oh I see how that would happen, it should not be a problem in the current PR. > \ going to submit a pr to fix test > \ in the commit you mentioned, value is a pointer to a string, and it was printing the pointer address instead of the string on: LogPrintf("Warning: parsed potentially confusing double-negative -%s=%s\n", key, value); > \ correct > \ oh I see, test could be fixed to more robust and not accept trailing characters after 0 ACKs for top commit: ryanofsky: Code review ACK 8b2f471a1bff753cc4df29805ef38c3623f64f6e. I don't know how you found this but it's a nice catch! This change should make the test more reliable. Tree-SHA512: 454b3d4415771d353a2da766f6ae6e0bfae7bdf485aaa7bfdd323595282356eeaf3f40e556b39f753bc35f578cbe9684368887eef2d63c5d7f0d7d9fa971697a --- test/functional/feature_config_args.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/functional/feature_config_args.py b/test/functional/feature_config_args.py index 1f5c029e68..7640063f56 100755 --- a/test/functional/feature_config_args.py +++ b/test/functional/feature_config_args.py @@ -16,7 +16,7 @@ class ConfArgsTest(BitcoinTestFramework): def test_log_buffer(self): - with self.nodes[0].assert_debug_log(expected_msgs=['Warning: parsed potentially confusing double-negative -connect=0']): + with self.nodes[0].assert_debug_log(expected_msgs=['Warning: parsed potentially confusing double-negative -connect=0\n']): self.start_node(0, extra_args=['-noconnect=0']) self.stop_node(0)