GSM48: Start adding test cases for the functionality.
This commit is contained in:
parent
0460887b1a
commit
4b90b71d92
50
Tests.st
50
Tests.st
|
@ -65,3 +65,53 @@ TestCase subclass: BSSAPTest [
|
||||||
self assert: msg toByteArray = #(1 0 3 1 2 3) asByteArray.
|
self assert: msg toByteArray = #(1 0 3 1 2 3) asByteArray.
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
|
||||||
|
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.
|
||||||
|
]
|
||||||
|
]
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
<test>
|
<test>
|
||||||
<sunit>OsmoTestPhone.GSM0808Test</sunit>
|
<sunit>OsmoTestPhone.GSM0808Test</sunit>
|
||||||
<sunit>OsmoTestPhone.BSSAPTest</sunit>
|
<sunit>OsmoTestPhone.BSSAPTest</sunit>
|
||||||
|
<sunit>OsmoTestPhone.GSM48Test</sunit>
|
||||||
<filein>Tests.st</filein>
|
<filein>Tests.st</filein>
|
||||||
</test>
|
</test>
|
||||||
|
|
||||||
|
|
Reference in New Issue