blob: 6cd7982b65ce1d1d25d445463b103b4a98818c77 [file] [log] [blame]
Holger Hans Peter Freyther97510812012-01-22 13:36:52 +01001Testing generation of GSM0808 messages
2Testing creating Layer3
Philipp Maierfa896ab2017-03-27 16:55:32 +02003Testing creating Layer3 (AoIP)
Holger Hans Peter Freyther97510812012-01-22 13:36:52 +01004Testing creating Reset
Philipp Maier15596e22017-04-05 17:55:27 +02005Testing creating Reset Ack
Holger Hans Peter Freyther97510812012-01-22 13:36:52 +01006Testing creating Clear Command
7Testing creating Clear Complete
Philipp Maierb478dd32017-03-29 15:50:05 +02008Testing creating Chipher Mode Command
Holger Hans Peter Freyther97510812012-01-22 13:36:52 +01009Testing creating Cipher Complete
10Testing creating Cipher Reject
11Testing creating CM U
12Testing creating SAPI Reject
Philipp Maierc6144a22017-03-29 17:53:43 +020013Testing creating Assignment Request
Holger Hans Peter Freyther97510812012-01-22 13:36:52 +010014Testing creating Assignment Complete
Philipp Maierfa896ab2017-03-27 16:55:32 +020015Testing creating Assignment Complete (AoIP)
Holger Hans Peter Freyther97510812012-01-22 13:36:52 +010016Testing creating Assignment Failure
Philipp Maierfa896ab2017-03-27 16:55:32 +020017Testing creating Assignment Failure (AoIP)
Holger Hans Peter Freyther97510812012-01-22 13:36:52 +010018Testing creating Clear Request
Philipp Maier3d48ec02017-03-29 17:37:55 +020019Testing creating Paging Request
Holger Hans Peter Freyther97510812012-01-22 13:36:52 +010020Testing creating DTAP
21Testing prepend DTAP
Neels Hofmeyrdb2fa4e2018-04-13 04:11:20 +020022test_gsm0808_enc_dec_cell_id_list_lac: encoded: 1a 07 05 01 24 ab cd 56 78 (rc = 9)
Neels Hofmeyr74663d92018-03-23 01:46:42 +010023------- test_cell_id_list_add
Neels Hofmeyra4399c82018-04-17 02:26:10 +020024 cell_id_list == CGI[0]:{}
Neels Hofmeyr74663d92018-03-23 01:46:42 +010025gsm0808_cell_id_list_add(&cil, &lac1) --> rc = 1
Neels Hofmeyra4399c82018-04-17 02:26:10 +020026 cell_id_list == LAC[1]:{123}
Neels Hofmeyr74663d92018-03-23 01:46:42 +010027gsm0808_cell_id_list_add(&cil, &lac1) --> rc = 0
Neels Hofmeyra4399c82018-04-17 02:26:10 +020028 cell_id_list == LAC[1]:{123}
Neels Hofmeyr74663d92018-03-23 01:46:42 +010029gsm0808_cell_id_list_add(&cil, &lac2) --> rc = 2
Neels Hofmeyra4399c82018-04-17 02:26:10 +020030 cell_id_list == LAC[3]:{123, 456, 789}
Neels Hofmeyr74663d92018-03-23 01:46:42 +010031gsm0808_cell_id_list_add(&cil, &lac2) --> rc = 0
Neels Hofmeyra4399c82018-04-17 02:26:10 +020032 cell_id_list == LAC[3]:{123, 456, 789}
Neels Hofmeyr74663d92018-03-23 01:46:42 +010033gsm0808_cell_id_list_add(&cil, &cil) --> rc = 0
Neels Hofmeyra4399c82018-04-17 02:26:10 +020034 cell_id_list == LAC[3]:{123, 456, 789}
Neels Hofmeyr74663d92018-03-23 01:46:42 +010035gsm0808_cell_id_list_add(&cil, &cgi1) --> rc = -22
Neels Hofmeyra4399c82018-04-17 02:26:10 +020036 cell_id_list == LAC[3]:{123, 456, 789}
37* can't add to BSS list
38 cell_id_list == BSS[0]
Neels Hofmeyr74663d92018-03-23 01:46:42 +010039gsm0808_cell_id_list_add(&cil, &lac1) --> rc = -22
Neels Hofmeyra4399c82018-04-17 02:26:10 +020040 cell_id_list == BSS[0]
41* other types (including NO_CELL) take on new type iff empty
42 cell_id_list == NO-CELL[0]
Neels Hofmeyr74663d92018-03-23 01:46:42 +010043gsm0808_cell_id_list_add(&cil, &cgi1) --> rc = 1
Neels Hofmeyra4399c82018-04-17 02:26:10 +020044 cell_id_list == CGI[1]:{001-02-3-4}
Neels Hofmeyr74663d92018-03-23 01:46:42 +010045gsm0808_cell_id_list_add(&cil, &cgi1) --> rc = 0
Neels Hofmeyra4399c82018-04-17 02:26:10 +020046 cell_id_list == CGI[1]:{001-02-3-4}
Neels Hofmeyr74663d92018-03-23 01:46:42 +010047gsm0808_cell_id_list_add(&cil, &cgi2) --> rc = 2
Neels Hofmeyra4399c82018-04-17 02:26:10 +020048 cell_id_list == CGI[3]:{001-02-3-4, 001-002-3-4, 005-006-7-8}
Neels Hofmeyr74663d92018-03-23 01:46:42 +010049gsm0808_cell_id_list_add(&cil, &cgi2) --> rc = 0
Neels Hofmeyra4399c82018-04-17 02:26:10 +020050 cell_id_list == CGI[3]:{001-02-3-4, 001-002-3-4, 005-006-7-8}
51* test gsm0808_cell_id_list_name_buf()'s return val
52 strlen(gsm0808_cell_id_list_name(cil)) == 45
53 gsm0808_cell_id_list_name_buf(buf, 46, cil)) == 45 "CGI[3]:{001-02-3-4, 001-002-3-4, 005-006-7-8}"
54 gsm0808_cell_id_list_name_buf(buf, 23, cil)) == 45 "CGI[3]:{001-02-3-4, 00"
55 gsm0808_cell_id_list_name_buf(buf, 11, cil)) == 45 "CGI[3]:{00"
56 gsm0808_cell_id_list_name_buf(buf, 5, cil)) == 45 "CGI["
57 gsm0808_cell_id_list_name_buf(buf, 2, cil)) == 45 "C"
58 gsm0808_cell_id_list_name_buf(buf, 1, cil)) == 45 ""
59 gsm0808_cell_id_list_name_buf(buf, 0, cil)) == 45 "#"
60* list-full behavior
Neels Hofmeyr74663d92018-03-23 01:46:42 +010061cil.id_list_len = 126
62gsm0808_cell_id_list_add(&cil, &cgi2a) --> rc = 1
63cil.id_list_len = 127
Neels Hofmeyr74663d92018-03-23 01:46:42 +010064cil.id_list_len = 126
65gsm0808_cell_id_list_add(&cil, &cgi3) --> rc = -28
66cil.id_list_len = 127
67gsm0808_cell_id_list_add(&cil, &cgi2a) --> rc = -28
68cil.id_list_len = 127
69------- test_cell_id_list_add done
Neels Hofmeyr250e7f72018-04-13 03:30:14 +020070test_gsm0808_enc_dec_cell_id_lac: encoded: 05 03 05 01 24 (rc = 5)
71test_gsm0808_enc_dec_cell_id_bss: encoded: 05 01 06 (rc = 3)
72test_gsm0808_enc_dec_cell_id_no_cell: encoded: 05 01 03 (rc = 3)
73test_gsm0808_enc_dec_cell_id_lai_and_lac: encoded: 05 06 04 21 63 54 23 42 (rc = 8)
74test_gsm0808_enc_dec_cell_id_ci: encoded: 05 03 02 04 23 (rc = 5)
75test_gsm0808_enc_dec_cell_id_lac_and_ci: encoded: 05 05 01 04 23 02 35 (rc = 7)
76test_gsm0808_enc_dec_cell_id_global: encoded: 05 08 00 21 63 54 23 42 04 23 (rc = 10)
Holger Hans Peter Freyther97510812012-01-22 13:36:52 +010077Done