]> git.ipfire.org Git - thirdparty/haproxy.git/commit
CLEANUP: sample: remove uneeded check in json validation
authorWilliam Dauchy <wdauchy@gmail.com>
Fri, 8 Jan 2021 20:57:41 +0000 (21:57 +0100)
committerWilly Tarreau <w@1wt.eu>
Sun, 10 Jan 2021 06:39:58 +0000 (07:39 +0100)
commit5417e898ff0334c9693c1e773a840a4f37512b3d
treed674be0165dbfab5cc52f07571e7b60260ac6457
parent4fb255df03f439c5da0446f2b017191c637b2b7b
CLEANUP: sample: remove uneeded check in json validation

- check functions are never called with a NULL args list, it is always
  an array, so first check can be removed
- the expression parser guarantees that we can't have anything else,
  because we mentioned json converter takes a mandatory string argument.
  Thus test on `ARGT_STR` can be removed as well
- also add breaking line between enum and function declaration

In order to validate it, add a simple json test testing very simple
cases but can be improved in the future:

- default json converter without args
- json converter failing on error (utf8)
- json converter with error being removed (utf8s)

Signed-off-by: William Dauchy <wdauchy@gmail.com>
reg-tests/converter/json.vtc [new file with mode: 0644]
src/sample.c