diff options
author | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2014-05-13 19:12:16 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2014-05-13 19:12:16 +0200 |
commit | fbc0861df99a0859165288e1bff2658618646751 (patch) | |
tree | 7a7c19c06c29e4e3e7d660ad15fa44a61971d98b | |
parent | 9f539f1c1343cc47d1bea8f750a1cf319facf42b (diff) |
submit: Implement round-trip handling
Fix the variable name and test round-trip handling.
-rw-r--r-- | codec/SMPPSubmitSM.st | 2 | ||||
-rw-r--r-- | test/SMPPMessageTest.st | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/codec/SMPPSubmitSM.st b/codec/SMPPSubmitSM.st index 3b078a2..05950bb 100644 --- a/codec/SMPPSubmitSM.st +++ b/codec/SMPPSubmitSM.st @@ -65,7 +65,7 @@ SMPPBodyBase subclass: SMPPSubmitSM [ add: (SMPPValueHolder for: #source_port tag: 16r020A); add: (SMPPValueHolder for: #source_addr_subunit tag: 16r000D); add: (SMPPValueHolder for: #destination_port tag: 16r020B); - add: (SMPPValueHolder for: #dest_addr_submit tag: 16r0005); + add: (SMPPValueHolder for: #dest_addr_subunit tag: 16r0005); add: (SMPPValueHolder for: #sar_msg_ref_num tag: 16r020C); add: (SMPPValueHolder for: #sar_total_segments tag: 16r020E); add: (SMPPValueHolder for: #sar_segment_seqnum tag: 16r020F); diff --git a/test/SMPPMessageTest.st b/test/SMPPMessageTest.st index 77a58fa..d77ade8 100644 --- a/test/SMPPMessageTest.st +++ b/test/SMPPMessageTest.st @@ -130,11 +130,15 @@ TestCase subclass: SMPPMessageTest [ ] testSubmitSM [ - | msg | + | msg res | msg := SMPPMessage readFrom: self exampleSubmitSM readStream. self assert: msg body class equals:SMPPSubmitSM. self assert: msg body shortMessage equals: 'Dies ist eine Testnachricht! 2014-03-01_16.40.42'. self assert: msg body sourceAddress equals: '9225001'. self assert: msg body destinationAddress equals: '40099916'. + + "Do round trip test" + res := msg toMessage asByteArray. + self assert: res equals: self exampleSubmitSM. ] ] |