1
0
Fork 0

tlv: Write the tag for conditional elements too

This was found while searching for regressions in the FakeBTS code.
This commit is contained in:
Holger Hans Peter Freyther 2014-04-19 09:55:19 +02:00
parent abbad4a7af
commit 11bb698a0b
2 changed files with 12 additions and 1 deletions

View File

@ -157,7 +157,7 @@ Object subclass: TLVDescription [
needsTag [
<category: 'access'>
^force_tag or: [self hasTag and: [self isOptional]].
^force_tag or: [self hasTag and: [self isOptional or: [self isConditional]]].
]
presenceKind: aKind [

View File

@ -59,4 +59,15 @@ TestCase subclass: TLVDescriptionTest [
assert: tlv hasTag;
deny: tlv hasLength.
]
testNeedsTag [
| tlv |
tlv := TLVDescription new
tag: 16r23;
beTV;
beConditional;
yourself.
self assert: tlv needsTag.
]
]