diff options
author | Philipp Maier <pmaier@sysmocom.de> | 2018-09-06 17:21:02 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2018-09-13 14:27:12 +0000 |
commit | 27a86005f34e5ccc2f31aadefec916ffb4476d17 (patch) | |
tree | 42f0b91cc49508fb8d3e6b9ac35e4d399a4fc124 /tests | |
parent | c78759055a223b9f48bdfd5523a9825e16cf0658 (diff) |
measurement: fix unit-test test_lchan_meas_process_measurement
The unit test that tests lchan_meas_process_measurement() only inputs
test data to lchan_meas_process_measurement() but it is not checked if
the interval end could be detected or not.
- Add a return code to lchan_meas_process_measurement()
- Ensure that the return code is checked in the unit-test
Change-Id: I9e00ce683e8c44528804f65181dbfed9e85e3aed
Related: OS#2975
Diffstat (limited to 'tests')
-rw-r--r-- | tests/meas/meas_test.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/meas/meas_test.c b/tests/meas/meas_test.c index 8f504795..d4f3fe68 100644 --- a/tests/meas/meas_test.c +++ b/tests/meas/meas_test.c @@ -315,6 +315,7 @@ void test_lchan_meas_process_measurement(bool no_sacch, bool dropouts) unsigned int fn = 0; unsigned int fn104; struct bts_ul_meas ulm; + int rc; printf("\n\n"); printf("===========================================================\n"); @@ -347,7 +348,8 @@ void test_lchan_meas_process_measurement(bool no_sacch, bool dropouts) if (dropouts == false || i % 4) { if (ulm.is_sub == 1) printf("(now adding SUB measurement sample %u)\n", fn); - lchan_meas_process_measurement(lchan, &ulm, fn); + rc = lchan_meas_process_measurement(lchan, &ulm, fn); + OSMO_ASSERT(rc == 0); } else if (ulm.is_sub == 1) printf("(leaving out SUB measurement sample for frame number %u)\n", fn); else @@ -363,7 +365,8 @@ void test_lchan_meas_process_measurement(bool no_sacch, bool dropouts) if (fn % 104 == 39 && no_sacch == false) { printf("(now adding SUB measurement sample for SACCH block at frame number %u)\n", fn); ulm.is_sub = 1; - lchan_meas_process_measurement(lchan, &ulm, fn - 1); + rc = lchan_meas_process_measurement(lchan, &ulm, fn - 1); + OSMO_ASSERT(rc); } else if (fn % 104 == 39 && no_sacch == true) printf("(leaving out SUB measurement sample for SACCH block at frame number %u)\n", fn); } |