From 0c08db17bf74779d4f4bb89c379b71166bd87249 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Fri, 14 May 2010 08:12:57 +0800 Subject: nat: Start to add a test case.. with one CR message. --- openbsc/tests/bsc-nat/bsc_nat_test.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'openbsc/tests/bsc-nat/bsc_nat_test.c') diff --git a/openbsc/tests/bsc-nat/bsc_nat_test.c b/openbsc/tests/bsc-nat/bsc_nat_test.c index 24b96012a..97a0d611f 100644 --- a/openbsc/tests/bsc-nat/bsc_nat_test.c +++ b/openbsc/tests/bsc-nat/bsc_nat_test.c @@ -540,6 +540,24 @@ static void test_mgcp_parse(void) } } +static void test_cr_filter() +{ + struct msgb *msg = msgb_alloc(4096, "test_cr_filter"); + copy_to_msg(msg, bssmap_cr, sizeof(bssmap_cr)); + struct bsc_nat_parsed *parsed; + + parsed = bsc_nat_parse(msg); + if (!parsed) { + fprintf(stderr, "FAIL: Failed to parse the message\n"); + abort(); + } + + bsc_nat_filter_sccp_cr(NULL, msg, parsed); + + talloc_free(parsed); + msgb_free(msg); +} + int main(int argc, char **argv) { struct debug_target *stderr_target; @@ -555,6 +573,7 @@ int main(int argc, char **argv) test_mgcp_find(); test_mgcp_rewrite(); test_mgcp_parse(); + test_cr_filter(); return 0; } -- cgit v1.2.3