This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
Max gerrit-no-reply at lists.osmocom.orgHello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5063 to look at the new patch set (#2). Cleanup coding test * remove duplicate code: use function from libosmocore * use utility function to dump ubits * reformat for easier reading * link against libosmocore Change-Id: I8c31b0954176a2c53305936a025c92a793b6d9b6 --- M tests/Makefile.am M tests/coding/coding_test.c 2 files changed, 53 insertions(+), 98 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/63/5063/2 diff --git a/tests/Makefile.am b/tests/Makefile.am index e11092d..c609d6a 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -165,7 +165,7 @@ socket_socket_test_SOURCES = socket/socket_test.c coding_coding_test_SOURCES = coding/coding_test.c -coding_coding_test_LDADD = \ +coding_coding_test_LDADD = $(LDADD) \ $(top_builddir)/src/gsm/libosmogsm.la \ $(top_builddir)/src/codec/libosmocodec.la \ $(top_builddir)/src/coding/libosmocoding.la diff --git a/tests/coding/coding_test.c b/tests/coding/coding_test.c index 9a00f0d..c0f0d4b 100644 --- a/tests/coding/coding_test.c +++ b/tests/coding/coding_test.c @@ -40,27 +40,6 @@ /* set condition to 1, to show debugging */ #define printd if (0) printf -static int ubits2sbits(ubit_t *ubits, sbit_t *sbits, int count) -{ - int i; - - for (i = 0; i < count; i++) { - if (*ubits == 0x23) { - ubits++; - sbits++; - continue; - } - - if ((*ubits++) & 1) { - *sbits++ = -127; - } else { - *sbits++ = 127; - } - } - - return count; -} - static void test_xcch(uint8_t *l2) { uint8_t result[23]; @@ -73,21 +52,17 @@ gsm0503_xcch_encode(bursts_u, l2); /* Prepare soft-bits */ - ubits2sbits(bursts_u, bursts_s, 116 * 4); + osmo_ubit2sbit(bursts_s, bursts_u, 116 * 4); printd("U-Bits:\n"); - printd("%s %02x %02x ", osmo_hexdump(bursts_u, 57), - bursts_u[57], bursts_u[58]); - printd("%s\n", osmo_hexdump(bursts_u + 59, 57)); - printd("%s %02x %02x ", osmo_hexdump(bursts_u + 116, 57), - bursts_u[57 + 116], bursts_u[58 + 116]); - printd("%s\n", osmo_hexdump(bursts_u + 59 + 116, 57)); - printd("%s %02x %02x ", osmo_hexdump(bursts_u + 232, 57), - bursts_u[57 + 232], bursts_u[58 + 232]); - printd("%s\n", osmo_hexdump(bursts_u + 59 + 232, 57)); - printd("%s %02x %02x ", osmo_hexdump(bursts_u + 348, 57), - bursts_u[57 + 348], bursts_u[58 + 348]); - printd("%s\n", osmo_hexdump(bursts_u + 59 + 348, 57)); + printd("%s %02x %02x ", osmo_ubit_dump(bursts_u, 57), bursts_u[57], bursts_u[58]); + printd("%s\n", osmo_ubit_dump(bursts_u + 59, 57)); + printd("%s %02x %02x ", osmo_ubit_dump(bursts_u + 116, 57), bursts_u[57 + 116], bursts_u[58 + 116]); + printd("%s\n", osmo_ubit_dump(bursts_u + 59 + 116, 57)); + printd("%s %02x %02x ", osmo_ubit_dump(bursts_u + 232, 57), bursts_u[57 + 232], bursts_u[58 + 232]); + printd("%s\n", osmo_ubit_dump(bursts_u + 59 + 232, 57)); + printd("%s %02x %02x ", osmo_ubit_dump(bursts_u + 348, 57), bursts_u[57 + 348], bursts_u[58 + 348]); + printd("%s\n", osmo_ubit_dump(bursts_u + 59 + 348, 57)); printd("S-Bits:\n"); printd("%s %02x %02x ", osmo_hexdump((uint8_t *)bursts_s, 57), @@ -130,10 +105,9 @@ gsm0503_rach_encode(bursts_u, &ra, bsic); /* Prepare soft-bits */ - ubits2sbits(bursts_u, bursts_s, 36); + osmo_ubit2sbit(bursts_s, bursts_u, 36); - printd("U-Bits:\n"); - printd("%s\n", osmo_hexdump(bursts_u, 36)); + printd("U-Bits: %s\n", osmo_ubit_dump(bursts_u, 36)); printd("S-Bits:\n"); printd("%s\n", osmo_hexdump((uint8_t *)bursts_s, 36)); @@ -165,10 +139,9 @@ gsm0503_sch_encode(bursts_u, info); /* Prepare soft-bits */ - ubits2sbits(bursts_u, bursts_s, 78); + osmo_ubit2sbit(bursts_s, bursts_u, 78); - printd("U-Bits:\n"); - printd("%s\n", osmo_hexdump(bursts_u, 78)); + printd("U-Bits: %s\n", osmo_ubit_dump(bursts_u, 78)); printd("S-Bits:\n"); printd("%s\n", osmo_hexdump((uint8_t *)bursts_s, 78)); @@ -201,33 +174,25 @@ gsm0503_tch_fr_encode(bursts_u, speech, len, 1); /* Prepare soft-bits */ - ubits2sbits(bursts_u, bursts_s, 116 * 8); + osmo_ubit2sbit(bursts_s, bursts_u, 116 * 8); printd("U-Bits:\n"); - printd("%s %02x %02x ", osmo_hexdump(bursts_u, 57), - bursts_u[57], bursts_u[58]); - printd("%s\n", osmo_hexdump(bursts_u + 59, 57)); - printd("%s %02x %02x ", osmo_hexdump(bursts_u + 116, 57), - bursts_u[57 + 116], bursts_u[58 + 116]); - printd("%s\n", osmo_hexdump(bursts_u + 59 + 116, 57)); - printd("%s %02x %02x ", osmo_hexdump(bursts_u + 232, 57), - bursts_u[57 + 232], bursts_u[58 + 232]); - printd("%s\n", osmo_hexdump(bursts_u + 59 + 232, 57)); - printd("%s %02x %02x ", osmo_hexdump(bursts_u + 348, 57), - bursts_u[57 + 348], bursts_u[58 + 348]); - printd("%s\n", osmo_hexdump(bursts_u + 59 + 348, 57)); - printd("%s %02x %02x ", osmo_hexdump(bursts_u + 464, 57), - bursts_u[57 + 464], bursts_u[58 + 464]); - printd("%s\n", osmo_hexdump(bursts_u + 59 + 464, 57)); - printd("%s %02x %02x ", osmo_hexdump(bursts_u + 580, 57), - bursts_u[57 + 580], bursts_u[58 + 580]); - printd("%s\n", osmo_hexdump(bursts_u + 59 + 580, 57)); - printd("%s %02x %02x ", osmo_hexdump(bursts_u + 696, 57), - bursts_u[57 + 696], bursts_u[58 + 696]); - printd("%s\n", osmo_hexdump(bursts_u + 59 + 696, 57)); - printd("%s %02x %02x ", osmo_hexdump(bursts_u + 812, 57), - bursts_u[57 + 812], bursts_u[58 + 812]); - printd("%s\n", osmo_hexdump(bursts_u + 59 + 812, 57)); + printd("%s %02x %02x ", osmo_ubit_dump(bursts_u, 57), bursts_u[57], bursts_u[58]); + printd("%s\n", osmo_ubit_dump(bursts_u + 59, 57)); + printd("%s %02x %02x ", osmo_ubit_dump(bursts_u + 116, 57), bursts_u[57 + 116], bursts_u[58 + 116]); + printd("%s\n", osmo_ubit_dump(bursts_u + 59 + 116, 57)); + printd("%s %02x %02x ", osmo_ubit_dump(bursts_u + 232, 57), bursts_u[57 + 232], bursts_u[58 + 232]); + printd("%s\n", osmo_ubit_dump(bursts_u + 59 + 232, 57)); + printd("%s %02x %02x ", osmo_ubit_dump(bursts_u + 348, 57), bursts_u[57 + 348], bursts_u[58 + 348]); + printd("%s\n", osmo_ubit_dump(bursts_u + 59 + 348, 57)); + printd("%s %02x %02x ", osmo_ubit_dump(bursts_u + 464, 57), bursts_u[57 + 464], bursts_u[58 + 464]); + printd("%s\n", osmo_ubit_dump(bursts_u + 59 + 464, 57)); + printd("%s %02x %02x ", osmo_ubit_dump(bursts_u + 580, 57), bursts_u[57 + 580], bursts_u[58 + 580]); + printd("%s\n", osmo_ubit_dump(bursts_u + 59 + 580, 57)); + printd("%s %02x %02x ", osmo_ubit_dump(bursts_u + 696, 57), bursts_u[57 + 696], bursts_u[58 + 696]); + printd("%s\n", osmo_ubit_dump(bursts_u + 59 + 696, 57)); + printd("%s %02x %02x ", osmo_ubit_dump(bursts_u + 812, 57), bursts_u[57 + 812], bursts_u[58 + 812]); + printd("%s\n", osmo_ubit_dump(bursts_u + 59 + 812, 57)); printd("S-Bits:\n"); printd("%s %02x %02x ", osmo_hexdump((uint8_t *)bursts_s, 57), @@ -287,27 +252,21 @@ gsm0503_tch_hr_encode(bursts_u, speech, len); /* Prepare soft-bits */ - ubits2sbits(bursts_u, bursts_s, 116 * 6); + osmo_ubit2sbit(bursts_s, bursts_u, 116 * 6); printd("U-Bits:\n"); - printd("%s %02x %02x ", osmo_hexdump(bursts_u, 57), - bursts_u[57], bursts_u[58]); - printd("%s\n", osmo_hexdump(bursts_u + 59, 57)); - printd("%s %02x %02x ", osmo_hexdump(bursts_u + 116, 57), - bursts_u[57 + 116], bursts_u[58 + 116]); - printd("%s\n", osmo_hexdump(bursts_u + 59 + 116, 57)); - printd("%s %02x %02x ", osmo_hexdump(bursts_u + 232, 57), - bursts_u[57 + 232], bursts_u[58 + 232]); - printd("%s\n", osmo_hexdump(bursts_u + 59 + 232, 57)); - printd("%s %02x %02x ", osmo_hexdump(bursts_u + 348, 57), - bursts_u[57 + 348], bursts_u[58 + 348]); - printd("%s\n", osmo_hexdump(bursts_u + 59 + 348, 57)); - printd("%s %02x %02x ", osmo_hexdump(bursts_u + 464, 57), - bursts_u[57 + 464], bursts_u[58 + 464]); - printd("%s\n", osmo_hexdump(bursts_u + 59 + 464, 57)); - printd("%s %02x %02x ", osmo_hexdump(bursts_u + 580, 57), - bursts_u[57 + 580], bursts_u[58 + 580]); - printd("%s\n", osmo_hexdump(bursts_u + 59 + 580, 57)); + printd("%s %02x %02x ", osmo_ubit_dump(bursts_u, 57), bursts_u[57], bursts_u[58]); + printd("%s\n", osmo_ubit_dump(bursts_u + 59, 57)); + printd("%s %02x %02x ", osmo_ubit_dump(bursts_u + 116, 57), bursts_u[57 + 116], bursts_u[58 + 116]); + printd("%s\n", osmo_ubit_dump(bursts_u + 59 + 116, 57)); + printd("%s %02x %02x ", osmo_ubit_dump(bursts_u + 232, 57), bursts_u[57 + 232], bursts_u[58 + 232]); + printd("%s\n", osmo_ubit_dump(bursts_u + 59 + 232, 57)); + printd("%s %02x %02x ", osmo_ubit_dump(bursts_u + 348, 57), bursts_u[57 + 348], bursts_u[58 + 348]); + printd("%s\n", osmo_ubit_dump(bursts_u + 59 + 348, 57)); + printd("%s %02x %02x ", osmo_ubit_dump(bursts_u + 464, 57), bursts_u[57 + 464], bursts_u[58 + 464]); + printd("%s\n", osmo_ubit_dump(bursts_u + 59 + 464, 57)); + printd("%s %02x %02x ", osmo_ubit_dump(bursts_u + 580, 57), bursts_u[57 + 580], bursts_u[58 + 580]); + printd("%s\n", osmo_ubit_dump(bursts_u + 59 + 580, 57)); printd("S-Bits:\n"); printd("%s %02x %02x ", osmo_hexdump((uint8_t *)bursts_s, 57), @@ -371,21 +330,17 @@ gsm0503_pdtch_encode(bursts_u, l2, len); /* Prepare soft-bits */ - ubits2sbits(bursts_u, bursts_s, 116 * 4); + osmo_ubit2sbit(bursts_s, bursts_u, 116 * 4); printd("U-Bits:\n"); - printd("%s %02x %02x ", osmo_hexdump(bursts_u, 57), - bursts_u[57], bursts_u[58]); - printd("%s\n", osmo_hexdump(bursts_u + 59, 57)); - printd("%s %02x %02x ", osmo_hexdump(bursts_u + 116, 57), - bursts_u[57 + 116], bursts_u[58 + 116]); - printd("%s\n", osmo_hexdump(bursts_u + 59 + 116, 57)); - printd("%s %02x %02x ", osmo_hexdump(bursts_u + 232, 57), - bursts_u[57 + 232], bursts_u[58 + 232]); - printd("%s\n", osmo_hexdump(bursts_u + 59 + 232, 57)); - printd("%s %02x %02x ", osmo_hexdump(bursts_u + 348, 57), - bursts_u[57 + 348], bursts_u[58 + 348]); - printd("%s\n", osmo_hexdump(bursts_u + 59 + 348, 57)); + printd("%s %02x %02x ", osmo_ubit_dump(bursts_u, 57), bursts_u[57], bursts_u[58]); + printd("%s\n", osmo_ubit_dump(bursts_u + 59, 57)); + printd("%s %02x %02x ", osmo_ubit_dump(bursts_u + 116, 57), bursts_u[57 + 116], bursts_u[58 + 116]); + printd("%s\n", osmo_ubit_dump(bursts_u + 59 + 116, 57)); + printd("%s %02x %02x ", osmo_ubit_dump(bursts_u + 232, 57), bursts_u[57 + 232], bursts_u[58 + 232]); + printd("%s\n", osmo_ubit_dump(bursts_u + 59 + 232, 57)); + printd("%s %02x %02x ", osmo_ubit_dump(bursts_u + 348, 57), bursts_u[57 + 348], bursts_u[58 + 348]); + printd("%s\n", osmo_ubit_dump(bursts_u + 59 + 348, 57)); printd("S-Bits:\n"); printd("%s %02x %02x ", osmo_hexdump((uint8_t *)bursts_s, 57), -- To view, visit https://gerrit.osmocom.org/5063 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8c31b0954176a2c53305936a025c92a793b6d9b6 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max <msuraev at sysmocom.de> Gerrit-Reviewer: Jenkins Builder