Change in osmo-bsc[master]: test_gsm48_multirate_config: rather keep 4x amr_mode

neels gerrit-no-reply at lists.osmocom.org
Fri Apr 30 15:18:50 UTC 2021


neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/24002 )


Change subject: test_gsm48_multirate_config: rather keep 4x amr_mode
......................................................................

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
---
M tests/gsm0408/gsm0408_test.c
1 file changed, 12 insertions(+), 9 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/02/24002/1

diff --git a/tests/gsm0408/gsm0408_test.c b/tests/gsm0408/gsm0408_test.c
index 9a1d3cf..8220c4f 100644
--- a/tests/gsm0408/gsm0408_test.c
+++ b/tests/gsm0408/gsm0408_test.c
@@ -824,12 +824,12 @@
 	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 @@
 	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 @@
 	/* 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);
 }
 

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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I545de6fb66a4b74a3f08899795b4b4d9c4538f58
Gerrit-Change-Number: 24002
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210430/5c97f96d/attachment.htm>


More information about the gerrit-log mailing list