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

ID | Project | Category | View Status | Date Submitted | Last Update
0002108 | Part 01: TTCN-3 Core Language | Editorial | public | 05-10-2007 17:31 | 12-03-2008 10:24

Reporter | Thomas DeiÃŸ |
Assigned To | Ina Schieferdecker |
Priority | normal | Severity | minor | Reproducibility | N/A
Status | closed | Resolution | fixed |
Platform |  | OS |  | OS Version |
Product Version | v3.2.1 (published 2007-02) |
Target Version | v3.3.2 (published 2008-04) | Fixed in Version | v3.3.2 (published 2008-04) |
Clause Reference(s) | 5.4.1.1, 16.1.4
Source (company - Author) | Thomas DeiÃŸ

Summary | 0002108: Example uses function in template with out parameter

Description

Example 2 in clause 5.4.1.1 uses a function with an inout parameter inside a template definition. But this is not allowed according to clause 16.1.4. item j).
Proposed resolution: change the template in the example to a function and adapt its usage (name changed from t_MyMessage to f_MyMessage)
function f_MyMessage (integer p_int) return MyMessage {
var integer f1,f2;
f1 := f_mult2 (p_int),
// parameter p_int is passed on; as the parameter of the called function f_mult2 is
// defined as an inout parameter, it passes back the changed value for p_int,
f2 := p_int;
return {f1, f2};
}
...
testcase tc_01 () runs on MTC_PT {
...
P1.send (f_MyMessage(5))
// the value sent is { f1 := 9 , f2 := 10 }
...
}

Steps To Reproduce |

Additional Information

Note 1) The reason given that functions with inout parameters cannot be used do not apply in this case, for usage in boolean guards of alternatives they are fine. But inside a template changes do not propagate outside the template, so there should not be a problem of using them.
Note 2) What is the evaluation order inside a template, is this fixed to be top down? Or what is the order in case of a modified template? If this is not fixed there might be unexpected results. Despite of note 1) it might be best to keep the restriction in item j) to avoid surprises.

Tags | No tags attached.
Relationships |
Attached Files | CR-2108-Example-Uses-Function-in-Template-with-out-Parameter-Resolution.doc (210,944) 04-12-2007 16:19 http://oldforge.etsi.org/mantis/file_download.php?file_id=1199&type=bug

Issue History
Date Modified | Username | Field | Change
05-10-2007 17:31 | Thomas DeiÃŸ | New Issue |
05-10-2007 17:31 | Thomas DeiÃŸ | Clause Reference(s) | => 5.4.1.1, 16.1.4
05-10-2007 17:31 | Thomas DeiÃŸ | Source (company - Author) | => Thomas DeiÃŸ
13-10-2007 19:06 | Ina Schieferdecker | Status | new => assigned
13-10-2007 19:06 | Ina Schieferdecker | Assigned To | => Ina Schieferdecker
13-10-2007 19:06 | Ina Schieferdecker | Assigned To | Ina Schieferdecker => Jens Grabowski
18-10-2007 12:25 | Ina Schieferdecker | Target Version | => Edition 3.3.1 (not yet published)
04-12-2007 16:19 | Jens Grabowski | File Added: CR-2108-Example-Uses-Function-in-Template-with-out-Parameter-Resolution.doc |
04-12-2007 16:20 | Jens Grabowski | Note Added: 0004281 |
04-12-2007 16:20 | Jens Grabowski | Assigned To | Jens Grabowski => Thomas DeiÃŸ
04-12-2007 16:20 | Jens Grabowski | Resolution | open => fixed
04-12-2007 16:54 | Thomas DeiÃŸ | Note Added: 0004287 |
04-12-2007 16:54 | Thomas DeiÃŸ | Assigned To | Thomas DeiÃŸ => Ina Schieferdecker
04-12-2007 16:54 | Thomas DeiÃŸ | Status | assigned => resolved
05-12-2007 17:11 | Ina Schieferdecker | Status | resolved => closed
05-12-2007 17:11 | Ina Schieferdecker | Fixed in Version | => Edition 3.3.1 (not yet published)
12-03-2008 10:22 | user10 | Fixed in Version | Edition 3.3.1 --will not be published, see 3.3.2 => Edition 3.3.2 (not yet published)
12-03-2008 10:24 | user10 | Target Version | Edition 3.3.1 --will not be published, see 3.3.2 => Edition 3.3.2 (not yet published)

Notes

(0004281)
Jens Grabowski
04-12-2007 16:20

Resolution follows the proposal of the submitter. Assigned to Thomas for crosschecking.

(0004287)
Thomas DeiÃŸ
04-12-2007 16:54

checked by Thomas: Ok