Change in osmo-bsc[master]: fix test_gsm48_multirate_config: dump the complete AMR lv buffer

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/+/24001 )


Change subject: fix test_gsm48_multirate_config: dump the complete AMR lv buffer
......................................................................

fix test_gsm48_multirate_config: dump the complete AMR lv buffer

It's acceptable to verify an outcome by printing to an expected output.
It's unacceptable to commit those expected outputs without first
verifying that they are in fact correct!

In this case, the output has obviously not been even read, since the
length byte clearly indicates that one byte is missing from each buffer
dump.

I have now verified by hand against 3GPP TS 44.018 that each one of the
generated octets are indeed correct.

Change-Id: I92fcc7afe018a4a8dc91f0f2167e3a7835f623c9
---
M tests/gsm0408/gsm0408_test.c
M tests/gsm0408/gsm0408_test.ok
2 files changed, 8 insertions(+), 8 deletions(-)



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

diff --git a/tests/gsm0408/gsm0408_test.c b/tests/gsm0408/gsm0408_test.c
index 7545381..9a1d3cf 100644
--- a/tests/gsm0408/gsm0408_test.c
+++ b/tests/gsm0408/gsm0408_test.c
@@ -810,7 +810,7 @@
 	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, lv[0]));
+	       osmo_hexdump_nospc(lv, 1 + lv[0]));
 
 	/* Test #2: 4 active set members, but wrong mode order: */
 	mr.ms_mode[3].mode = 2;
@@ -832,7 +832,7 @@
 	rc = gsm48_multirate_config(lv, gsm48_ie, mr.ms_mode, 3);
 	OSMO_ASSERT(rc == 0);
 	printf("gsm48_multirate_config(): rc=%i, lv=%s\n", rc,
-	       osmo_hexdump_nospc(lv, lv[0]));
+	       osmo_hexdump_nospc(lv, 1 + lv[0]));
 
 	/* Test #4: 3 active set members, but wrong mode order: */
 	mr.ms_mode[0].mode = 2;
@@ -852,7 +852,7 @@
 	rc = gsm48_multirate_config(lv, gsm48_ie, mr.ms_mode, 2);
 	OSMO_ASSERT(rc == 0);
 	printf("gsm48_multirate_config(): rc=%i, lv=%s\n", rc,
-	       osmo_hexdump_nospc(lv, lv[0]));
+	       osmo_hexdump_nospc(lv, 1 + lv[0]));
 
 	/* Test #6: 2 active set members, but wrong mode order: */
 	mr.ms_mode[1].mode = 2;
@@ -870,7 +870,7 @@
 	rc = gsm48_multirate_config(lv, gsm48_ie, mr.ms_mode, 1);
 	OSMO_ASSERT(rc == 0);
 	printf("gsm48_multirate_config(): rc=%i, lv=%s\n", rc,
-	       osmo_hexdump_nospc(lv, lv[0]));
+	       osmo_hexdump_nospc(lv, 1 + lv[0]));
 
 	/* Test #8: 0 active set members: */
 	mr.ms_mode[0].mode = 0;
diff --git a/tests/gsm0408/gsm0408_test.ok b/tests/gsm0408/gsm0408_test.ok
index 7e054f4..f1aa463 100644
--- a/tests/gsm0408/gsm0408_test.ok
+++ b/tests/gsm0408/gsm0408_test.ok
@@ -239,8 +239,8 @@
 test_gsm48_ra_id_by_bts[4]: digits='999999' lac=0xffff=htons(65535) rac=0xff=255 pass
 test_gsm48_ra_id_by_bts[5]: digits='09f909' lac=0xcdab=htons(43981) rac=0xab=171 pass
 test_gsm48_ra_id_by_bts[6]: digits='090990' lac=0xcdab=htons(43981) rac=0xab=171 pass
-gsm48_multirate_config(): rc=0, lv=0620b40bf330
-gsm48_multirate_config(): rc=0, lv=0520340bf3
-gsm48_multirate_config(): rc=0, lv=0420140b
-gsm48_multirate_config(): rc=0, lv=0220
+gsm48_multirate_config(): rc=0, lv=0620b40bf330d8
+gsm48_multirate_config(): rc=0, lv=0520340bf330
+gsm48_multirate_config(): rc=0, lv=0420140bf0
+gsm48_multirate_config(): rc=0, lv=022004
 Done.

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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I92fcc7afe018a4a8dc91f0f2167e3a7835f623c9
Gerrit-Change-Number: 24001
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/bab82b98/attachment.htm>


More information about the gerrit-log mailing list