1
0
Fork 0
This repository has been archived on 2022-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
osmo-st-network/Tests.st

64 lines
1.6 KiB
Smalltalk
Raw Normal View History

"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
]
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 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.
]
testAddrFromByteArray [
| byte |
byte := #(191 0 3) asByteArray.
self assert: (SCCPAddrReference fromByteArray: byte) = 16r0300BF
]
]
TestCase subclass: IPATests [
IPATests class >> packageNamesUnderTest [
<category: 'accessing'>
^ #('OsmoNetwork')
]
testSize [
self assert: IPASCCPState sizeof = 25.
]
]