From afce86630ccc0d9a3c0f566fa1c935587bbe3770 Mon Sep 17 00:00:00 2001 From: Daniel Willmann Date: Fri, 6 Jul 2018 23:11:32 +0200 Subject: Stop tests after failures Call mtc.stop after setverdict(fail), add reasons to most failures and fail with verdict error for internal errors. Change-Id: I9b618235939fa41160b9be6677b121963d3ec857 --- sysinfo/Test.ttcn | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'sysinfo/Test.ttcn') diff --git a/sysinfo/Test.ttcn b/sysinfo/Test.ttcn index 02a2279e..c35da919 100644 --- a/sysinfo/Test.ttcn +++ b/sysinfo/Test.ttcn @@ -139,8 +139,8 @@ module Test { /* ensure a given TC slot of the SI vector contains given SI type at least once at TC */ function f_ensure_si_vec_contains(SystemInformationVectorPerTc arr, integer tc, RrMessageType key, boolean ext_bcch := false) { if (not f_si_vecslot_contains(arr[tc], key, ext_bcch)) { - log("Fail: No ", key, " in TC=", tc, "!"); - setverdict(fail); + setverdict(fail, "Fail: No ", key, " in TC=", tc, "!"); + mtc.stop; } } @@ -180,8 +180,8 @@ module Test { /* ensure a given TC slot of the SI vector contains given SI type at least N out of M times at TC */ function f_ensure_si_vec_contains_n_of_m(SystemInformationVectorPerTc arr, integer tc, RrMessageType key, boolean ext_bcch := false, integer n, integer m) { if (not f_si_vecslot_contains_n_of_m(arr[tc], key, ext_bcch, n, m)) { - log("Fail: Not ", n, "/", m, " of ", key, " in TC=", tc, "!"); - setverdict(fail); + setverdict(fail, "Fail: Not ", n, "/", m, " of ", key, " in TC=", tc, "!"); + mtc.stop; } } @@ -202,8 +202,8 @@ module Test { /* ensure a given TC slot of the SI vector contains only given SI type */ function f_ensure_si_vec_contains_only(SystemInformationVectorPerTc arr, integer tc, RrMessageType key, boolean ext_bcch := false) { if (not f_si_vecslot_contains_only(arr[tc], key, ext_bcch)) { - log("Fail: Not all ", key, " in TC=", tc, "!"); - setverdict(fail); + setverdict(fail, "Fail: Not all ", key, " in TC=", tc, "!"); + mtc.stop; } } @@ -233,6 +233,7 @@ module Test { for (i := 0; i < sizeof(si_per_tc); i := i + 1) { if (sizeof(si_per_tc[i]) == 0) { setverdict(fail, "No SI messages for TC=0!"); + mtc.stop; } } if (cfg.si1_present) { @@ -313,6 +314,7 @@ module Test { } if (f_si_vec_contains(si_per_tc, SYSTEM_INFORMATION_TYPE_13alt)) { setverdict(fail, "Cannot have SI13alt and SI13"); + mtc.stop; } } if (cfg.si16_present or cfg.si17_present) { @@ -323,6 +325,7 @@ module Test { } if (f_si_vec_contains(si_per_tc, SYSTEM_INFORMATION_TYPE_22)) { setverdict(fail, "Cannot have SI16/SI17 and SI22!"); + mtc.stop; } if (not cfg.bcch_extended) { testcase.stop("Error: SI16/SI17 requires BCCH Extd!"); @@ -368,6 +371,7 @@ module Test { } if (f_si_vec_contains(si_per_tc, SYSTEM_INFORMATION_TYPE_13)) { setverdict(fail, "Cannot have SI13alt and SI13"); + mtc.stop; } if (not cfg.bcch_extended) { f_ensure_si_vec_contains_n_of_m(si_per_tc, 4, SYSTEM_INFORMATION_TYPE_13alt, false, 1, 4); @@ -399,6 +403,7 @@ module Test { f_ensure_si_vec_contains_n_of_m(si_per_tc, 4, SYSTEM_INFORMATION_TYPE_21, true, 1, 4); if (f_si_vecslot_contains(si_per_tc[4], SYSTEM_INFORMATION_TYPE_21)) { setverdict(fail, "Cannot have SI21 on BCCH Norm if BCCH Extd enabled!"); + mtc.stop; } } } @@ -413,6 +418,7 @@ module Test { if (f_si_vec_contains(si_per_tc, SYSTEM_INFORMATION_TYPE_16) or f_si_vec_contains(si_per_tc, SYSTEM_INFORMATION_TYPE_17)) { setverdict(fail, "Cannot have SI16/SI17 and SI22!"); + mtc.stop; } if (not cfg.bcch_extended) { testcase.stop("Error: SI22 requires BCCH Extd!"); @@ -484,6 +490,7 @@ module Test { var SystemInformation si := f_gsmtap_get_si(pt, msg_type); if (not match(si, t)) { setverdict(fail, "SI ", si, " doesn't match ", t); + mtc.stop; } else { setverdict(pass); } -- cgit v1.2.3