aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2021-06-02 20:13:39 +0000
committerNeels Hofmeyr <neels@hofmeyr.de>2021-06-10 16:15:35 +0200
commit43aeeaf05ad814ccab0e93227b1248a20302c8ec (patch)
treea8bd98ff6e3a62dbfb4a9072e96b7f5b5a4a60b1 /tests
parente324badbb989e9b389750d9a052f528af1b4f4b8 (diff)
RSL chan_nr: replace OSMO_ASSERT with error handling
It's bad to abort the program for an incompatible chan_nr. Instead of OSMO_ASSERT(), make sure that error handling happens all they way to the original callers of gsm_lchan2chan_nr etc. This is also preparation to add further error causes: Osmocom specific cbits needed for a non-Osmo BTS. Related: SYS#5315 OS#4940 Change-Id: I71ed6437c403a3f9336e17a94b4948fca295d853
Diffstat (limited to 'tests')
-rw-r--r--tests/handover/handover_test.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/handover/handover_test.c b/tests/handover/handover_test.c
index e65392038..b741e2523 100644
--- a/tests/handover/handover_test.c
+++ b/tests/handover/handover_test.c
@@ -100,10 +100,11 @@ static void gen_meas_rep(struct gsm_lchan *lchan,
{
struct msgb *msg = msgb_alloc_headroom(256, 64, "RSL");
struct abis_rsl_dchan_hdr *dh;
- uint8_t chan_nr = gsm_lchan2chan_nr(lchan);
uint8_t ulm[3], l1i[2], *buf;
struct gsm48_hdr *gh;
struct gsm48_meas_res *mr;
+ int chan_nr = gsm_lchan2chan_nr(lchan);
+ OSMO_ASSERT(chan_nr >= 0);
dh = (struct abis_rsl_dchan_hdr *) msgb_put(msg, sizeof(*dh));
dh->c.msg_discr = ABIS_RSL_MDISC_DED_CHAN;