ETSI's Bug Tracker - Part 01: TTCN-3 Core Language
View Issue Details
0006412Part 01: TTCN-3 Core LanguageTechnicalpublic16-01-2013 12:3928-08-2013 14:59
Thilo Lauer 
Ina Schieferdecker 
normalmajorhave not tried
closedfixed 
v4.4.1 (published 2012-04) 
v4.6.1 (published 2014-06)v4.6.1 (published 2014-06) 
16.1 Functions
Devoteam - Thilo Lauer
0006412: system component shall be passed to functions with map/unmap statements
If map/unmap statements are used in a function, then the system component should also be passed to this function,
  (1) either as parameter
  (2) or by using keyword system to define the function's system component.

Let's assume the following component definitions:
  type component UTRAN_PTC {
    var UTRAN_Global_Type vc_UTRAN_Global;

    port UTRAN_AM_PORT U_AM;
    port UTRAN_TM_PORT U_TM;
    port UTRAN_UM_PORT U_UM;
    ...
    port UTRAN_VNG_PORT U_VNG;
    ...
  };

  type component UTRAN_SYSTEM {
    port UTRAN_AM_PORT S_U_AM;
    port UTRAN_TM_PORT S_U_TM;
    port UTRAN_UM_PORT S_U_UM;
    ...
    port UTRAN_VNG_PORT S_U_VNG;
  };

Example:
The defintition of function f_UTRAN_PTC_Map below can generally be called in the context of different test cases
with different system components (defining different system ports).
Therefore if this function is defined as shown below, it can currently not be decided at compile time
if the system component actually has the system ports used in the function's map statements:

  function f_UTRAN_PTC_Map(UTRAN_PTC p_Utran)
  {
    map(p_Utran:U_AM, system:S_U_AM);
    map(p_Utran:U_TM, system:S_U_TM);
    map(p_Utran:U_UM, system:S_U_UM);
    // ... further map statements

    if (f_GetTestcaseAttrib_Qbased_Rsrq(testcasename())) {
      map(p_Utran:U_VNG, system:S_U_VNG);
    }
  }

Given the function definition above, errors with system port mappings can only be detected at runtime.


To be able to do this checks at compile time, we suggest ...
============================================================
1.) either to pass the system component additionally as parameter:
    i.e. to change the function definition in the test suite to:
  
  function f_UTRAN_PTC_Map(UTRAN_PTC p_Utran, UTRAN_SYSTEM sys_Utran)
  // *** added parameter: UTRAN_SYSTEM sys_Utran ***
  {
    map(p_Utran:U_AM, sys_Utran:S_U_AM);
    map(p_Utran:U_TM, sys_Utran:S_U_TM);
    map(p_Utran:U_UM, sys_Utran:S_U_UM);
    // ... further map statements
    
    if (f_GetTestcaseAttrib_Qbased_Rsrq(testcasename())) {
      map(p_Utran:U_VNG, sys_Utran:S_U_VNG);
    }
  }

  // function call:
  f_UTRAN_PTC_Map(p_Utran, system);
  // *** keyword "system" passed as actual component parameter value here ***

  
2.) or to change the TTCN-3 syntax for function definitions as shown below:

  function f_UTRAN_PTC_Map(UTRAN_PTC p_Utran) system UTRAN_SYSTEM
  // *** system UTRAN_SYSTEM added ***
  {
    ...
  }

 
Solution 1.) requires a change in some ETSI/3GPP suites
Solution 2.) requires a change in some ETSI/3GPP suites and in the TTCN-3 standard as well.

No tags attached.
related to 0005922closed Ina Schieferdecker why strong typing is not used in map and unmap? 
Issue History
16-01-2013 12:39Thilo LauerNew Issue
16-01-2013 12:39Thilo LauerClause Reference(s) => 16.1 Functions
16-01-2013 12:39Thilo LauerSource (company - Author) => Devoteam - Thilo Lauer
18-01-2013 11:44Jacob Wieland - SpirentNote Added: 0011324
18-01-2013 11:44Jacob Wieland - SpirentRelationship addedrelated to 0005922
08-07-2013 15:48Jens GrabowskiStatusnew => assigned
08-07-2013 15:48Jens GrabowskiAssigned To => Jacob Wieland - Spirent
08-07-2013 18:16Gyorgy RethyTarget Version => v4.6.1 (published 2014-06)
11-07-2013 15:23Jacob Wieland - SpirentNote Added: 0011550
11-07-2013 15:23Jacob Wieland - SpirentAssigned ToJacob Wieland - Spirent => Ina Schieferdecker
11-07-2013 15:23Jacob Wieland - SpirentStatusassigned => confirmed
28-08-2013 14:58Ina SchieferdeckerNote Added: 0011626
28-08-2013 14:58Ina SchieferdeckerStatusconfirmed => resolved
28-08-2013 14:58Ina SchieferdeckerResolutionopen => fixed
28-08-2013 14:58Ina SchieferdeckerFixed in Version => v4.6.1 (published 2014-06)
28-08-2013 14:59Ina SchieferdeckerStatusresolved => closed

Notes
(0011324)
Jacob Wieland - Spirent   
18-01-2013 11:44   
A proposal for the solution of this issue can already be found in CR5922
(0011550)
Jacob Wieland - Spirent   
11-07-2013 15:23   
see proposal in 5922
(0011626)
Ina Schieferdecker   
28-08-2013 14:58   
Resolved together with 5922