Holger Hans Peter Freyther | 9751081 | 2012-01-22 13:36:52 +0100 | [diff] [blame] | 1 | Testing generation of GSM0808 messages |
| 2 | Testing creating Layer3 |
Philipp Maier | fa896ab | 2017-03-27 16:55:32 +0200 | [diff] [blame] | 3 | Testing creating Layer3 (AoIP) |
Holger Hans Peter Freyther | 9751081 | 2012-01-22 13:36:52 +0100 | [diff] [blame] | 4 | Testing creating Reset |
Philipp Maier | 15596e2 | 2017-04-05 17:55:27 +0200 | [diff] [blame] | 5 | Testing creating Reset Ack |
Holger Hans Peter Freyther | 9751081 | 2012-01-22 13:36:52 +0100 | [diff] [blame] | 6 | Testing creating Clear Command |
| 7 | Testing creating Clear Complete |
Philipp Maier | b478dd3 | 2017-03-29 15:50:05 +0200 | [diff] [blame] | 8 | Testing creating Chipher Mode Command |
Holger Hans Peter Freyther | 9751081 | 2012-01-22 13:36:52 +0100 | [diff] [blame] | 9 | Testing creating Cipher Complete |
| 10 | Testing creating Cipher Reject |
| 11 | Testing creating CM U |
| 12 | Testing creating SAPI Reject |
Philipp Maier | c6144a2 | 2017-03-29 17:53:43 +0200 | [diff] [blame] | 13 | Testing creating Assignment Request |
Holger Hans Peter Freyther | 9751081 | 2012-01-22 13:36:52 +0100 | [diff] [blame] | 14 | Testing creating Assignment Complete |
Philipp Maier | fa896ab | 2017-03-27 16:55:32 +0200 | [diff] [blame] | 15 | Testing creating Assignment Complete (AoIP) |
Holger Hans Peter Freyther | 9751081 | 2012-01-22 13:36:52 +0100 | [diff] [blame] | 16 | Testing creating Assignment Failure |
Philipp Maier | fa896ab | 2017-03-27 16:55:32 +0200 | [diff] [blame] | 17 | Testing creating Assignment Failure (AoIP) |
Holger Hans Peter Freyther | 9751081 | 2012-01-22 13:36:52 +0100 | [diff] [blame] | 18 | Testing creating Clear Request |
Philipp Maier | 3d48ec0 | 2017-03-29 17:37:55 +0200 | [diff] [blame] | 19 | Testing creating Paging Request |
Holger Hans Peter Freyther | 9751081 | 2012-01-22 13:36:52 +0100 | [diff] [blame] | 20 | Testing creating DTAP |
| 21 | Testing prepend DTAP |
Neels Hofmeyr | db2fa4e | 2018-04-13 04:11:20 +0200 | [diff] [blame] | 22 | test_gsm0808_enc_dec_cell_id_list_lac: encoded: 1a 07 05 01 24 ab cd 56 78 (rc = 9) |
Neels Hofmeyr | 74663d9 | 2018-03-23 01:46:42 +0100 | [diff] [blame] | 23 | ------- test_cell_id_list_add |
Neels Hofmeyr | a4399c8 | 2018-04-17 02:26:10 +0200 | [diff] [blame] | 24 | cell_id_list == CGI[0]:{} |
Neels Hofmeyr | 74663d9 | 2018-03-23 01:46:42 +0100 | [diff] [blame] | 25 | gsm0808_cell_id_list_add(&cil, &lac1) --> rc = 1 |
Neels Hofmeyr | a4399c8 | 2018-04-17 02:26:10 +0200 | [diff] [blame] | 26 | cell_id_list == LAC[1]:{123} |
Neels Hofmeyr | 74663d9 | 2018-03-23 01:46:42 +0100 | [diff] [blame] | 27 | gsm0808_cell_id_list_add(&cil, &lac1) --> rc = 0 |
Neels Hofmeyr | a4399c8 | 2018-04-17 02:26:10 +0200 | [diff] [blame] | 28 | cell_id_list == LAC[1]:{123} |
Neels Hofmeyr | 74663d9 | 2018-03-23 01:46:42 +0100 | [diff] [blame] | 29 | gsm0808_cell_id_list_add(&cil, &lac2) --> rc = 2 |
Neels Hofmeyr | a4399c8 | 2018-04-17 02:26:10 +0200 | [diff] [blame] | 30 | cell_id_list == LAC[3]:{123, 456, 789} |
Neels Hofmeyr | 74663d9 | 2018-03-23 01:46:42 +0100 | [diff] [blame] | 31 | gsm0808_cell_id_list_add(&cil, &lac2) --> rc = 0 |
Neels Hofmeyr | a4399c8 | 2018-04-17 02:26:10 +0200 | [diff] [blame] | 32 | cell_id_list == LAC[3]:{123, 456, 789} |
Neels Hofmeyr | 74663d9 | 2018-03-23 01:46:42 +0100 | [diff] [blame] | 33 | gsm0808_cell_id_list_add(&cil, &cil) --> rc = 0 |
Neels Hofmeyr | a4399c8 | 2018-04-17 02:26:10 +0200 | [diff] [blame] | 34 | cell_id_list == LAC[3]:{123, 456, 789} |
Neels Hofmeyr | 74663d9 | 2018-03-23 01:46:42 +0100 | [diff] [blame] | 35 | gsm0808_cell_id_list_add(&cil, &cgi1) --> rc = -22 |
Neels Hofmeyr | a4399c8 | 2018-04-17 02:26:10 +0200 | [diff] [blame] | 36 | cell_id_list == LAC[3]:{123, 456, 789} |
| 37 | * can't add to BSS list |
| 38 | cell_id_list == BSS[0] |
Neels Hofmeyr | 74663d9 | 2018-03-23 01:46:42 +0100 | [diff] [blame] | 39 | gsm0808_cell_id_list_add(&cil, &lac1) --> rc = -22 |
Neels Hofmeyr | a4399c8 | 2018-04-17 02:26:10 +0200 | [diff] [blame] | 40 | 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 Hofmeyr | 74663d9 | 2018-03-23 01:46:42 +0100 | [diff] [blame] | 43 | gsm0808_cell_id_list_add(&cil, &cgi1) --> rc = 1 |
Neels Hofmeyr | a4399c8 | 2018-04-17 02:26:10 +0200 | [diff] [blame] | 44 | cell_id_list == CGI[1]:{001-02-3-4} |
Neels Hofmeyr | 74663d9 | 2018-03-23 01:46:42 +0100 | [diff] [blame] | 45 | gsm0808_cell_id_list_add(&cil, &cgi1) --> rc = 0 |
Neels Hofmeyr | a4399c8 | 2018-04-17 02:26:10 +0200 | [diff] [blame] | 46 | cell_id_list == CGI[1]:{001-02-3-4} |
Neels Hofmeyr | 74663d9 | 2018-03-23 01:46:42 +0100 | [diff] [blame] | 47 | gsm0808_cell_id_list_add(&cil, &cgi2) --> rc = 2 |
Neels Hofmeyr | a4399c8 | 2018-04-17 02:26:10 +0200 | [diff] [blame] | 48 | cell_id_list == CGI[3]:{001-02-3-4, 001-002-3-4, 005-006-7-8} |
Neels Hofmeyr | 74663d9 | 2018-03-23 01:46:42 +0100 | [diff] [blame] | 49 | gsm0808_cell_id_list_add(&cil, &cgi2) --> rc = 0 |
Neels Hofmeyr | a4399c8 | 2018-04-17 02:26:10 +0200 | [diff] [blame] | 50 | 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 Hofmeyr | 74663d9 | 2018-03-23 01:46:42 +0100 | [diff] [blame] | 61 | cil.id_list_len = 126 |
| 62 | gsm0808_cell_id_list_add(&cil, &cgi2a) --> rc = 1 |
| 63 | cil.id_list_len = 127 |
Neels Hofmeyr | 74663d9 | 2018-03-23 01:46:42 +0100 | [diff] [blame] | 64 | cil.id_list_len = 126 |
| 65 | gsm0808_cell_id_list_add(&cil, &cgi3) --> rc = -28 |
| 66 | cil.id_list_len = 127 |
| 67 | gsm0808_cell_id_list_add(&cil, &cgi2a) --> rc = -28 |
| 68 | cil.id_list_len = 127 |
| 69 | ------- test_cell_id_list_add done |
Neels Hofmeyr | 250e7f7 | 2018-04-13 03:30:14 +0200 | [diff] [blame] | 70 | test_gsm0808_enc_dec_cell_id_lac: encoded: 05 03 05 01 24 (rc = 5) |
| 71 | test_gsm0808_enc_dec_cell_id_bss: encoded: 05 01 06 (rc = 3) |
| 72 | test_gsm0808_enc_dec_cell_id_no_cell: encoded: 05 01 03 (rc = 3) |
| 73 | test_gsm0808_enc_dec_cell_id_lai_and_lac: encoded: 05 06 04 21 63 54 23 42 (rc = 8) |
| 74 | test_gsm0808_enc_dec_cell_id_ci: encoded: 05 03 02 04 23 (rc = 5) |
| 75 | test_gsm0808_enc_dec_cell_id_lac_and_ci: encoded: 05 05 01 04 23 02 35 (rc = 7) |
| 76 | test_gsm0808_enc_dec_cell_id_global: encoded: 05 08 00 21 63 54 23 42 04 23 (rc = 10) |
Holger Hans Peter Freyther | 9751081 | 2012-01-22 13:36:52 +0100 | [diff] [blame] | 77 | Done |