smalltalk
/
osmo-st-gsm
Archived
1
0
Fork 0

GSM48Classmark1: Implement parsing the classmark

This commit is contained in:
Holger Hans Peter Freyther 2010-11-23 23:48:52 +01:00
parent 86642be3ef
commit 58f2f19c98
2 changed files with 16 additions and 0 deletions

View File

@ -89,7 +89,19 @@ Object subclass: GSM48Classmark1 [
yourself
]
GSM48Classmark1 class >> length: aByteArray [
^ 1
]
GSM48Classmark1 class >> parseFrom: aByteArray [
^ (self new)
cm1: (aByteArray at: 1);
yourself
]
cm1: aCm [ <category: 'creation'> cm1 := aCm ]
cm1 [ ^ cm1 ]
writeOnDirect: aMsg [
<category: 'creation'>
aMsg putByte: cm1.

View File

@ -140,6 +140,10 @@ TestCase subclass: GSM48Test [
gsm writeOnDirect: msg.
self assert: msg asByteArray = res.
self assert: (GSM48Classmark1 length: res) = res size.
gsm := GSM48Classmark1 parseFrom: res.
self assert: gsm cm1 = 16r33.
]
testMI [