diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2011-04-01 01:39:53 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2011-04-01 01:39:53 +0200 |
commit | 47d3ad3ad9a27991d9118c70283f54c5f99f32f7 (patch) | |
tree | 6cfda91cca0198f6cb036561ebc1ef7a5b8bb54b /Tests.st | |
parent | 9ce4aebeb265b5f9ffe189b8dd1dad9cc2c196e8 (diff) |
gsm: Implement 7bit decoding for USSD and test the CR cases
When CR is the last byte and it ended on a word boundary we
will remove it (it was added to avoid the clash with '@') but
if we have added a CR with a padding of a single 0 bit we will
keep this additional CR.
Diffstat (limited to 'Tests.st')
-rw-r--r-- | Tests.st | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -564,10 +564,25 @@ TestCase subclass: GSMEncodingTest [ self assert: '123456789012345' asUSSD7Bit = wanted. ] + testUSSDDecode [ + | wanted | + + wanted := '123456789012345'. + self assert: #(49 217 140 86 179 221 112 57 88 76 54 163 213 26) asByteArray decodeUSSD7Bit = wanted. + ] + testUSSDEncodeCR [ | wanted res | wanted := #(49 217 140 86 179 221 26 13) asByteArray. self assert: ('1234567', Character cr asString) asUSSD7Bit = wanted. ] + + testUSSDDecodeCR [ + | wanted | + "This tests that the code as adding an extra CR and that it was + not removed from the input." + wanted := '1234567', Character cr asString, Character cr asString. + self assert: #(49 217 140 86 179 221 26 13) asByteArray decodeUSSD7Bit = wanted. + ] ] |