aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2021-04-30 16:32:12 +0200
committerNeels Hofmeyr <neels@hofmeyr.de>2021-04-30 17:18:39 +0200
commit552b4f3c0cf790d49fd73dda85f12e2888b8bf8a (patch)
tree276b9c6b11568b1e2fca4cbb21d99b7bff431317
parent496274b4eee9c843a68aaca8a32112665727bbba (diff)
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
-rw-r--r--tests/gsm0408/gsm0408_test.c8
-rw-r--r--tests/gsm0408/gsm0408_test.ok8
2 files changed, 8 insertions, 8 deletions
diff --git a/tests/gsm0408/gsm0408_test.c b/tests/gsm0408/gsm0408_test.c
index 754538104..9a1d3cf48 100644
--- a/tests/gsm0408/gsm0408_test.c
+++ b/tests/gsm0408/gsm0408_test.c
@@ -810,7 +810,7 @@ static void test_gsm48_multirate_config()
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 @@ static void test_gsm48_multirate_config()
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 @@ static void test_gsm48_multirate_config()
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 @@ static void test_gsm48_multirate_config()
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 7e054f48e..f1aa46301 100644
--- a/tests/gsm0408/gsm0408_test.ok
+++ b/tests/gsm0408/gsm0408_test.ok
@@ -239,8 +239,8 @@ test_gsm48_ra_id_by_bts[3]: digits='000000' lac=0x0000=htons(0) rac=0x00=0 pass
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.