diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-05-14 08:12:57 +0800 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-05-14 08:12:57 +0800 |
commit | 4c4d2d48ecf3ee5684707c9dadd2301b11358a69 (patch) | |
tree | f3d401a0f37109a288b374e4269841eff698eeed /openbsc/tests/bsc-nat | |
parent | 13441a1c50ceaec752a09a4df6a43e72334bacb0 (diff) |
nat: Start to add a test case.. with one CR message.
Diffstat (limited to 'openbsc/tests/bsc-nat')
-rw-r--r-- | openbsc/tests/bsc-nat/bsc_nat_test.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/openbsc/tests/bsc-nat/bsc_nat_test.c b/openbsc/tests/bsc-nat/bsc_nat_test.c index 8623123f7..4fcba9982 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 log_target *stderr_target; @@ -556,6 +574,7 @@ int main(int argc, char **argv) test_mgcp_find(); test_mgcp_rewrite(); test_mgcp_parse(); + test_cr_filter(); return 0; } |