2010-10-16 17:28:35 +00:00
|
|
|
"Test Case for Osmo-Network"
|
|
|
|
|
|
|
|
TestCase subclass: SCCPTests [
|
|
|
|
SCCPTests class >> packageNamesUnderTest [
|
|
|
|
<category: 'accessing'>
|
|
|
|
^ #('OsmoNetwork')
|
|
|
|
]
|
|
|
|
|
|
|
|
testReleasedFormat [
|
|
|
|
| rlsd msg |
|
|
|
|
rlsd := SCCPConnectionReleased initWith: 16r1F0A01 dest: 16r401 cause: 16rFE.
|
|
|
|
msg := rlsd toMessage toByteArray.
|
|
|
|
|
|
|
|
self assert: msg = #(4 1 4 0 1 16r0A 16r1F 16rFE 1 0) asByteArray
|
|
|
|
]
|
2010-10-16 18:08:47 +00:00
|
|
|
|
|
|
|
testDT1 [
|
|
|
|
| dt1 msg |
|
|
|
|
dt1 := SCCPConnectionData initWith: 16r401 data: '1234' asByteArray.
|
|
|
|
msg := dt1 toMessage toByteArray.
|
|
|
|
|
|
|
|
self assert: msg = #(6 1 4 0 0 1 4 49 50 51 52) asByteArray.
|
|
|
|
]
|
2010-11-15 18:07:37 +00:00
|
|
|
|
|
|
|
testCR [
|
|
|
|
| cr msg |
|
|
|
|
cr := SCCPConnectionRequest
|
|
|
|
initWith: 16r0300BF
|
|
|
|
dest: (SCCPAddress createWith: 254)
|
|
|
|
data: '1234' asByteArray.
|
|
|
|
msg := cr toMessage toByteArray.
|
|
|
|
msg printNl.
|
|
|
|
|
|
|
|
self assert: msg = #(1 191 0 3 2 2 4 2 66 254 15 4 49 50 51 52 0) asByteArray
|
|
|
|
]
|
2010-11-15 18:36:41 +00:00
|
|
|
|
2010-11-15 19:03:49 +00:00
|
|
|
testCC [
|
|
|
|
| target cc |
|
|
|
|
|
|
|
|
target := #(2 191 0 3 1 3 176 2 1 0) asByteArray.
|
|
|
|
cc := SCCPConnectionConfirm parseFrom: target.
|
|
|
|
|
|
|
|
self assert: cc dst = 16r0300BF.
|
|
|
|
self assert: cc src = 16rB00301.
|
|
|
|
]
|
|
|
|
|
2010-11-15 18:36:41 +00:00
|
|
|
testAddrFromByteArray [
|
|
|
|
| byte |
|
|
|
|
byte := #(191 0 3) asByteArray.
|
|
|
|
self assert: (SCCPAddrReference fromByteArray: byte) = 16r0300BF
|
|
|
|
]
|
2010-10-16 17:28:35 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
TestCase subclass: IPATests [
|
|
|
|
IPATests class >> packageNamesUnderTest [
|
|
|
|
<category: 'accessing'>
|
|
|
|
^ #('OsmoNetwork')
|
|
|
|
]
|
|
|
|
|
|
|
|
testSize [
|
2010-10-19 08:06:11 +00:00
|
|
|
self assert: IPASCCPState sizeof = 25.
|
2010-10-16 17:28:35 +00:00
|
|
|
]
|
|
|
|
]
|