aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/isup/Makefile.am6
-rw-r--r--tests/isup/isup_parse_test.c15
2 files changed, 19 insertions, 2 deletions
diff --git a/tests/isup/Makefile.am b/tests/isup/Makefile.am
index 4c51d25..d8ba492 100644
--- a/tests/isup/Makefile.am
+++ b/tests/isup/Makefile.am
@@ -1,4 +1,6 @@
-INCLUDES = $(all_includes) -I$(top_srcdir)/include -Wall
+INCLUDES = $(all_includes) -I$(top_srcdir)/include
+AM_CFLAGS=-Wall $(LIBOSMOCORE_CFLAGS)
noinst_PROGRAMS = isup_parse_test
-isup_parse_test_SOURCES = isup_parse_test.c
+isup_parse_test_SOURCES = isup_parse_test.c $(top_srcdir)/src/isup.c
+isup_parse_test_LDADD = $(LIBOSMOCORE_LIBS)
diff --git a/tests/isup/isup_parse_test.c b/tests/isup/isup_parse_test.c
index 8f99cdb..721e9ce 100644
--- a/tests/isup/isup_parse_test.c
+++ b/tests/isup/isup_parse_test.c
@@ -41,8 +41,23 @@ static void test_cic_parsing()
ASSERT(hdr->msg_type, ISUP_MSG_GRS);
}
+static void test_grs_parsing()
+{
+ static const uint8_t isup_grs[] = {3, 0, 23, 1, 1, 28};
+ struct isup_msg_hdr *hdr;
+ int range;
+
+ hdr = (struct isup_msg_hdr *) isup_grs;
+ range = isup_parse_grs(&hdr->data[0], 3);
+
+ ASSERT(range, 28);
+}
+
int main(int argc, char **argv)
{
test_cic_parsing();
+ test_grs_parsing();
+
+ printf("All tests passed.\n");
return 0;
}