ttcn2java: wrong handling of permutation in case of compatible integer template arrays
Submitted by Jeno Attila Balasko
Link to original bug (#559512)
Description
Created attachment 281594 example ttcn source code
The attached ttcn module contains two testcases. They are almost identical. The first testcase creates a template variable with a permutation value, then calls a function with arg type of template AI3. The function simple checks if the received variable is the expected or not ( converted into string):
type integer AI3[3];
testcase tc_array_allfrom_perm1_pass() runs on CT { //This testcase does not use type compatibility var template AI3 tl_AI3 := { permutation(1,*,3) }; log( "TC() local var tl_tcAI3: ", tl_AI3); f_check( tl_AI3); }
The second testcase creates a template variable of type compatible with the previous AI3. The value is the same as in the first testcase. Then the same function is called. It fails because ( as we can see from the logs ) the information about the permutation is not passed.From the log it trivial that the value was correct before the function call but the converted value arrived without the "permutaion"info.
tl_integerArray3 before function call: { permutation(1, *, 3) } Function arg:{ 1, *, 3 } setverdict(fail): none -> fail reason: "Expected: { permutation(1, *, 3) }, got: "{ 1, *, 3 }"", new component reason: "Expected: { permutation(1, *, 3) }, got: "{ 1, *, 3 }""
Source code and log are attached
Attachment 281594, "example ttcn source code":
permTemplateAsFuncArgBug.ttcn
Version: 6.6.1