aboutsummaryrefslogtreecommitdiffstats
path: root/Tests.st
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-11-20 20:21:46 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-11-20 21:46:51 +0100
commit4e6d696e5b568c4f1df22b84015bfa873594c0ac (patch)
treedf0ae83bb3a7a0d58487558eb15ae897dcbbd568 /Tests.st
parent47140f12d7681d5591200624bdcb4e491348d489 (diff)
SCCP: Implement parsing the SCCPConnectionRequest
Diffstat (limited to 'Tests.st')
-rw-r--r--Tests.st14
1 files changed, 12 insertions, 2 deletions
diff --git a/Tests.st b/Tests.st
index 4d0a0e2..f1a6063 100644
--- a/Tests.st
+++ b/Tests.st
@@ -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 [