diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2013-04-01 15:08:07 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2013-04-01 15:08:07 +0200 |
commit | 0dd9a2287cedf93982fb342185f65943ea966da5 (patch) | |
tree | 839c47db0b9bb9ffe41bdf322311d8ddf29275c2 | |
parent | 94498315cbf04f1762c1329abcfb8d6fcc0334bd (diff) |
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.
-rw-r--r-- | Tests.st | 12 | ||||
-rw-r--r-- | ua/M2UA.st | 5 |
2 files changed, 17 insertions, 0 deletions
@@ -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 [ |