diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2012-12-11 14:08:55 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2012-12-16 12:10:36 +0100 |
commit | a9530059a1ecab57a0ebe362ad8b8f3353e3f7b2 (patch) | |
tree | 36d901d92f88c46f6d42a165117c122f2d3ad940 /tests/isup | |
parent | b35c5c3227a30187de4df3e214eace142e1be100 (diff) |
isup: Test some more ISUP messages and that we parse them correctly
Diffstat (limited to 'tests/isup')
-rw-r--r-- | tests/isup/isup_parse_test.c | 36 | ||||
-rw-r--r-- | tests/isup/isup_parse_test.ok | 2 |
2 files changed, 36 insertions, 2 deletions
diff --git a/tests/isup/isup_parse_test.c b/tests/isup/isup_parse_test.c index 6bb582a..4010fcf 100644 --- a/tests/isup/isup_parse_test.c +++ b/tests/isup/isup_parse_test.c @@ -1,6 +1,6 @@ /* - * (C) 2010-2011 by Holger Hans Peter Freyther <zecke@selfish.org> - * (C) 2010-2011 by On-Waves + * (C) 2010-2012 by Holger Hans Peter Freyther <zecke@selfish.org> + * (C) 2010-2012 by On-Waves * All Rights Reserved * * This program is free software: you can redistribute it and/or modify @@ -53,13 +53,45 @@ static void test_grs_parsing() hdr = (struct isup_msg_hdr *) isup_grs; range = isup_parse_status(&hdr->data[0], 3); + ASSERT(hdr->cic, 3); + ASSERT(hdr->msg_type, ISUP_MSG_GRS); ASSERT(range, 28); } +static void test_gra_parsing() +{ + static const uint8_t isup_gra[] = { + 0x02, 0x00, 0x29, 0x01, + 0x05, 0x1d, 0x00, 0x00, + 0xff, 0x3f }; + struct isup_msg_hdr *hdr; + int range; + + printf("Testing GRA parsing.\n"); + hdr = (struct isup_msg_hdr *) isup_gra; + range = isup_parse_status(&hdr->data[0], 3); + ASSERT(hdr->cic, 2); + ASSERT(hdr->msg_type, ISUP_MSG_GRA); + ASSERT(range, 29); +} + +static void test_rsc_parsing() +{ + static const uint8_t isup_rsc[] = {0x01, 0x00, 0x012}; + struct isup_msg_hdr *hdr; + + printf("Testing RSC parsing.\n"); + hdr = (struct isup_msg_hdr *) isup_rsc; + ASSERT(hdr->cic, 1); + ASSERT(hdr->msg_type, ISUP_MSG_RSC); +} + int main(int argc, char **argv) { test_cic_parsing(); test_grs_parsing(); + test_gra_parsing(); + test_rsc_parsing(); printf("All tests passed.\n"); return 0; diff --git a/tests/isup/isup_parse_test.ok b/tests/isup/isup_parse_test.ok index ed00fc4..da7d87e 100644 --- a/tests/isup/isup_parse_test.ok +++ b/tests/isup/isup_parse_test.ok @@ -1,3 +1,5 @@ Testing CIC parsing. Testing GRS parsing. +Testing GRA parsing. +Testing RSC parsing. All tests passed. |