1 /******************************************************************************
2 * Copyright (c) 2000-2016 Ericsson Telecom AB
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
9 * Adrien Kirjak – initial implementation
12 ** @purpose 1:22.3.2, Ensure that getcall operations remove the matching procedure from the queue
13 ** @verdict pass accept, ttcn3verdict:pass
14 *****************************************************************/
16 module Sem_220302_GetcallOperation_002 {
19 * @desc testing of inline return template for remote procedure call
20 * @param p_par1 only input parameter
21 * @param p_par2 must have value 4 at return
22 * @param p_par3 must have value 5 at return
23 * @return must return value 1
25 signature p_Sem_220302_GetcallOperation_002(in integer p_par1, out integer p_par2, inout integer p_par3) return integer;
27 template p_Sem_220302_GetcallOperation_002 s_returnTemplate := {
28 p_par1 := 0, // p_par1 := - causes core dump
33 template p_Sem_220302_GetcallOperation_002 s_wrongTemplate := {
34 p_par1 := 0, // p_par1 := - causes core dump
39 template p_Sem_220302_GetcallOperation_002 s_callTemplate := {
41 p_par2 := 0, // p_par2 := - causes core dump
45 type port remotePort procedure {
46 inout p_Sem_220302_GetcallOperation_002;
47 } with {extension "internal"}
49 type component GeneralComp {
53 function f_ClientQuery() runs on GeneralComp {
54 var integer v_zero:=0;
57 PCO.call(p_Sem_220302_GetcallOperation_002:s_callTemplate, 5.0) {
59 [] PCO.getreply(p_Sem_220302_GetcallOperation_002:s_wrongTemplate value 1) {
62 [] PCO.getreply(p_Sem_220302_GetcallOperation_002:s_returnTemplate value 2) {
65 [v_one>v_zero] PCO.getreply(p_Sem_220302_GetcallOperation_002:s_returnTemplate value 1) {
66 //check that boolean guard is correctly evaluated
69 [] PCO.catch (timeout) {
75 function f_ServerResponses() runs on GeneralComp {
79 timer t_timeout:=30.0;
81 template p_Sem_220302_GetcallOperation_002 s_noacceptTemplate := {
87 template p_Sem_220302_GetcallOperation_002 s_acceptTemplate := {
97 [] PCO.getcall(p_Sem_220302_GetcallOperation_002:s_acceptTemplate) -> param(v_par1, v_par3) {
98 PCO.reply(p_Sem_220302_GetcallOperation_002:{p_par1 := 0, p_par2 := v_par1+v_par3, p_par3 := v_par1+v_par3+1} value v_par1); //procedure return values are sent,
99 // p_par1 := - causes core dump
102 [] PCO.getcall { //this part is not matched if procedure is removed from queue
105 [] t_timeout.timeout {
112 testcase TC_Sem_220302_GetcallOperation_002() runs on GeneralComp system GeneralComp {
113 var GeneralComp server := GeneralComp.create("RemoteProcedure Service");
114 var GeneralComp client := GeneralComp.create("RemoteProcedure Client");
117 connect(server:PCO, client:PCO);
119 server.start(f_ServerResponses());
120 client.start(f_ClientQuery());
125 t_wait.timeout; //this gives a chance for server to still test for second getcall match
131 [] all component.done {}
134 disconnect(server:PCO, client:PCO);
138 execute(TC_Sem_220302_GetcallOperation_002());