aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2022-05-18 02:23:25 +0300
committerVadim Yanitskiy <vyanitskiy@sysmocom.de>2022-05-19 20:25:53 +0300
commit32aff359ae4472f745691d603410ec42c37e5bf6 (patch)
treeed0647f9029a48a68854337718b6b19558891a45 /tests
parentf673fd59c1cd48994d5e1ee221f67fe0e4b72503 (diff)
tests/dtx: test tagging of FACCH/[FH] frames
This patch adds a new test confirming that [1] actually fixes the bug. Change-Id: I3d295a15d4446b3e440fbf4c90a1688d6c7275ae Related: [1] I2e6f4b748c6445725211e264ab5f3f5a2712087a Related: SYS#5853
Diffstat (limited to 'tests')
-rw-r--r--tests/dtx/dtx_gsm0503_test.c27
-rw-r--r--tests/dtx/dtx_gsm0503_test.ok4
2 files changed, 31 insertions, 0 deletions
diff --git a/tests/dtx/dtx_gsm0503_test.c b/tests/dtx/dtx_gsm0503_test.c
index 4ee5bf7f..fe4577e5 100644
--- a/tests/dtx/dtx_gsm0503_test.c
+++ b/tests/dtx/dtx_gsm0503_test.c
@@ -215,6 +215,32 @@ static void test_gsm0503_tch_afhs_decode_dtx_sid_update(void)
"detection/decoding of AHS_SID_UPDATE");
}
+static void test_gsm0503_tch_afhs_decode_dtx_facch(void)
+{
+ enum gsm0503_amr_dtx_frames amr_last_dtx;
+ sbit_t bursts[BURST_PLEN * 8]; /* 8 bursts */
+ unsigned int i;
+
+ /* Set stealing bits to provoke FACCH/[FH] detection */
+ for (i = 0; i < 8; i++) {
+ sbit_t *burst = &bursts[BURST_PLEN * i];
+ memset(&burst[0], 0, BURST_PLEN);
+ burst[i >> 2 ? 57 : 58] = -127;
+ }
+
+ amr_last_dtx = AFS_SID_UPDATE;
+ test_gsm0503_tch_afhs_decode_dtx(&bursts[0], BURST_PLEN * 0,
+ &amr_last_dtx, true /* AFS */,
+ "tagging of FACCH/F");
+ OSMO_ASSERT(amr_last_dtx == AMR_OTHER);
+
+ amr_last_dtx = AHS_SID_UPDATE;
+ test_gsm0503_tch_afhs_decode_dtx(&bursts[0], BURST_PLEN * 0,
+ &amr_last_dtx, false /* AHS */,
+ "tagging of FACCH/H");
+ OSMO_ASSERT(amr_last_dtx == AMR_OTHER);
+}
+
int main(int argc, char **argv)
{
printf("FR AMR DTX FRAMES:\n");
@@ -230,6 +256,7 @@ int main(int argc, char **argv)
test_gsm0503_detect_ahs_dtx_frame(sample_sid_update_inh_frame);
test_gsm0503_tch_afhs_decode_dtx_sid_update();
+ test_gsm0503_tch_afhs_decode_dtx_facch();
return EXIT_SUCCESS;
}
diff --git a/tests/dtx/dtx_gsm0503_test.ok b/tests/dtx/dtx_gsm0503_test.ok
index 5f49cb08..750b4401 100644
--- a/tests/dtx/dtx_gsm0503_test.ok
+++ b/tests/dtx/dtx_gsm0503_test.ok
@@ -21,3 +21,7 @@ Running test_gsm0503_tch_afhs_decode_dtx(at offset=232): testing detection/decod
Running test_gsm0503_tch_afhs_decode_dtx(at offset=464): testing detection/decoding of AHS_SID_UPDATE
==> gsm0503_tch_ahs_decode_dtx() yields 'AHS_SID_UPDATE_CN (audio)' (rc=5, BER 106/212)
====> tch_data[] = { 6003ccb270 }
+Running test_gsm0503_tch_afhs_decode_dtx(at offset=0): testing tagging of FACCH/F
+ ==> gsm0503_tch_afs_decode_dtx() yields 'AMR_OTHER (audio)' (rc=-1, BER 456/456)
+Running test_gsm0503_tch_afhs_decode_dtx(at offset=0): testing tagging of FACCH/H
+ ==> gsm0503_tch_ahs_decode_dtx() yields 'AMR_OTHER (audio)' (rc=-1, BER 456/456)