46 lines
1.7 KiB
Smalltalk
46 lines
1.7 KiB
Smalltalk
|
"
|
||
|
(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.
|
||
|
]
|
||
|
]
|