2010-11-17 09:21:48 +00:00
|
|
|
TestCase subclass: GSM0808Test [
|
|
|
|
testLAI [
|
|
|
|
| lai res |
|
|
|
|
res := #(16r72 16rF4 16r80) asByteArray.
|
|
|
|
lai := LAI generateLAI: 274 mnc: 8.
|
|
|
|
|
|
|
|
self assert: lai = res.
|
|
|
|
]
|
|
|
|
|
|
|
|
testCellIE [
|
|
|
|
| ie res msg |
|
|
|
|
|
|
|
|
res := #(5 8 0 114 244 128 32 18 117 48) asByteArray.
|
|
|
|
msg := Osmo.MessageBuffer new.
|
|
|
|
|
|
|
|
ie := GSMCellIdentifier initWith: 274 mnc: 8 lac: 8210 ci: 30000.
|
|
|
|
ie storeOn: msg.
|
|
|
|
|
|
|
|
self assert: msg toByteArray = res.
|
|
|
|
]
|
|
|
|
|
|
|
|
testLayer3IE [
|
|
|
|
| ie res msg |
|
|
|
|
|
|
|
|
res := #(23 3 1 2 3) asByteArray.
|
|
|
|
msg := Osmo.MessageBuffer new.
|
|
|
|
ie := GSMLayer3Info initWith: #(1 2 3) asByteArray.
|
|
|
|
ie storeOn: msg.
|
|
|
|
|
|
|
|
self assert: msg toByteArray = res.
|
|
|
|
]
|
|
|
|
|
|
|
|
testComplL3 [
|
|
|
|
| msg buf ie res |
|
2010-11-17 09:26:28 +00:00
|
|
|
msg := IEMessage initWith: GSM0808Helper msgComplL3.
|
2010-11-17 09:21:48 +00:00
|
|
|
|
|
|
|
msg addIe: (GSMCellIdentifier initWith: 274 mnc: 8 lac: 8210 ci: 30000).
|
|
|
|
msg addIe: (GSMLayer3Info initWith: #(1 2 3) asByteArray).
|
|
|
|
|
|
|
|
buf := Osmo.MessageBuffer new.
|
|
|
|
msg storeOn: buf.
|
|
|
|
|
|
|
|
res := #(16r57 16r05 16r08 16r00 16r72 16rF4 16r80 16r20 16r12
|
|
|
|
16r75 16r30 16r17 16r03 16r01 16r02 16r03) asByteArray.
|
|
|
|
self assert: buf toByteArray = res
|
|
|
|
]
|
|
|
|
]
|
2010-11-17 15:57:09 +00:00
|
|
|
|
|
|
|
TestCase subclass: BSSAPTest [
|
|
|
|
testPrependManagment [
|
|
|
|
| msg |
|
|
|
|
msg := Osmo.MessageBuffer new.
|
|
|
|
msg putByteArray: #(1 2 3) asByteArray.
|
|
|
|
|
|
|
|
BSSAPHelper prependManagement: msg.
|
|
|
|
self assert: msg toByteArray = #(0 3 1 2 3) asByteArray.
|
|
|
|
]
|
|
|
|
|
|
|
|
testPrependDTAP [
|
|
|
|
| msg |
|
|
|
|
msg := Osmo.MessageBuffer new.
|
|
|
|
msg putByteArray: #(1 2 3) asByteArray.
|
|
|
|
|
|
|
|
BSSAPHelper prependDTAP: msg dlci: 0.
|
|
|
|
self assert: msg toByteArray = #(1 0 3 1 2 3) asByteArray.
|
|
|
|
]
|
|
|
|
]
|
2010-11-17 21:39:41 +00:00
|
|
|
|
|
|
|
TestCase subclass: GSM48Test [
|
|
|
|
testKeySeqLu [
|
|
|
|
| gsm msg |
|
|
|
|
msg := Osmo.MessageBuffer new.
|
|
|
|
gsm := GSM48KeySeqLuType createDefault.
|
|
|
|
gsm storeOnDirect: msg.
|
|
|
|
|
|
|
|
self assert: msg toByteArray = #(16r70) asByteArray
|
|
|
|
]
|
|
|
|
|
|
|
|
testLai [
|
|
|
|
| gsm msg |
|
|
|
|
msg := Osmo.MessageBuffer new.
|
|
|
|
gsm := GSM48Lai createDefault.
|
|
|
|
gsm mcc: 202; mnc: 5; lac: 65534.
|
|
|
|
gsm storeOnDirect: msg.
|
|
|
|
|
|
|
|
self assert: msg toByteArray = #(16r02 16rF2 16r50 16rFF 16rFE) asByteArray.
|
|
|
|
]
|
|
|
|
|
|
|
|
testCM1 [
|
|
|
|
| gsm msg |
|
|
|
|
msg := Osmo.MessageBuffer new.
|
|
|
|
gsm := GSM48Classmark1 createDefault.
|
|
|
|
gsm storeOnDirect: msg.
|
|
|
|
|
|
|
|
self assert: msg toByteArray = #(16r33) asByteArray
|
|
|
|
]
|
|
|
|
|
|
|
|
testMI [
|
|
|
|
| gsm msg |
|
|
|
|
msg := Osmo.MessageBuffer new.
|
|
|
|
gsm := GSM48MIdentity createDefault.
|
|
|
|
gsm imsi: '181818181818181'.
|
|
|
|
gsm storeOnDirect: msg.
|
|
|
|
|
|
|
|
self assert: msg toByteArray = #() asByteArray
|
|
|
|
]
|
|
|
|
|
|
|
|
testLU [
|
|
|
|
| msg |
|
|
|
|
|
|
|
|
msg := LocationUpdatingRequest new.
|
|
|
|
(msg lai) mcc: 272 mnc: 5 lac: 65534.
|
|
|
|
(msg mi) imsi: '181818181818181'.
|
|
|
|
|
|
|
|
self assert: msg toByteArray = #() asByteArray.
|
|
|
|
]
|
|
|
|
]
|