ETSI's Bug Tracker - Part 01: TTCN-3 Core Language
View Issue Details
0007200Part 01: TTCN-3 Core LanguageTechnicalpublic15-10-2015 09:1410-12-2015 16:54
tepelmann 
Gyorgy Rethy 
normalminorhave not tried
closedfixed 
 
v4.8.1 (published 2016-07)v4.8.1 (published 2016-07) 
6.2.4, C.1.30
Testing Technologies
0007200: Allow ranges and value list for enumerated types
The type enumerated provides the tester with meaningful values during development and execution without the necessity to interpret specific values.
However there is one disadvantage in cases where not all possible values are specified inside the enumerated, e.g. reserved values. This occurs in the majority of protocol specifications.
Simple example: A 8Bit enocded enumerated Color -
type enumerated Color {
  e_red(0),
  e_green(1),
  e_blue(2),
  e_reserved
}

On the sending side it is not possible to select all values - e_reserved has only one value: 3, where values between 0 and 255 would be selectable.
On the receiving side there are two possible pitfalls in case of receiving a value not expressed by the enumerated type. Either you get an error because the value is not assignable, or you have special decoding mapping the unassignable value to 'reserved' but loosing the actual value.

Proposal: Allow ranges and value list for the type enumerated
E.g.
type enumerated Color {
  e_red(0),
  e_green(1),
  e_blue(2),
  e_reserved(3..255)
}

type enumerated Color {
  e_red(0),
  e_green(1),
  e_blue(3),
  e_reserved(2,4..255)
}

For the sending(and receiving) side the explicit value of 'reserved' could be expressed in brackets - reserved(127).
For receiving - where the actual value is unknown beforehand - the actual value could be retrieved via the existing enum2int predefined function.

If the explicit value is not given the lowest possible value could be used by default - this is the current behaviour.

No tags attached.
docx CR7200.docx (520,017) 04-11-2015 17:14
http://oldforge.etsi.org/mantis/file_download.php?file_id=3364&type=bug
docx CR7200-1-v2.docx (254,422) 05-11-2015 14:08
http://oldforge.etsi.org/mantis/file_download.php?file_id=3368&type=bug
docx CR7200-1-v3.docx (314,507) 09-12-2015 15:47
http://oldforge.etsi.org/mantis/file_download.php?file_id=3389&type=bug
Issue History
15-10-2015 09:14tepelmannNew Issue
02-11-2015 08:56tepelmannNote Added: 0013432
03-11-2015 16:42Gyorgy RethyNote Added: 0013480
03-11-2015 16:42Gyorgy RethyAssigned To => Jacob Wieland - Spirent
03-11-2015 16:42Gyorgy RethyStatusnew => assigned
04-11-2015 13:59Gyorgy RethyTarget Version => v4.8.1 (published 2016-07)
04-11-2015 17:14Jacob Wieland - SpirentFile Added: CR7200.docx
04-11-2015 17:15Jacob Wieland - SpirentNote Added: 0013493
04-11-2015 17:16Jacob Wieland - SpirentAssigned ToJacob Wieland - Spirent => Jens Grabowski
04-11-2015 17:16Jacob Wieland - SpirentStatusassigned => confirmed
05-11-2015 14:07Jens GrabowskiNote Added: 0013501
05-11-2015 14:08Jens GrabowskiFile Added: CR7200-1-v2.docx
05-11-2015 14:08Jens GrabowskiAssigned ToJens Grabowski => Gyorgy Rethy
05-11-2015 14:08Jens GrabowskiStatusconfirmed => assigned
05-11-2015 14:09Jens GrabowskiStatusassigned => confirmed
06-11-2015 08:53Gyorgy RethyNote Edited: 0013480bug_revision_view_page.php?bugnote_id=13480#r214
09-12-2015 15:30Gyorgy RethyFile Added: CR7200-1-v3.docx
09-12-2015 15:31Gyorgy RethyFile Deleted: CR7200-1-v3.docx
09-12-2015 15:47Gyorgy RethyFile Added: CR7200-1-v3.docx
09-12-2015 15:50Gyorgy RethyNote Added: 0013571
09-12-2015 15:50Gyorgy RethyStatusconfirmed => resolved
09-12-2015 15:50Gyorgy RethyFixed in Version => v4.8.1 (published 2016-07)
09-12-2015 15:50Gyorgy RethyResolutionopen => fixed
10-12-2015 16:54Gyorgy RethyNote Added: 0013582
10-12-2015 16:54Gyorgy RethyStatusresolved => closed

Notes
(0013432)
tepelmann   
02-11-2015 08:56   
Real world example: 3GPP TS 24.008, 10.5.3.3 CM service type:
Service type (octet 1)
Bits
4 3 2 1
0 0 0 1 Mobile originating call establishment or packet mode connection establishment
0 0 1 0 Emergency call establishment
0 1 0 0 Short message service
1 0 0 0 Supplementary service activation
1 0 0 1 Voice group call establishment
1 0 1 0 Voice broadcast call establishment
1 0 1 1 Location Services (NOTE)
                
All other values are reserved.

Could result in:
type enumerated CM_ServiceType {
  e_mobileOrigCallEstab_packetModConEstab(1),
  e_emergCallEstab(2),
  e_sms(4),
  e_supplServAct(8),
  e_voiceGroupCallEstab(9),
  e_voiceBcastCallEstab(10),
  e_locServices(11),
  reserved(3, 5..6, 12..15)
}
(0013480)
Gyorgy Rethy   
03-11-2015 16:42   
(edited on: 06-11-2015 08:53)
STF discussion: practical usefulness is agreed. The "range" enumerated names can be used as TTCN-3 values with concrete associated integer values only. Otherwise they can be used in templates.
Prepare a concrete proposal.

(0013493)
Jacob Wieland - Spirent   
04-11-2015 17:15   
added proposal allowing enum ranges, enum values with single integer and enum templates with integer template list

please review
(0013501)
Jens Grabowski   
05-11-2015 14:07   
Corrected one or two typos.

György: In this resolution, Jacob also corrected examples on page 12 of the attachment which are not directly related to enum ranges. Please check them also. For this reason a put this issue to confirm instead of resolved.
(0013571)
Gyorgy Rethy   
09-12-2015 15:50   
1 example causing error is added to $6.2.4 (enumerated value with associated integer is used) plus editorials.
(0013582)
Gyorgy Rethy   
10-12-2015 16:54   
Added to draft V4.7.4