aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2016-01-03 16:31:31 +0100
committerHarald Welte <laforge@gnumonks.org>2016-01-03 16:31:31 +0100
commit056984fab1c1d6f80b5dc28f4c83eb80515d7c25 (patch)
tree464c52e786dddd420129f0f0a177b9e48e61f106 /src/tests
parenta95d5a5f51d2dcc6b7bffdfe971148a6307e94d9 (diff)
merge (+rename) iu_helpers.c into libosmo-ranap
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/Makefile.am6
-rw-r--r--src/tests/hnb-test.c4
-rw-r--r--src/tests/test-helpers.c5
-rw-r--r--src/tests/test-hnbap.c4
4 files changed, 10 insertions, 9 deletions
diff --git a/src/tests/Makefile.am b/src/tests/Makefile.am
index 973cf3f..43b63cc 100644
--- a/src/tests/Makefile.am
+++ b/src/tests/Makefile.am
@@ -6,13 +6,13 @@ check_PROGRAMS = test-ranap test-helpers test-hnbap hnb-test dummy-cn
HNBAP_FILES = $(top_builddir)/src/hnbap_common.c $(top_builddir)/src/hnbap_decoder.c $(top_builddir)/src/hnbap_encoder.c
RUA_FILES = $(top_builddir)/src/rua_common.c $(top_builddir)/src/rua_decoder.c $(top_builddir)/src/rua_encoder.c
-HELPER_FILES = $(top_builddir)/src/iu_helpers.c $(top_builddir)/src/asn1helpers.c
+HELPER_FILES = $(top_builddir)/src/asn1helpers.c
test_helpers_SOURCES = $(HELPER_FILES) test-helpers.c
-test_helpers_LDADD = $(COMMON_LIBS)
+test_helpers_LDADD = $(COMMON_LIBS) $(top_builddir)/src/libosmo-ranap.la
test_hnbap_SOURCES = $(HELPER_FILES) $(top_builddir)/src/hnbap_common.c $(top_builddir)/src/hnbap_decoder.c test-hnbap.c test_common.c
-test_hnbap_LDADD = $(COMMON_LIBS) $(top_builddir)/src/hnbap/libosmo-asn1-hnbap.a
+test_hnbap_LDADD = $(COMMON_LIBS) $(top_builddir)/src/hnbap/libosmo-asn1-hnbap.a $(top_builddir)/src/libosmo-ranap.la
hnb_test_SOURCES = $(HELPER_FILES) $(HNBAP_FILES) $(RUA_FILES) hnb-test.c rua_helper.c test_common.c
hnb_test_LDADD = $(COMMON_LIBS) $(top_builddir)/src/hnbap/libosmo-asn1-hnbap.a $(top_builddir)/src/rua/libosmo-asn1-rua.a $(top_builddir)/src/libosmo-ranap.la
diff --git a/src/tests/hnb-test.c b/src/tests/hnb-test.c
index cd07d7c..f26e222 100644
--- a/src/tests/hnb-test.c
+++ b/src/tests/hnb-test.c
@@ -106,7 +106,7 @@ static int hnb_test_ue_register_tx(struct hnb_test *hnb_test, const char *imsi_s
request.uE_Identity.present = UE_Identity_PR_iMSI;
- imsi_len = encode_iu_imsi(imsi_buf, sizeof(imsi_buf), imsi_str);
+ imsi_len = ranap_imsi_encode(imsi_buf, sizeof(imsi_buf), imsi_str);
OCTET_STRING_fromBuf(&request.uE_Identity.choice.iMSI, imsi_buf, imsi_len);
request.registration_Cause = Registration_Cause_normal;
@@ -162,7 +162,7 @@ static int hnb_test_rx_ue_register_acc(struct hnb_test *hnb, ANY_t *in)
ctx_id = asn1bitstr_to_u24(&accept.context_ID);
- decode_iu_bcd(imsi, sizeof(imsi), accept.uE_Identity.choice.iMSI.buf,
+ ranap_bcd_decode(imsi, sizeof(imsi), accept.uE_Identity.choice.iMSI.buf,
accept.uE_Identity.choice.iMSI.size);
printf("UE Register accept for IMSI %s, context %u\n", imsi, ctx_id);
diff --git a/src/tests/test-helpers.c b/src/tests/test-helpers.c
index 60f3d3b..b514d10 100644
--- a/src/tests/test-helpers.c
+++ b/src/tests/test-helpers.c
@@ -27,6 +27,7 @@
#include <osmocom/core/utils.h>
+int asn1_xer_print = 0;
void *talloc_asn1_ctx;
/* use odd number of digits */
@@ -43,13 +44,13 @@ void test_iu_helpers(void)
printf("pre-encoded: %s\n", osmo_hexdump_nospc(imsi_encoded,
sizeof(imsi_encoded)));
- rc = decode_iu_bcd(outstr, sizeof(outstr), imsi_encoded,
+ rc = ranap_bcd_decode(outstr, sizeof(outstr), imsi_encoded,
sizeof(imsi_encoded));
ASSERT(rc >= 0);
printf("decoded: %s\n", outstr);
ASSERT(!strcmp(outstr, imsi_decoded));
- rc = encode_iu_imsi(outbuf, sizeof(outbuf), imsi_decoded);
+ rc = ranap_imsi_encode(outbuf, sizeof(outbuf), imsi_decoded);
ASSERT(rc >= 0);
printf("re-encoded: %s\n", osmo_hexdump_nospc(outbuf, rc));
ASSERT(!memcmp(outbuf, imsi_encoded, sizeof(imsi_encoded)));
diff --git a/src/tests/test-hnbap.c b/src/tests/test-hnbap.c
index 0005fe1..5101ff4 100644
--- a/src/tests/test-hnbap.c
+++ b/src/tests/test-hnbap.c
@@ -134,7 +134,7 @@ void test_asn1_decoding(void)
ASSERT(rc >= 0);
ASSERT(ue_req_ies.uE_Identity.present == UE_Identity_PR_iMSI);
- decode_iu_bcd(imsi, sizeof(imsi), ue_req_ies.uE_Identity.choice.iMSI.buf,
+ ranap_bcd_decode(imsi, sizeof(imsi), ue_req_ies.uE_Identity.choice.iMSI.buf,
ue_req_ies.uE_Identity.choice.iMSI.size);
printf("HNBAP UE Register request from IMSI %s\n", imsi);
@@ -154,7 +154,7 @@ void test_asn1_decoding(void)
ASSERT(rc >= 0);
ASSERT(ue_acc_ies.uE_Identity.present == UE_Identity_PR_iMSI);
- decode_iu_bcd(imsi, sizeof(imsi), ue_acc_ies.uE_Identity.choice.iMSI.buf,
+ ranap_bcd_decode(imsi, sizeof(imsi), ue_acc_ies.uE_Identity.choice.iMSI.buf,
ue_acc_ies.uE_Identity.choice.iMSI.size);
printf("HNBAP UE Register accept to IMSI %s\n", imsi);