Page MenuHomePhabricator

Split out key-value parsing in ArgsManager into its own function
ClosedPublic

Authored by jasonbcox on Nov 20 2019, 20:27.

Details

Summary

This will allow us to parse CLI args while under test without
erroring on other args the test framework may be adding.

Test Plan

make check

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Considering there are still many backports to do in there, I don't think this is very wise to go there.

Considering there are still many backports to do in there, I don't think this is very wise to go there.

I'm aware of that. I checked Core's latest and this part of the code has remained the same so far. I only see one trivial backport that is missing between the lines that were pulled out.

All in all, I think taking ownership on this small piece is worth what we're getting out of it.

Fabien requested changes to this revision.Nov 22 2019, 07:24
Fabien added a subscriber: Fabien.

Mind adding an unit test ?

src/util/system.cpp
427 ↗(On Diff #14320)

size_t

This revision now requires changes to proceed.Nov 22 2019, 07:24
  • Added some basic unit tests
  • int -> size_t
  • Funny how forcing yourself to write some tests reveals subtle design flaws. Moved ParseKeyValue() out of ArgsManager because it doesn't actually belong in that class. I still kept the implementations close to make backporting easier.
This revision is now accepted and ready to land.Nov 24 2019, 09:54