Attention is currently required from: pespin.
neels has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37189?usp=email )
Change subject: Osmocom_CTRL: counters: return -1 for absent objects ......................................................................
Patch Set 1:
(1 comment)
Patchset:
PS1:
imho f_ctrl_get_ratectr_abs() is conceived to be used when a rate ctr should be obtained, and fail o […]
I thought about that actually.
- Our tests currently pass, hence this patch affects no callers at all. (any absent object would currently setverdict(fail) unconditionally)
- Future tests implicitly expect counters >= 0, and would fail if they get -1 instead, simply by verifying the expected counters as we already do.
- If a test tests for a before-after diff of a counter, it will get unexpected diff values when a counter returns -1. (One corner case is expecting that a counter diff remains zero, which should always also have a phase of the test where the same counter increments; one of these phases will fail on an absent object.)
So, no additional code needed to handle -1 return values, in all practical situations.
That is why I did not continue to carry the on_error param further out to f_ctrl_get_ratectr_abs().