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:
parent
94498315cb
commit
0dd9a2287c
12
Tests.st
12
Tests.st
|
@ -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 [
|
||||
|
|
|
@ -282,6 +282,11 @@ Object subclass: M2UATag [
|
|||
aMsg putByteArray: (ByteArray new: 4 - rest).
|
||||
].
|
||||
]
|
||||
|
||||
isTag: aNr [
|
||||
<category: 'accessing'>
|
||||
^ self nr = aNr
|
||||
]
|
||||
]
|
||||
|
||||
Object subclass: M2UAMSG [
|
||||
|
|
Reference in New Issue