aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/tests/bsc-nat/bsc_nat_test.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-05-14 08:12:57 +0800
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-06-15 20:24:18 +0800
commit0c08db17bf74779d4f4bb89c379b71166bd87249 (patch)
tree706e71b55c1416af60da2708f849596b0d263be6 /openbsc/tests/bsc-nat/bsc_nat_test.c
parentb4af5c9b57917b1ab31f838adcafcaf5c49baab7 (diff)
nat: Start to add a test case.. with one CR message.
Diffstat (limited to 'openbsc/tests/bsc-nat/bsc_nat_test.c')
-rw-r--r--openbsc/tests/bsc-nat/bsc_nat_test.c19
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 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;
}