aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-12-09 17:08:06 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-12-10 13:22:42 +0100
commit03ba4f485bdbf79b9efce862940fd871e7b3dc72 (patch)
tree405f452c40d03eead4c1b9ab435962a4d3fc9652 /tests
parent58d0c24f03b75d31164f961e76e0414c6fbb2102 (diff)
isup: Start with isup support in the cellmgr.
Start parsing the ISUP messages. This just adds what we need to handle now and will not grow it a lot.
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am2
-rw-r--r--tests/isup/Makefile.am4
-rw-r--r--tests/isup/isup_parse_test.c48
3 files changed, 53 insertions, 1 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index b38aa6a..6ffa86d 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1 +1 @@
-SUBDIRS = mtp patching
+SUBDIRS = mtp patching isup
diff --git a/tests/isup/Makefile.am b/tests/isup/Makefile.am
new file mode 100644
index 0000000..4c51d25
--- /dev/null
+++ b/tests/isup/Makefile.am
@@ -0,0 +1,4 @@
+INCLUDES = $(all_includes) -I$(top_srcdir)/include -Wall
+noinst_PROGRAMS = isup_parse_test
+
+isup_parse_test_SOURCES = isup_parse_test.c
diff --git a/tests/isup/isup_parse_test.c b/tests/isup/isup_parse_test.c
new file mode 100644
index 0000000..8f99cdb
--- /dev/null
+++ b/tests/isup/isup_parse_test.c
@@ -0,0 +1,48 @@
+/*
+ * (C) 2010 by Holger Hans Peter Freyther <zecke@selfish.org>
+ * (C) 2010 by On-Waves
+ * All Rights Reserved
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ */
+
+#include <isup_types.h>
+
+#include <stdlib.h>
+#include <stdio.h>
+
+#define ASSERT(got,want) \
+ if (got != want) { \
+ fprintf(stderr, "Values should be the same 0x%x 0x%x at %s:%d\n", \
+ got, want, __FILE__, __LINE__); \
+ abort(); \
+ }
+
+static void test_cic_parsing()
+{
+ static const uint8_t isup_grs[] = {3, 0, 23, 1, 1, 28};
+ struct isup_msg_hdr *hdr;
+
+ hdr = (struct isup_msg_hdr *) isup_grs;
+ ASSERT(hdr->cic, 3);
+ ASSERT(hdr->msg_type, ISUP_MSG_GRS);
+}
+
+int main(int argc, char **argv)
+{
+ test_cic_parsing();
+ return 0;
+}