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.
|
|
|
|
]
|
|
|
|
]
|