Trivial follow-up after #29904 (review)
test: Add two more urlDecode tests #29967
pull maflcko wants to merge 1 commits into bitcoin:master from maflcko:2404-test-urlDec- changing 1 files +3 −0-
maflcko commented at 6:35 AM on April 26, 2024: member
-
test: Add two more urlDecode tests fa55972a75
-
DrahtBot commented at 6:35 AM on April 26, 2024: contributor
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--006a51241073e994b41acfe9ec718e94-->
Code Coverage
For detailed information about the code coverage, see the test coverage report.
<!--021abf342d371248e50ceaed478a90ca-->
Reviews
See the guideline for information on the review process.
Type Reviewers ACK laanwj, stickies-v, fjahr, Sjors If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.
- DrahtBot added the label Tests on Apr 26, 2024
- maflcko requested review from fjahr on Apr 26, 2024
-
laanwj commented at 7:30 AM on April 26, 2024: member
- stickies-v approved
-
stickies-v commented at 7:44 AM on April 26, 2024: contributor
ACK fa55972a758865a6bd0114afe72e51877896d495
-
fjahr commented at 7:48 AM on April 26, 2024: contributor
ACK fa55972a758865a6bd0114afe72e51877896d495
super-mini-nit: In the commit message,
urlDecodeis nowUrlDecode -
in src/test/common_url_tests.cpp:57 in fa55972a75
53 | @@ -54,6 +54,9 @@ BOOST_AUTO_TEST_CASE(decode_malformed_test) { 54 | BOOST_CHECK_EQUAL(UrlDecode(" %Z "), " %Z "); 55 | BOOST_CHECK_EQUAL(UrlDecode(" % X"), " % X"); 56 | 57 | + BOOST_CHECK_EQUAL(UrlDecode("%%ffg"), "%\xffg");
Sjors commented at 8:31 AM on April 26, 2024:I had to scratch my head on this one...
It iterates from left to right, the first thing it finds is
%. It then tries if the next two characters are hex, which they are not, so it puts the literal%in the result. Then it moves to the next%which is followed by valid hexff. Since0xffis invalid unicode, we have to represent it with the escape sequence"\xff". And then there's the regular characterg.Sjors approvedSjors commented at 8:32 AM on April 26, 2024: memberutACK fa55972a758865a6bd0114afe72e51877896d495
fanquake merged this on Apr 26, 2024fanquake closed this on Apr 26, 2024maflcko deleted the branch on Apr 26, 2024bitcoin locked this on Apr 26, 2025Labels
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-13 15:13 UTC
More mirrored repositories can be found on mirror.b10c.me