aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2018-02-06 17:55:19 +0100
committerMax <msuraev@sysmocom.de>2018-02-07 12:07:59 +0100
commit6817190efd5276cc6e744c08bb24f79f884029a5 (patch)
tree5cfc2dfa6f00f4a80523aae54cab91c795612690 /tests
parentd5feadeee8dd24f991df2892d6bcf0be8b0cf707 (diff)
VLR tests: don't fail via assert
Don't fail tests using thwart_rx_non_initial_requests() via OSMO_ASSERT. Instead log extended error which will fail the test eventually but allows to gather additional info helpful for debugging. Change-Id: I2607cb1ac60941dbc22fca532ed2b3738bfbcc63 Related: OS#2864
Diffstat (limited to 'tests')
-rw-r--r--tests/msc_vlr/msc_vlr_tests.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c
index 0d4656e7f..f373f1ea9 100644
--- a/tests/msc_vlr/msc_vlr_tests.c
+++ b/tests/msc_vlr/msc_vlr_tests.c
@@ -268,13 +268,22 @@ static int ms_sends_msg_fake(uint8_t pdisc, uint8_t msg_type)
return rc;
}
+static inline void ms_msg_log_err(uint8_t val, uint8_t msgtype)
+{
+ int rc = ms_sends_msg_fake(val, msgtype);
+ if (rc != -EACCES)
+ log("Unexpected return value %u != %u for %s/%s",
+ -rc, -EACCES, gsm48_pdisc_name(val), gsm48_cc_msg_name(msgtype));
+}
+
void thwart_rx_non_initial_requests()
{
log("requests shall be thwarted");
- OSMO_ASSERT(ms_sends_msg_fake(GSM48_PDISC_CC, GSM48_MT_CC_SETUP) == -EACCES);
- OSMO_ASSERT(ms_sends_msg_fake(GSM48_PDISC_MM, 0x33 /* nonexistent */) == -EACCES);
- OSMO_ASSERT(ms_sends_msg_fake(GSM48_PDISC_RR, GSM48_MT_RR_SYSINFO_1) == -EACCES);
- OSMO_ASSERT(ms_sends_msg_fake(GSM48_PDISC_SMS, GSM411_MT_CP_DATA) == -EACCES);
+
+ ms_msg_log_err(GSM48_PDISC_CC, GSM48_MT_CC_SETUP);
+ ms_msg_log_err(GSM48_PDISC_MM, 0x33); /* nonexistent */
+ ms_msg_log_err(GSM48_PDISC_RR, GSM48_MT_RR_SYSINFO_1);
+ ms_msg_log_err(GSM48_PDISC_SMS, GSM411_MT_CP_DATA);
}
void send_sms(struct vlr_subscr *receiver,