diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-11-20 20:21:46 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-11-20 21:46:51 +0100 |
commit | 4e6d696e5b568c4f1df22b84015bfa873594c0ac (patch) | |
tree | df0ae83bb3a7a0d58487558eb15ae897dcbbd568 /Tests.st | |
parent | 47140f12d7681d5591200624bdcb4e491348d489 (diff) |
SCCP: Implement parsing the SCCPConnectionRequest
Diffstat (limited to 'Tests.st')
-rw-r--r-- | Tests.st | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -23,7 +23,10 @@ TestCase subclass: SCCPTests [ ] testCR [ - | cr msg | + | cr msg target | + target := #(1 191 0 3 2 2 4 2 66 254 15 4 49 50 51 52 0) asByteArray. + + "encode it" cr := SCCPConnectionRequest initWith: 16r0300BF dest: (SCCPAddress createWith: 254) @@ -31,7 +34,14 @@ TestCase subclass: SCCPTests [ msg := cr toMessage asByteArray. msg printNl. - self assert: msg = #(1 191 0 3 2 2 4 2 66 254 15 4 49 50 51 52 0) asByteArray + self assert: msg = target. + + "now decode it" + cr := SCCPMessage decode: target. + self assert: (cr isKindOf: SCCPConnectionRequest). + self assert: cr src = 16r0300BF. + self assert: cr dest asByteArray = (SCCPAddress createWith: 254) asByteArray. + self assert: cr data = '1234' asByteArray. ] testCC [ |