tests: replace ok(ret == KNOT_E???) with is_int(KNOT_E???, ret) to ease debugging
Throwing away unexpected retun codes makes debugging harder. TAP function is_int can nicely log mismatches which makes debugging easier.
To make our lives easier I replaced all ok(ret == KNOT_E???) checks with is_int() calls. It was done using following command
- manual review and reverts in libknot/test_control.c.
$ find -name '*.c' | xargs sed -i 's#ok(ret == (KNOT_E[0-9A-Z_]+),#is_int(\1, ret,#'
Merge request reports
Activity
added 6 commits
- aaa7b3e7...9171da0e - 5 commits from branch
master
- 1c2aa30e - tests: replace ok(ret == KNOT_E???) with is_int(KNOT_E???, ret) to ease debugging
- aaa7b3e7...9171da0e - 5 commits from branch
- Resolved by Ondřej Surý
- Resolved by Ondřej Surý
added 2 commits
- 4eee740f - tests: replace ok(ret == KNOT_E???) with is_int(KNOT_E???, ret) to ease debugging
- b31d2e4b - tests: replace ok(ret == KNOT_E???) with is_int(KNOT_E???, ret) to ease debugging
added 1 commit
- 9a2e74de - tests: replace ok(ret == KNOT_E???) with is_int(KNOT_E???, ret) to ease debugging
added 14 commits
- 9a2e74de...cba5e77a - 13 commits from branch
master
- 85428284 - tests: replace ok(ret == KNOT_E???) with is_int(KNOT_E???, ret) to ease debugging
- 9a2e74de...cba5e77a - 13 commits from branch
Oh yes, it did convert the simplest tests. Why not merge this incremental improvement?
It seems to me that 'quick' regex will have good effort/benefit ratio. Other places would require more tedious work and can be improved later on if we decide that it is worth. IMHO it is better to invest 'manual work' into something else.
added 1 commit
- 339f7a5f - tests: replace ok(ret == KNOT_E???) with is_int(KNOT_E???, ret) to ease debugging
mentioned in issue #506 (closed)
mentioned in commit cdbd4fb6