ETSI's Bug Tracker - Part 01: TTCN-3 Core Language
View Issue Details

ID | Project | Category | View Status | Date Submitted | Last Update
0005171 | Part 01: TTCN-3 Core Language | New Feature | public | 12-05-2009 12:38 | 16-02-2010 07:20

Reporter | Wolfgang Seka |
Assigned To | Ina Schieferdecker |
Priority | normal | Severity | minor | Reproducibility | have not tried
Status | closed | Resolution | fixed |
Platform |  | OS |  | OS Version |
Product Version |  |
Target Version | v4.2.1 (published 2010-07) | Fixed in Version | v4.2.1 (published 2010-07) |
Clause Reference(s) | TTCN-3 Core Language: Annex C or D
Source (company - Author) | MCC160

Summary | 0005171: function or macro to return name of the current test case ("__TESTCASE__")
Description | For some purposes it is necessary to assign values (e.g. in templates) depending on the test case but it may be unacceptable efford to hand through this information to each and every function or template. Note: in case of templates it is not possible to use global variables; only formal parameters, modulepars, constants or functions with no "runs on" may be used
Steps To Reproduce |
Additional Information |
Tags | No tags attached.
Relationships |

Attached Files

CR5171_testcasename.doc (128,512) 01-07-2009 15:12
http://oldforge.etsi.org/mantis/file_download.php?file_id=2148&type=bug
CR5171_testcasename_v2.doc (136,192) 03-07-2009 11:11
http://oldforge.etsi.org/mantis/file_download.php?file_id=2155&type=bug
CR5171_testcasename_v3.doc (137,216) 03-07-2009 12:14
http://oldforge.etsi.org/mantis/file_download.php?file_id=2159&type=bug
CR5171_testcasename_v4.doc (203,776) 10-07-2009 11:00
http://oldforge.etsi.org/mantis/file_download.php?file_id=2205&type=bug
CR5171_testcasename_v5.doc (203,776) 10-07-2009 12:11
http://oldforge.etsi.org/mantis/file_download.php?file_id=2206&type=bug

Issue History
Date Modified | Username | Field | Change
12-05-2009 12:38 | Wolfgang Seka | New Issue |
12-05-2009 12:38 | Wolfgang Seka | Clause Reference(s) | => TTCN-3 Core Language: Annex C or D
12-05-2009 12:38 | Wolfgang Seka | Source (company - Author) | => MCC160
27-05-2009 14:53 | Gyorgy Rethy | Note Added: 0008663 |
27-05-2009 14:53 | Gyorgy Rethy | Note Added: 0008664 |
30-06-2009 09:37 | Ina Schieferdecker | Project | TTCN-3 Change Requests => Part 01: TTCN-3 Core Language
30-06-2009 09:37 | Ina Schieferdecker | Status | new => assigned
30-06-2009 09:37 | Ina Schieferdecker | Assigned To | => Tibor CsÃ¶ndes
30-06-2009 10:21 | Ina Schieferdecker | Target Version | => Edition 4.2.1 (not yet published)
01-07-2009 15:12 | Tibor CsÃ¶ndes | File Added: CR5171_testcasename.doc |
01-07-2009 15:16 | Tibor CsÃ¶ndes | Note Added: 0008808 |
01-07-2009 15:16 | Tibor CsÃ¶ndes | Assigned To | Tibor CsÃ¶ndes => Gyorgy Rethy
03-07-2009 11:11 | Gyorgy Rethy | File Added: CR5171_testcasename_v2.doc |
03-07-2009 11:12 | Gyorgy Rethy | Note Added: 0008825 |
03-07-2009 11:13 | Gyorgy Rethy | Assigned To | Gyorgy Rethy => Tibor CsÃ¶ndes
03-07-2009 12:14 | Tibor CsÃ¶ndes | File Added: CR5171_testcasename_v3.doc |
03-07-2009 12:15 | Tibor CsÃ¶ndes | Note Added: 0008828 |
03-07-2009 12:15 | Tibor CsÃ¶ndes | Assigned To | Tibor CsÃ¶ndes => Ina Schieferdecker
10-07-2009 11:00 | Ina Schieferdecker | File Added: CR5171_testcasename_v4.doc |
10-07-2009 11:01 | Ina Schieferdecker | Note Added: 0008885 |
10-07-2009 12:11 | Gyorgy Rethy | File Added: CR5171_testcasename_v5.doc |
10-07-2009 12:13 | Gyorgy Rethy | Note Added: 0008886 |
10-07-2009 12:14 | Gyorgy Rethy | Status | assigned => resolved
10-07-2009 12:14 | Gyorgy Rethy | Resolution | open => fixed
16-02-2010 07:20 | Ina Schieferdecker | Status | resolved => closed
16-02-2010 07:20 | Ina Schieferdecker | Fixed in Version | => Edition 4.2.1 (not yet published)

