laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/35615?usp=email )

Change subject: tests/gsm0408: add two more samples to bcap_tests[]
......................................................................

tests/gsm0408: add two more samples to bcap_tests[]

The mismatch for bcap_csd_2400_v22bis is expected, because octet 4
is not represented in 'struct gsm_mncc_bearer_cap' and the encoder
unconditionally hard-codes it to 0x88.

Change-Id: I4fc519c02b4fad8b0f40fa649d9de14b1183d10d
Related: OS#4396, OS#4394
---
M tests/gsm0408/gsm0408_test.c
M tests/gsm0408/gsm0408_test.err
M tests/gsm0408/gsm0408_test.ok
3 files changed, 67 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved




diff --git a/tests/gsm0408/gsm0408_test.c b/tests/gsm0408/gsm0408_test.c
index 9f92e29..8a89357 100644
--- a/tests/gsm0408/gsm0408_test.c
+++ b/tests/gsm0408/gsm0408_test.c
@@ -53,6 +53,50 @@
        },
 };

+static const uint8_t csd_4800_rlp_lv[] = { 0x07, 0xa1, 0x88, 0x89, 0x21, 0x14, 
0x63, 0xa0 };
+
+static const struct gsm_mncc_bearer_cap bcap_csd_4800_rlp = {
+       .transfer       = GSM48_BCAP_ITCAP_UNR_DIG_INF,
+       .mode           = GSM48_BCAP_TMOD_CIRCUIT,
+       .coding         = GSM48_BCAP_CODING_GSM_STD,
+       .radio          = GSM48_BCAP_RRQ_FR_ONLY,
+       .speech_ver[0]  = -1,
+       .data = {
+               .rate_adaption  = GSM48_BCAP_RA_V110_X30,
+               .sig_access     = GSM48_BCAP_SA_I440_I450,
+               .async          = 1,
+               .nr_stop_bits   = 1,
+               .nr_data_bits   = 8,
+               .user_rate      = GSM48_BCAP_UR_4800,
+               .parity         = GSM48_BCAP_PAR_NONE,
+               .interm_rate    = GSM48_BCAP_IR_16k,
+               .transp         = GSM48_BCAP_TR_RLP,
+               .modem_type     = GSM48_BCAP_MT_NONE,
+       },
+};
+
+static const uint8_t csd_2400_v22bis_lv[] = { 0x07, 0xa2, 0xb8, 0x81, 0x21, 
0x13, 0x43, 0x83 };
+
+static const struct gsm_mncc_bearer_cap bcap_csd_2400_v22bis = {
+       .transfer       = GSM48_BCAP_ITCAP_3k1_AUDIO,
+       .mode           = GSM48_BCAP_TMOD_CIRCUIT,
+       .coding         = GSM48_BCAP_CODING_GSM_STD,
+       .radio          = GSM48_BCAP_RRQ_FR_ONLY,
+       .speech_ver[0]  = -1,
+       .data = {
+               .rate_adaption  = GSM48_BCAP_RA_NONE,
+               .sig_access     = GSM48_BCAP_SA_I440_I450,
+               .async          = 1,
+               .nr_stop_bits   = 1,
+               .nr_data_bits   = 8,
+               .user_rate      = GSM48_BCAP_UR_2400,
+               .parity         = GSM48_BCAP_PAR_NONE,
+               .interm_rate    = GSM48_BCAP_IR_8k,
+               .transp         = GSM48_BCAP_TR_TRANSP,
+               .modem_type     = GSM48_BCAP_MT_V22bis,
+       },
+};
+
 static const uint8_t speech_all_lv[] = { 0x06, 0x60, 0x04, 0x02, 0x00, 0x05, 
0x81 };

 static const struct gsm_mncc_bearer_cap bcap_speech_all = {
@@ -86,6 +130,10 @@

 static const struct bcap_test bcap_tests[] = {
        { csd_9600_v110_lv, &bcap_csd_9600_v110, "CSD 9600/V.110/transparent" },
+       { csd_4800_rlp_lv, &bcap_csd_4800_rlp, "CSD 4800/RLP/non-transparent" },
+       { /* XXX: this testcase is expected to fail because octet 4 is not 
represented in
+          * 'struct gsm_mncc_bearer_cap' and the encoder unconditionally 
hard-codes it to 0x88. */
+         csd_2400_v22bis_lv, &bcap_csd_2400_v22bis, "CSD 
2400/V.22bis/transparent" },
        { speech_all_lv, &bcap_speech_all, "Speech, all codecs" },
        { speech_no3a_lv, &bcap_speech_no3a, "Speech, without octet 3a" },
 };
diff --git a/tests/gsm0408/gsm0408_test.err b/tests/gsm0408/gsm0408_test.err
index 8aeda3e..0102de0 100644
--- a/tests/gsm0408/gsm0408_test.err
+++ b/tests/gsm0408/gsm0408_test.err
@@ -1,3 +1,6 @@
+Incorrect encoded result of CSD 2400/V.22bis/transparent:
+ should: 07 a2 b8 81 21 13 43 83
+ is:     07 a2 88 81 21 13 43 83
 Incorrect encoded result of Speech, without octet 3a:
  should: 01 a0
  is:     02 20 80
diff --git a/tests/gsm0408/gsm0408_test.ok b/tests/gsm0408/gsm0408_test.ok
index b966865..721e2c5 100644
--- a/tests/gsm0408/gsm0408_test.ok
+++ b/tests/gsm0408/gsm0408_test.ok
@@ -1,4 +1,6 @@
 Test `CSD 9600/V.110/transparent' passed
+Test `CSD 4800/RLP/non-transparent' passed
+Test `CSD 2400/V.22bis/transparent' failed
 Test `Speech, all codecs' passed
 Test `Speech, without octet 3a' failed
 Simple TMSI encoding test....passed

--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/35615?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I4fc519c02b4fad8b0f40fa649d9de14b1183d10d
Gerrit-Change-Number: 35615
Gerrit-PatchSet: 3
Gerrit-Owner: fixeria <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>
Gerrit-MessageType: merged

Reply via email to