aboutsummaryrefslogtreecommitdiffstats
path: root/Tests.st
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2011-04-01 01:39:53 +0200
committerHolger Hans Peter Freyther <zecke@selfish.org>2011-04-01 01:39:53 +0200
commit47d3ad3ad9a27991d9118c70283f54c5f99f32f7 (patch)
tree6cfda91cca0198f6cb036561ebc1ef7a5b8bb54b /Tests.st
parent9ce4aebeb265b5f9ffe189b8dd1dad9cc2c196e8 (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.st15
1 files changed, 15 insertions, 0 deletions
diff --git a/Tests.st b/Tests.st
index 38cfa80..84cf047 100644
--- a/Tests.st
+++ b/Tests.st
@@ -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.
+ ]
]