aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2021-04-30 16:32:12 +0200
committerneels <nhofmeyr@sysmocom.de>2021-05-03 13:21:55 +0000
commit377aac83bb31b876f02670b36097ab6a8d442b38 (patch)
tree4a06f21bdeb7e72be0127c245a1fb3f816dac72f /tests
parent858401b04e0ce665e0ab797e61f4c71bffb82bb1 (diff)
test_gsm48_multirate_config: rather keep 4x amr_mode
In osmo-bsc, gsm48_multirate_config() is used in a way where the struct amr_mode *modes always points at the full set of configured modes, and only the AMR bits m4_75 thru m12_2 are unset to filter the used modes. In the current test, the bits are unset to filter, but also the struct amr_mode *modes is reduced accordingly. Instead, keep the modes fully populated and unset only bits, like osmo-bsc does in practice. The test results should not (and do not) differ. Change-Id: I545de6fb66a4b74a3f08899795b4b4d9c4538f58
Diffstat (limited to 'tests')
-rw-r--r--tests/gsm0408/gsm0408_test.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/tests/gsm0408/gsm0408_test.c b/tests/gsm0408/gsm0408_test.c
index 9a1d3cf48..8220c4fc5 100644
--- a/tests/gsm0408/gsm0408_test.c
+++ b/tests/gsm0408/gsm0408_test.c
@@ -824,12 +824,12 @@ static void test_gsm48_multirate_config()
mr.ms_mode[0].mode = 2;
mr.ms_mode[1].mode = 4;
mr.ms_mode[2].mode = 5;
- mr.ms_mode[3].mode = 0;
+ mr.ms_mode[3].mode = 7;
gsm48_ie->m12_2 = 0;
mr.ms_mode[2].threshold = 0;
mr.ms_mode[2].hysteresis = 0;
- rc = gsm48_multirate_config(lv, gsm48_ie, mr.ms_mode, 3);
+ rc = gsm48_multirate_config(lv, gsm48_ie, mr.ms_mode, 4);
OSMO_ASSERT(rc == 0);
printf("gsm48_multirate_config(): rc=%i, lv=%s\n", rc,
osmo_hexdump_nospc(lv, 1 + lv[0]));
@@ -838,18 +838,19 @@ static void test_gsm48_multirate_config()
mr.ms_mode[0].mode = 2;
mr.ms_mode[2].mode = 4;
mr.ms_mode[1].mode = 5;
- rc = gsm48_multirate_config(lv, gsm48_ie, mr.ms_mode, 3);
+ rc = gsm48_multirate_config(lv, gsm48_ie, mr.ms_mode, 4);
OSMO_ASSERT(rc == -EINVAL);
/* Test #5: Normal configuration with 2 active set members */
mr.ms_mode[0].mode = 2;
mr.ms_mode[1].mode = 4;
- mr.ms_mode[2].mode = 0;
+ mr.ms_mode[2].mode = 5;
+ mr.ms_mode[3].mode = 7;
gsm48_ie->m7_95 = 0;
mr.ms_mode[1].threshold = 0;
mr.ms_mode[1].hysteresis = 0;
- rc = gsm48_multirate_config(lv, gsm48_ie, mr.ms_mode, 2);
+ rc = gsm48_multirate_config(lv, gsm48_ie, mr.ms_mode, 4);
OSMO_ASSERT(rc == 0);
printf("gsm48_multirate_config(): rc=%i, lv=%s\n", rc,
osmo_hexdump_nospc(lv, 1 + lv[0]));
@@ -857,24 +858,26 @@ static void test_gsm48_multirate_config()
/* Test #6: 2 active set members, but wrong mode order: */
mr.ms_mode[1].mode = 2;
mr.ms_mode[0].mode = 4;
- rc = gsm48_multirate_config(lv, gsm48_ie, mr.ms_mode, 2);
+ rc = gsm48_multirate_config(lv, gsm48_ie, mr.ms_mode, 4);
OSMO_ASSERT(rc == -EINVAL);
/* Test #7: Normal configuration with 1 active set member */
mr.ms_mode[0].mode = 2;
- mr.ms_mode[1].mode = 0;
+ mr.ms_mode[1].mode = 4;
+ mr.ms_mode[2].mode = 5;
+ mr.ms_mode[3].mode = 7;
gsm48_ie->m7_40 = 0;
mr.ms_mode[0].threshold = 0;
mr.ms_mode[0].hysteresis = 0;
- rc = gsm48_multirate_config(lv, gsm48_ie, mr.ms_mode, 1);
+ rc = gsm48_multirate_config(lv, gsm48_ie, mr.ms_mode, 4);
OSMO_ASSERT(rc == 0);
printf("gsm48_multirate_config(): rc=%i, lv=%s\n", rc,
osmo_hexdump_nospc(lv, 1 + lv[0]));
/* Test #8: 0 active set members: */
mr.ms_mode[0].mode = 0;
- rc = gsm48_multirate_config(lv, gsm48_ie, mr.ms_mode, 1);
+ rc = gsm48_multirate_config(lv, gsm48_ie, mr.ms_mode, 4);
OSMO_ASSERT(rc == -EINVAL);
}