aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2017-05-19 14:21:00 +0200
committerMax <msuraev@sysmocom.de>2017-05-22 09:37:26 +0000
commitefbef50efc170caccf6354360638cda762dd7fc3 (patch)
tree1b400e96ded13b84833bb99f8b9cd4d6ae7996ef /tests
parent9c1d3f9606bee1f8549b95037fba04a9fab534cf (diff)
osmo-bts-trx: use libosmocoding
Remove built-in functions and use libosmocoding instead. Change-Id: I1b41bb1a8de655639107ec1f3b75afc240fd316f
Diffstat (limited to 'tests')
-rw-r--r--tests/bursts/Makefile.am12
-rw-r--r--tests/bursts/bursts_test.c29
2 files changed, 17 insertions, 24 deletions
diff --git a/tests/bursts/Makefile.am b/tests/bursts/Makefile.am
index 462b7288..380b4b84 100644
--- a/tests/bursts/Makefile.am
+++ b/tests/bursts/Makefile.am
@@ -1,14 +1,8 @@
AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR)
-AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS)
-LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS)
+AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOCODING_CFLAGS)
+LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOCODING_LIBS)
noinst_PROGRAMS = bursts_test
EXTRA_DIST = bursts_test.ok
-bursts_test_SOURCES = bursts_test.c \
- $(top_builddir)/src/osmo-bts-trx/gsm0503_coding.c \
- $(top_builddir)/src/osmo-bts-trx/gsm0503_conv.c \
- $(top_builddir)/src/osmo-bts-trx/gsm0503_interleaving.c \
- $(top_builddir)/src/osmo-bts-trx/gsm0503_mapping.c \
- $(top_builddir)/src/osmo-bts-trx/gsm0503_tables.c \
- $(top_builddir)/src/osmo-bts-trx/gsm0503_parity.c
+bursts_test_SOURCES = bursts_test.c
bursts_test_LDADD = $(top_builddir)/src/common/libbts.a $(LDADD)
diff --git a/tests/bursts/bursts_test.c b/tests/bursts/bursts_test.c
index d4bb3e0b..9c2efdfb 100644
--- a/tests/bursts/bursts_test.c
+++ b/tests/bursts/bursts_test.c
@@ -26,10 +26,9 @@
#include <osmocom/core/bits.h>
#include <osmocom/core/utils.h>
-#include <osmo-bts/gsm_data.h>
-
-#include "../../src/osmo-bts-trx/gsm0503_coding.h"
+#include <osmocom/coding/gsm0503_coding.h>
+#include <osmo-bts/gsm_data.h>
#include <osmo-bts/logging.h>
#define ASSERT_TRUE(rc) \
@@ -71,7 +70,7 @@ static void test_xcch(uint8_t *l2)
printd("Encoding: %s\n", osmo_hexdump(l2, 23));
/* encode */
- xcch_encode(bursts_u, l2);
+ gsm0503_xcch_encode(bursts_u, l2);
printd("U-Bits:\n");
printd("%s %02x %02x ", osmo_hexdump(bursts_u, 57),
@@ -106,7 +105,7 @@ static void test_xcch(uint8_t *l2)
memset(bursts_s + 116, 0, 30);
/* decode */
- xcch_decode(result, bursts_s, &n_errors, &n_bits_total);
+ gsm0503_xcch_decode(result, bursts_s, &n_errors, &n_bits_total);
ASSERT_TRUE(n_bits_total == 456);
@@ -128,7 +127,7 @@ static void test_rach(uint8_t bsic, uint8_t ra)
printd("Encoding: %02x\n", ra);
/* encode */
- rach_encode(bursts_u, &ra, bsic);
+ gsm0503_rach_encode(bursts_u, &ra, bsic);
printd("U-Bits:\n");
printd("%s\n", osmo_hexdump(bursts_u, 36));
@@ -140,7 +139,7 @@ static void test_rach(uint8_t bsic, uint8_t ra)
memset(bursts_s + 6, 0, 8);
/* decode */
- rach_decode(&result, bursts_s, bsic);
+ gsm0503_rach_decode(&result, bursts_s, bsic);
printd("Decoded: %02x\n", result);
@@ -162,7 +161,7 @@ static void test_sch(uint8_t *info)
printd("Encoding: %s\n", osmo_hexdump(info, 4));
/* encode */
- sch_encode(bursts_u, info);
+ gsm0503_sch_encode(bursts_u, info);
printd("U-Bits:\n");
printd("%s\n", osmo_hexdump(bursts_u, 78));
@@ -174,7 +173,7 @@ static void test_sch(uint8_t *info)
memset(bursts_s + 6, 0, 10);
/* decode */
- sch_decode(result, bursts_s);
+ gsm0503_sch_decode(result, bursts_s);
printd("Decoded: %s\n", osmo_hexdump(result, 4));
@@ -197,7 +196,7 @@ static void test_fr(uint8_t *speech, int len)
printd("Encoding: %s\n", osmo_hexdump(speech, len));
/* encode */
- tch_fr_encode(bursts_u, speech, len, 1);
+ gsm0503_tch_fr_encode(bursts_u, speech, len, 1);
printd("U-Bits:\n");
printd("%s %02x %02x ", osmo_hexdump(bursts_u, 57),
@@ -255,7 +254,7 @@ static void test_fr(uint8_t *speech, int len)
memset(bursts_s + 6, 0, 20);
/* decode */
- rc = tch_fr_decode(result, bursts_s, 1, len == 31, &n_errors, &n_bits_total);
+ rc = gsm0503_tch_fr_decode(result, bursts_s, 1, len == 31, &n_errors, &n_bits_total);
ASSERT_TRUE(rc == len);
@@ -282,7 +281,7 @@ static void test_hr(uint8_t *speech, int len)
printd("Encoding: %s\n", osmo_hexdump(speech, len));
/* encode */
- tch_hr_encode(bursts_u, speech, len);
+ gsm0503_tch_hr_encode(bursts_u, speech, len);
printd("U-Bits:\n");
printd("%s %02x %02x ", osmo_hexdump(bursts_u, 57),
@@ -328,7 +327,7 @@ static void test_hr(uint8_t *speech, int len)
memset(bursts_s + 6, 0, 20);
/* decode */
- rc = tch_hr_decode(result, bursts_s, 0, &n_errors, &n_bits_total);
+ rc = gsm0503_tch_hr_decode(result, bursts_s, 0, &n_errors, &n_bits_total);
ASSERT_TRUE(rc == len);
@@ -367,7 +366,7 @@ static void test_pdtch(uint8_t *l2, int len)
printd("Encoding: %s\n", osmo_hexdump(l2, len));
/* encode */
- pdtch_encode(bursts_u, l2, len);
+ gsm0503_pdtch_encode(bursts_u, l2, len);
printd("U-Bits:\n");
printd("%s %02x %02x ", osmo_hexdump(bursts_u, 57),
@@ -398,7 +397,7 @@ static void test_pdtch(uint8_t *l2, int len)
printd("%s\n", osmo_hexdump((uint8_t *)bursts_s + 59 + 348, 57));
/* decode */
- rc = pdtch_decode(result, bursts_s, NULL, &n_errors, &n_bits_total);
+ rc = gsm0503_pdtch_decode(result, bursts_s, NULL, &n_errors, &n_bits_total);
ASSERT_TRUE(rc == len);