1
0
Fork 0

ua: Add a testcase for M2UAMSG>>#findTag:ifAbsent:, fix the code

Make the findTag:ifAbent: work. The tag didn't have the isTag
query selector.
This commit is contained in:
Holger Hans Peter Freyther 2013-04-01 15:08:07 +02:00
parent 94498315cb
commit 0dd9a2287c
2 changed files with 17 additions and 0 deletions

View File

@ -308,6 +308,18 @@ TestCase subclass: M2UAMSGTests [
self assert: msg msgClass = UAConstants clsMAUP.
self assert: msg msgType = UAConstants maupData.
]
testFindTag [
| inp msg tag |
inp := #(16r01 16r00 16r03 16r01 16r00 16r00 16r00 16r10 16r00
16r11 16r00 16r08 16rAC 16r10 16r01 16r51) asByteArray.
msg := M2UAMSG parseFrom: inp.
tag := msg findTag: M2UAConstants tagReserved ifAbsent: [ nil ].
self assert: tag isNil.
tag := msg findTag: M2UAConstants tagAspIdent ifAbsent: [self fail].
self deny: tag isNil.
]
]
TestCase subclass: OsmoUDPSocketTest [

View File

@ -282,6 +282,11 @@ Object subclass: M2UATag [
aMsg putByteArray: (ByteArray new: 4 - rest).
].
]
isTag: aNr [
<category: 'accessing'>
^ self nr = aNr
]
]
Object subclass: M2UAMSG [