osmith has submitted this change. (
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37883?usp=email )
Change subject: ctrl: tweak errmsg for counter mismatch
......................................................................
ctrl: tweak errmsg for counter mismatch
- instead of "-1", print "not present", so humans know what is
happening.
- the comma separated args in setverdict() create a lot of weird quotes.
Use string concatenation to have only one set of quotes around the
entire error message.
Related: OS#6545
Tweaked-by: Oliver Smith <osmith(a)sysmocom.de>
Change-Id: I672fcef819a6542a5b3bcfa0a6d9c84d34b468f3
---
M library/Osmocom_CTRL_Functions.ttcn
1 file changed, 11 insertions(+), 2 deletions(-)
Approvals:
fixeria: Looks good to me, approved
Jenkins Builder: Verified
pespin: Looks good to me, but someone else must approve
diff --git a/library/Osmocom_CTRL_Functions.ttcn b/library/Osmocom_CTRL_Functions.ttcn
index f8788b9..cf19f7e 100644
--- a/library/Osmocom_CTRL_Functions.ttcn
+++ b/library/Osmocom_CTRL_Functions.ttcn
@@ -295,6 +295,14 @@
f_counter_name_vals_set(vals[instance_nr], countername, val);
}
+ private function f_counter_val_to_str(integer val) return charstring
+ {
+ if (val < 0) {
+ return "not present";
+ }
+ return int2str(val);
+ }
+
/* For a specific instance, call f_counter_name_vals_get() and compare with expected
counter values.
* Set the test verdict accordingly. */
function f_counter_name_vals_expect(IPA_CTRL_PT pt, charstring instance_name, integer
instance_nr,
@@ -305,8 +313,9 @@
setverdict(fail, "Internal error");
}
if (last[i].val != vals[i].val) {
- setverdict(fail, "Rate counter mismatch: ", instance_name, " ",
instance_nr,
- " ", vals[i].name, " is at ", last[i].val, " but
expected ", vals[i].val);
+ setverdict(fail, "Rate counter mismatch: " & instance_name & "
" & int2str(instance_nr)
+ & " " & vals[i].name & " is " &
f_counter_val_to_str(last[i].val)
+ & " but expected " & f_counter_val_to_str(vals[i].val));
}
}
setverdict(pass);
--
To view, visit
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37883?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I672fcef819a6542a5b3bcfa0a6d9c84d34b468f3
Gerrit-Change-Number: 37883
Gerrit-PatchSet: 6
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>