aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2022-04-27 17:45:47 +0300
committerVadim Yanitskiy <vyanitskiy@sysmocom.de>2022-05-10 16:30:39 +0300
commit991f3f64d930b249037fb12f63113f727f3666a2 (patch)
tree9ffb8f2d70cf8fbaaa48ff131e33f02c75948324 /tests
parent0ad31d8956e6393147b6102cf2fd30abe14c7e28 (diff)
measurement: move SACCH detection to process_l1sap_meas_data()
SACCH detection can be simplified by checking the RSL Link ID in process_l1sap_meas_data(). This eliminates the need to lookup the multiframe position by calling trx_sched_is_sacch_fn(), which definitely takes more CPU time than just L1SAP_IS_LINK_SACCH(). Calling trx_sched_is_sacch_fn() is still required for BTS models reporting the measurements via PRIM_MPH_INFO (legacy way), separately from the related Uplink blocks. This patch can be summarized as follows: * detect SACCH and set .is_sub=1 in process_l1sap_meas_data(); ** for PRIM_MPH_INFO use trx_sched_is_sacch_fn(); ** for PRIM_PH_DATA use L1SAP_IS_LINK_SACCH(); * do not call trx_sched_is_sacch_fn() from ts45008_83_is_sub(); * modify the unit test - test_ts45008_83_is_sub_single(); ** remove test_ts45008_83_is_sub_is_sacch(). Change-Id: I507e96ee34ac0f8b7a2a6f16a8c7f92bc467df60 Related: SYS#5853
Diffstat (limited to 'tests')
-rw-r--r--tests/meas/meas_test.c35
1 files changed, 3 insertions, 32 deletions
diff --git a/tests/meas/meas_test.c b/tests/meas/meas_test.c
index 79ec3584..a3c514b8 100644
--- a/tests/meas/meas_test.c
+++ b/tests/meas/meas_test.c
@@ -373,28 +373,6 @@ void test_lchan_meas_process_measurement(bool no_sacch, bool dropouts)
}
}
-static bool test_ts45008_83_is_sub_is_sacch(uint32_t fn)
-{
- if (fn % 104 == 12)
- return true;
- if (fn % 104 == 25)
- return true;
- if (fn % 104 == 38)
- return true;
- if (fn % 104 == 51)
- return true;
- if (fn % 104 == 64)
- return true;
- if (fn % 104 == 77)
- return true;
- if (fn % 104 == 90)
- return true;
- if (fn % 104 == 103)
- return true;
-
- return false;
-}
-
static bool test_ts45008_83_is_sub_is_sub(const struct gsm_lchan *lchan, uint32_t fn)
{
fn = fn % 104;
@@ -473,16 +451,9 @@ static void test_ts45008_83_is_sub_single(uint8_t ts, uint8_t ss, bool fr)
* results (false positive and false negative) */
for (i = 0; i < 104 * 100; i++) {
rc = ts45008_83_is_sub(lchan, i);
- if (rc) {
- if (!test_ts45008_83_is_sub_is_sacch(i)
- && !test_ts45008_83_is_sub_is_sub(lchan, i)) {
- printf(" ==> Unexpected SUB frame at fn=%u\n", i);
- }
- } else {
- if (test_ts45008_83_is_sub_is_sacch(i)
- && test_ts45008_83_is_sub_is_sub(lchan, i)) {
- printf(" ==> Unexpected non-SUB frame at fn=%u\n", i);
- }
+ if (rc != test_ts45008_83_is_sub_is_sub(lchan, i)) {
+ printf(" ==> ts45008_83_is_sub(fn=%u) yields %s, expected %s\n",
+ i, rc ? "true" : "false", !rc ? "true" : "false");
}
}
}