From c572ac8733af798ad5b58769d24fef2b0f74d502 Mon Sep 17 00:00:00 2001 From: "Sergey.Kostanbaev" Date: Thu, 11 Feb 2016 15:03:29 +0300 Subject: add test for registerSS --- openbsc/tests/ussd/ss_test.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/openbsc/tests/ussd/ss_test.c b/openbsc/tests/ussd/ss_test.c index 864dde950..8a404103e 100644 --- a/openbsc/tests/ussd/ss_test.c +++ b/openbsc/tests/ussd/ss_test.c @@ -59,6 +59,11 @@ const uint8_t test_ss_int_02[] = { 0xa1, 0x0b, 0x02, 0x01, 0x01, 0x02, 0x01, 0x0e, 0x30, 0x03, 0x04, 0x01, 0x21 }; +const uint8_t test_ss_int_03[] = { +0xa1, 0x17, 0x02, 0x01, 0x01, 0x02, 0x01, 0x0a, 0x30, 0x0f, 0x04, 0x01, 0x21, +0x83, 0x01, 0x10, 0x84, 0x07, 0x91, 0x52, 0x75, 0x89, 0x46, 0x36, 0x25 +}; + const uint8_t test_ussd_01[] = { 0xa1, 0x81, 0x83, 0x02, 0x01, 0x01, 0x02, 0x01, 0x3c, 0x30, 0x7b, 0x04, 0x01, 0x0f, 0x04, 0x76, 0xd3, 0x66, 0x50, 0x4a, 0x55, 0xc4, 0x5c, 0x20, 0x6b, 0xda, @@ -171,6 +176,14 @@ static void test_parse_ss(void) ss.component_type, ss.invoke_id, ss.opcode); printf("- SS: code:%d\n", ss.ss_code); + // mark as uninitialized + memset(&ss, 0xcc, sizeof(ss)); + rc = gsm0480_parse_ss_facility(test_ss_int_03, sizeof(test_ss_int_03), &ss); + OSMO_ASSERT(rc == 1); + printf("Sample: test_ss_int_01 ctype=%02x invoke_id=%02x opcode=%02x\n", + ss.component_type, ss.invoke_id, ss.opcode); + printf("- SS: code:%d\n", ss.ss_code); + } int main(int argc, char **argv) -- cgit v1.2.3