smalltalk
/
osmo-st-gsm
Archived
1
0
Fork 0

GSM48: Start adding test cases for the functionality.

This commit is contained in:
Holger Hans Peter Freyther 2010-11-17 22:39:41 +01:00
parent 0460887b1a
commit 4b90b71d92
2 changed files with 51 additions and 0 deletions

View File

@ -65,3 +65,53 @@ TestCase subclass: BSSAPTest [
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.
]
]

View File

@ -14,6 +14,7 @@
<test>
<sunit>OsmoTestPhone.GSM0808Test</sunit>
<sunit>OsmoTestPhone.BSSAPTest</sunit>
<sunit>OsmoTestPhone.GSM48Test</sunit>
<filein>Tests.st</filein>
</test>