tlv: Write the tag for conditional elements too
This was found while searching for regressions in the FakeBTS code.
This commit is contained in:
parent
abbad4a7af
commit
11bb698a0b
|
@ -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 [
|
||||
|
|
|
@ -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.
|
||||
]
|
||||
]
|
||||
|
|
Reference in New Issue