summaryrefslogtreecommitdiffstats
path: root/tests/gsm0808/gsm0808_test.ok
blob: 6cd7982b65ce1d1d25d445463b103b4a98818c77 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
Testing generation of GSM0808 messages
Testing creating Layer3
Testing creating Layer3 (AoIP)
Testing creating Reset
Testing creating Reset Ack
Testing creating Clear Command
Testing creating Clear Complete
Testing creating Chipher Mode Command
Testing creating Cipher Complete
Testing creating Cipher Reject
Testing creating CM U
Testing creating SAPI Reject
Testing creating Assignment Request
Testing creating Assignment Complete
Testing creating Assignment Complete (AoIP)
Testing creating Assignment Failure
Testing creating Assignment Failure (AoIP)
Testing creating Clear Request
Testing creating Paging Request
Testing creating DTAP
Testing prepend DTAP
test_gsm0808_enc_dec_cell_id_list_lac: encoded: 1a 07 05 01 24 ab cd 56 78 (rc = 9)
------- test_cell_id_list_add
     cell_id_list == CGI[0]:{}
gsm0808_cell_id_list_add(&cil, &lac1) --> rc = 1
     cell_id_list == LAC[1]:{123}
gsm0808_cell_id_list_add(&cil, &lac1) --> rc = 0
     cell_id_list == LAC[1]:{123}
gsm0808_cell_id_list_add(&cil, &lac2) --> rc = 2
     cell_id_list == LAC[3]:{123, 456, 789}
gsm0808_cell_id_list_add(&cil, &lac2) --> rc = 0
     cell_id_list == LAC[3]:{123, 456, 789}
gsm0808_cell_id_list_add(&cil, &cil) --> rc = 0
     cell_id_list == LAC[3]:{123, 456, 789}
gsm0808_cell_id_list_add(&cil, &cgi1) --> rc = -22
     cell_id_list == LAC[3]:{123, 456, 789}
* can't add to BSS list
     cell_id_list == BSS[0]
gsm0808_cell_id_list_add(&cil, &lac1) --> rc = -22
     cell_id_list == BSS[0]
* other types (including NO_CELL) take on new type iff empty
     cell_id_list == NO-CELL[0]
gsm0808_cell_id_list_add(&cil, &cgi1) --> rc = 1
     cell_id_list == CGI[1]:{001-02-3-4}
gsm0808_cell_id_list_add(&cil, &cgi1) --> rc = 0
     cell_id_list == CGI[1]:{001-02-3-4}
gsm0808_cell_id_list_add(&cil, &cgi2) --> rc = 2
     cell_id_list == CGI[3]:{001-02-3-4, 001-002-3-4, 005-006-7-8}
gsm0808_cell_id_list_add(&cil, &cgi2) --> rc = 0
     cell_id_list == CGI[3]:{001-02-3-4, 001-002-3-4, 005-006-7-8}
* test gsm0808_cell_id_list_name_buf()'s return val
  strlen(gsm0808_cell_id_list_name(cil)) == 45
  gsm0808_cell_id_list_name_buf(buf, 46, cil)) == 45 "CGI[3]:{001-02-3-4, 001-002-3-4, 005-006-7-8}"
  gsm0808_cell_id_list_name_buf(buf, 23, cil)) == 45 "CGI[3]:{001-02-3-4, 00"
  gsm0808_cell_id_list_name_buf(buf, 11, cil)) == 45 "CGI[3]:{00"
  gsm0808_cell_id_list_name_buf(buf, 5, cil)) == 45 "CGI["
  gsm0808_cell_id_list_name_buf(buf, 2, cil)) == 45 "C"
  gsm0808_cell_id_list_name_buf(buf, 1, cil)) == 45 ""
  gsm0808_cell_id_list_name_buf(buf, 0, cil)) == 45 "#"
* list-full behavior
cil.id_list_len = 126
gsm0808_cell_id_list_add(&cil, &cgi2a) --> rc = 1
cil.id_list_len = 127
cil.id_list_len = 126
gsm0808_cell_id_list_add(&cil, &cgi3) --> rc = -28
cil.id_list_len = 127
gsm0808_cell_id_list_add(&cil, &cgi2a) --> rc = -28
cil.id_list_len = 127
------- test_cell_id_list_add done
test_gsm0808_enc_dec_cell_id_lac: encoded: 05 03 05 01 24 (rc = 5)
test_gsm0808_enc_dec_cell_id_bss: encoded: 05 01 06 (rc = 3)
test_gsm0808_enc_dec_cell_id_no_cell: encoded: 05 01 03 (rc = 3)
test_gsm0808_enc_dec_cell_id_lai_and_lac: encoded: 05 06 04 21 63 54 23 42 (rc = 8)
test_gsm0808_enc_dec_cell_id_ci: encoded: 05 03 02 04 23 (rc = 5)
test_gsm0808_enc_dec_cell_id_lac_and_ci: encoded: 05 05 01 04 23 02 35 (rc = 7)
test_gsm0808_enc_dec_cell_id_global: encoded: 05 08 00 21 63 54 23 42 04 23 (rc = 10)
Done