aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergey.Kostanbaev <Sergey.Kostanbaev@gmail.com>2016-02-11 15:03:29 +0300
committerIvan Kluchnikov <kluchnikovi@gmail.com>2017-02-07 18:59:55 +0300
commitc572ac8733af798ad5b58769d24fef2b0f74d502 (patch)
tree1b87d47a0b2cbabdb1ff8b73158c161b88da03d0
parent53d1a9186c0b688f999b0e31f641d96166b601a0 (diff)
add test for registerSS
-rw-r--r--openbsc/tests/ussd/ss_test.c13
1 files changed, 13 insertions, 0 deletions
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)