fixeria has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/libosmocore/+/28147 )


Change subject: tests/dtx: test tagging of FACCH/[FH] frames
......................................................................

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
---
M tests/dtx/dtx_gsm0503_test.c
M tests/dtx/dtx_gsm0503_test.ok
2 files changed, 31 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/47/28147/1

diff --git a/tests/dtx/dtx_gsm0503_test.c b/tests/dtx/dtx_gsm0503_test.c
index 4ee5bf7..fe4577e 100644
--- a/tests/dtx/dtx_gsm0503_test.c
+++ b/tests/dtx/dtx_gsm0503_test.c
@@ -215,6 +215,32 @@
                                         "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 @@
        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 5f49cb0..750b440 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=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)

--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/28147
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I3d295a15d4446b3e440fbf4c90a1688d6c7275ae
Gerrit-Change-Number: 28147
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <[email protected]>
Gerrit-MessageType: newchange

Reply via email to