aboutsummaryrefslogtreecommitdiffstats
path: root/SMSTests.st
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2012-10-28 13:44:56 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2012-11-15 17:02:36 +0100
commit1c95d092e6b310e9e1dce1e0aeb503991d19e5f0 (patch)
treec9124ca30c56fe75a883143ae22daa0e7a194b92 /SMSTests.st
parentc7bd5a49d283946d8ab85755569ef94a36ae7e4c (diff)
gsm04.11: Beging with message handling for GSM 04.11 (SMS)
It is not clear of how much parsing/handling code can be shared with the GSM04.08 code. There are also a lot less IEs to handle for SMS so we might not need the fixed size/data holder classes.
Diffstat (limited to 'SMSTests.st')
-rw-r--r--SMSTests.st45
1 files changed, 45 insertions, 0 deletions
diff --git a/SMSTests.st b/SMSTests.st
new file mode 100644
index 0000000..fcb2291
--- /dev/null
+++ b/SMSTests.st
@@ -0,0 +1,45 @@
+"
+ (C) 2012 by Holger Hans Peter Freyther
+ All Rights Reserved
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+"
+
+TestCase subclass: GSM411Test [
+ testCPData [
+ | inp dec |
+ inp := #(16r09 16r01 16r35 16r01 16r2A 16r07 16r91 16r44
+ 16r77 16r58 16r10 16r06 16r50 16r00 16r2B 16r04
+ 16r04 16r81 16r32 16r24 16r00 16r00 16r80 16r21
+ 16r03 16r41 16r24 16r32 16r40 16r1F 16r41 16r26
+ 16r03 16r94 16r7D 16r56 16rA5 16r20 16r28 16rF2
+ 16rE9 16r2C 16r82 16r82 16rD2 16r22 16r48 16r58
+ 16r64 16r3E 16r9D 16r47 16r10 16rF5 16r09 16rAA) asByteArray.
+ dec := GSM48MSG decode: inp readStream.
+
+ self
+ assert: dec type = GSMCpData messageType;
+ assert: dec toMessage asByteArray = inp.
+ ]
+
+ testCPData2 [
+ | inp dec |
+ inp := #(16r89 16r01 16r02 16r02 16r2A) asByteArray.
+ dec := GSM48MSG decode: inp readStream.
+
+ self
+ assert: dec type = GSMCpData messageType;
+ assert: dec toMessage asByteArray = inp.
+ ]
+]