diff options
author | Philipp Maier <pmaier@sysmocom.de> | 2019-03-01 10:40:48 +0100 |
---|---|---|
committer | Philipp Maier <pmaier@sysmocom.de> | 2019-03-11 09:08:31 +0100 |
commit | 94d79fdeef612bcc3216813e5d6ef3eaf6f652b1 (patch) | |
tree | 2ba0273c322f78b707ab9954e303bf92fac8a276 /tests | |
parent | 3713af865503f78ad1a49604dc5d39908b94b2be (diff) |
gsm0808_utils: fix gsm48 multirate to S-bit converter
The function gsm0808_sc_cfg_from_gsm48_mr_cfg() is used to convert a
gsm48 multirate struct into a set of S-bits (S0 to S15). However, the
conversion function currently does not take into account that bit S1
actually stands for four rates at once (Config-NB-Code = 1). Lets make
sure that S1 is only set when the multirate configuration permits all
four required rates.
Change-Id: I6ad531d4e70c2252e32e2bbaca8e14a7ec6d9840
Related: SYS#4470
Diffstat (limited to 'tests')
-rw-r--r-- | tests/gsm0808/gsm0808_test.c | 21 | ||||
-rw-r--r-- | tests/gsm0808/gsm0808_test.ok | 66 |
2 files changed, 68 insertions, 19 deletions
diff --git a/tests/gsm0808/gsm0808_test.c b/tests/gsm0808/gsm0808_test.c index 87f5d2a5..8f1e2993 100644 --- a/tests/gsm0808/gsm0808_test.c +++ b/tests/gsm0808/gsm0808_test.c @@ -1902,6 +1902,27 @@ static void test_gsm0808_sc_cfg_from_gsm48_mr_cfg(void) cfg.m10_2 = 1; cfg.m12_2 = 1; test_gsm0808_sc_cfg_from_gsm48_mr_cfg_single(&cfg); + + cfg.m4_75 = 1; + cfg.m5_15 = 0; + cfg.m5_90 = 1; + cfg.m6_70 = 0; + cfg.m7_40 = 1; + cfg.m7_95 = 0; + cfg.m10_2 = 0; + cfg.m12_2 = 1; + test_gsm0808_sc_cfg_from_gsm48_mr_cfg_single(&cfg); + + cfg.m4_75 = 1; + cfg.m5_15 = 0; + cfg.m5_90 = 1; + cfg.m6_70 = 0; + cfg.m7_40 = 1; + cfg.m7_95 = 0; + cfg.m10_2 = 0; + cfg.m12_2 = 0; + test_gsm0808_sc_cfg_from_gsm48_mr_cfg_single(&cfg); + } static void test_gsm48_mr_cfg_from_gsm0808_sc_cfg_single(uint16_t s15_s0) diff --git a/tests/gsm0808/gsm0808_test.ok b/tests/gsm0808/gsm0808_test.ok index 9fce0e8e..b620e369 100644 --- a/tests/gsm0808/gsm0808_test.ok +++ b/tests/gsm0808/gsm0808_test.ok @@ -110,9 +110,9 @@ Input: m10_2= 0 m12_2= 0 Result (fr): - S15-S0 = 5703 = 0b0101011100000011 + S15-S0 = 5701 = 0b0101011100000001 Result (hr): - S15-S0 = 0703 = 0b0000011100000011 + S15-S0 = 0701 = 0b0000011100000001 Input: m4_75= 0 smod= 0 @@ -138,9 +138,9 @@ Input: m10_2= 0 m12_2= 0 Result (fr): - S15-S0 = 5706 = 0b0101011100000110 + S15-S0 = 5704 = 0b0101011100000100 Result (hr): - S15-S0 = 0706 = 0b0000011100000110 + S15-S0 = 0704 = 0b0000011100000100 Input: m4_75= 0 smod= 0 @@ -166,9 +166,9 @@ Input: m10_2= 0 m12_2= 0 Result (fr): - S15-S0 = 0412 = 0b0000010000010010 + S15-S0 = 0410 = 0b0000010000010000 Result (hr): - S15-S0 = 0412 = 0b0000010000010010 + S15-S0 = 0410 = 0b0000010000010000 Input: m4_75= 0 smod= 0 @@ -208,9 +208,9 @@ Input: m10_2= 0 m12_2= 1 Result (fr): - S15-S0 = 4082 = 0b0100000010000010 + S15-S0 = 4080 = 0b0100000010000000 Result (hr): - S15-S0 = 0002 = 0b0000000000000010 + S15-S0 = 0000 = 0b0000000000000000 Input: m4_75= 1 smod= 0 @@ -222,9 +222,9 @@ Input: m10_2= 0 m12_2= 0 Result (fr): - S15-S0 = 570f = 0b0101011100001111 + S15-S0 = 570d = 0b0101011100001101 Result (hr): - S15-S0 = 070f = 0b0000011100001111 + S15-S0 = 070d = 0b0000011100001101 Input: m4_75= 0 smod= 0 @@ -236,9 +236,9 @@ Input: m10_2= 1 m12_2= 1 Result (fr): - S15-S0 = 54f2 = 0b0101010011110010 + S15-S0 = 54f0 = 0b0101010011110000 Result (hr): - S15-S0 = 0432 = 0b0000010000110010 + S15-S0 = 0430 = 0b0000010000110000 Input: m4_75= 0 smod= 0 @@ -250,9 +250,9 @@ Input: m10_2= 1 m12_2= 1 Result (fr): - S15-S0 = 57ce = 0b0101011111001110 + S15-S0 = 57cc = 0b0101011111001100 Result (hr): - S15-S0 = 070e = 0b0000011100001110 + S15-S0 = 070c = 0b0000011100001100 Input: m4_75= 1 smod= 0 @@ -264,9 +264,9 @@ Input: m10_2= 0 m12_2= 0 Result (fr): - S15-S0 = 5733 = 0b0101011100110011 + S15-S0 = 5731 = 0b0101011100110001 Result (hr): - S15-S0 = 0733 = 0b0000011100110011 + S15-S0 = 0731 = 0b0000011100110001 Input: m4_75= 0 smod= 0 @@ -278,9 +278,9 @@ Input: m10_2= 0 m12_2= 1 Result (fr): - S15-S0 = 56aa = 0b0101011010101010 + S15-S0 = 56a8 = 0b0101011010101000 Result (hr): - S15-S0 = 062a = 0b0000011000101010 + S15-S0 = 0628 = 0b0000011000101000 Input: m4_75= 1 smod= 0 @@ -292,7 +292,7 @@ Input: m10_2= 1 m12_2= 0 Result (fr): - S15-S0 = 5757 = 0b0101011101010111 + S15-S0 = 5755 = 0b0101011101010101 Result (hr): S15-S0 = 0717 = 0b0000011100010111 @@ -310,6 +310,34 @@ Result (fr): Result (hr): S15-S0 = 073f = 0b0000011100111111 +Input: + m4_75= 1 smod= 0 + m5_15= 0 spare= 0 + m5_90= 1 icmi= 0 + m6_70= 0 nscb= 0 + m7_40= 1 ver= 0 + m7_95= 0 + m10_2= 0 + m12_2= 1 +Result (fr): + S15-S0 = 5797 = 0b0101011110010111 +Result (hr): + S15-S0 = 0717 = 0b0000011100010111 + +Input: + m4_75= 1 smod= 0 + m5_15= 0 spare= 0 + m5_90= 1 icmi= 0 + m6_70= 0 nscb= 0 + m7_40= 1 ver= 0 + m7_95= 0 + m10_2= 0 + m12_2= 0 +Result (fr): + S15-S0 = 5715 = 0b0101011100010101 +Result (hr): + S15-S0 = 0717 = 0b0000011100010111 + Testing gsm48_mr_cfg_from_gsm0808_sc_cfg(): Input: S15-S0 = ff03 = 0b1111111100000011 |