Notes

(0008663)
Gyorgy Rethy
27-05-2009 14:53

From a mail received from Wolfgang:
"along the discussions about value returning functions being used in templates I read in the spec again and found the following in 16.1.4:
"Value returning functions can be called during communication operations (in templates, template fields or in-line
templates) ...
To avoid side effects ... the following operations shall not be used in functions called in the cases specified above:
...
e) Calling external functions (see notes 4 and 6).
...
NOTE 4: Calling of external functions, rnd, running, alive, read, setverdict, and writing to component
variables is illegal because it may lead to different results of subsequent evaluations of the same snapshot,
thus, e.g. rendering deadlock detection impossible.
...
NOTE 6: Restrictions except the limitation on the use of out or inout parameterization apply recursively, i.e. it
is disallowed to use them directly, or via an arbitrary long chain of function invocations.
..."
That clashes with our current preliminary solution for the __TESTCASE__ issue:
Here we have: Template calling TTCN function calling external function (the latter one returns the test case name).
Now - acc. to my interpretation - this is not correct since indirectly an external function is used in the template.
On the other hand is the argumentation as given above hard to follow in our case (our external fx_GetCurrentTestcaseName will never cause problems as mentioned)
In any case we need a solution
- either by allowing such kind of external functions (I would guess that most compilers will not cause problems anyway but I've not checked yet)
- or by introducing a build-in function (which then needs to be quickly implemented by the tools)
Since this issue is quite important for MCC160 I would suggest we add it to the agenda for the TTCN-3/Tools meeting next week."

(0008664)
Gyorgy Rethy
27-05-2009 14:53

From a mail received from Wolfgang:
"along the discussions about value returning functions being used in templates I read in the spec again and found the following in 16.1.4:
"Value returning functions can be called during communication operations (in templates, template fields or in-line
templates) ...
To avoid side effects ... the following operations shall not be used in functions called in the cases specified above:
...
e) Calling external functions (see notes 4 and 6).
...
NOTE 4: Calling of external functions, rnd, running, alive, read, setverdict, and writing to component
variables is illegal because it may lead to different results of subsequent evaluations of the same snapshot,
thus, e.g. rendering deadlock detection impossible.
...
NOTE 6: Restrictions except the limitation on the use of out or inout parameterization apply recursively, i.e. it
is disallowed to use them directly, or via an arbitrary long chain of function invocations.
..."
That clashes with our current preliminary solution for the __TESTCASE__ issue:
Here we have: Template calling TTCN function calling external function (the latter one returns the test case name).
Now - acc. to my interpretation - this is not correct since indirectly an external function is used in the template.
On the other hand is the argumentation as given above hard to follow in our case (our external fx_GetCurrentTestcaseName will never cause problems as mentioned)
In any case we need a solution
- either by allowing such kind of external functions (I would guess that most compilers will not cause problems anyway but I've not checked yet)
- or by introducing a build-in function (which then needs to be quickly implemented by the tools)
Since this issue is quite important for MCC160 I would suggest we add it to the agenda for the TTCN-3/Tools meeting next week."

(0008808)
Tibor CsÃ¶ndes
01-07-2009 15:16

According to the minutes of CR resolution meeting (49TD13r2) a new pre-defined function has suggested (testcasename) and not a __TESTCASE___ macro.

(0008825)
Gyorgy Rethy
03-07-2009 11:12

In ~v2: editorial amendments and more example. The updated version is OK with me.

(0008828)
Tibor CsÃ¶ndes
03-07-2009 12:15

Editorials changes, v3 uploaded.

(0008885)
Ina Schieferdecker
10-07-2009 11:01

As discussed: - added testcasename to 16.1.2 - made testcasename returing "" if not testcase is executing - added qualified and unqualified name as definition - made testcasename returning unqualified name

(0008886)
Gyorgy Rethy
10-07-2009 12:13

OK, just a minor editorial, corrected in CR5171_testcasename_v5.doc: the dot is added between <module name> and <global definition name> in <module name>.<global definition name>.<local definition name>