minor bugfixes
Signed-off-by: Antal Wu-Hen-Chang <antal.wu-hen-chang@ericsson.com>
diff --git a/src/LoadGen/EPTF_MBT_LGen_Definitions.ttcn b/src/LoadGen/EPTF_MBT_LGen_Definitions.ttcn
index 92ffacd..10ad297 100755
--- a/src/LoadGen/EPTF_MBT_LGen_Definitions.ttcn
+++ b/src/LoadGen/EPTF_MBT_LGen_Definitions.ttcn
@@ -108,6 +108,13 @@
///////////////////////////////////////////////////////////////////////////////
const charstring c_EPTF_MBT_inputName_incomingTestStepRequest := "EPTF_MBT_inputName_incomingTestStepRequest";
+const integer c_EPTF_MBT_inputIdx_reportedVerdict := 2;
+const charstring c_EPTF_MBT_inputName_reportedVerdict := "EPTF_MBT_inputName_reportedVerdict";
+
+const integer c_EPTF_MBT_reportedVerdict_pass := 0;
+const integer c_EPTF_MBT_reportedVerdict_fail := 1;
+const integer c_EPTF_MBT_reportedVerdict_inconc := 2;
+
//*******************************************************************************************************
@@ -168,6 +175,12 @@
///////////////////////////////////////////////////////////////////////////////
const charstring c_EPTF_MBT_stepName_invokeUserFunction :="EPTF_MBT_stepName_invokeUserFunction";
+const integer c_EPTF_MBT_stepIdx_setMainFSM := 2;
+const charstring c_EPTF_MBT_stepName_setMainFSM := "EPTF_MBT_stepName_setMainFSM";
+
+const integer c_EPTF_MBT_stepIdx_reportVerdict := 3;
+const charstring c_EPTF_MBT_stepName_reportVerdict := "EPTF_MBT_stepName_reportVerdict";
+
//*******************************************************************************************************
// Component Type
@@ -459,9 +472,10 @@
///////////////////////////////////////////////////////////////////////////////
type record EPTF_MBT_TestStepResponse
{
- charstring bName,
- charstring iName,
- FsmAddr addr optional
+ charstring bName,
+ charstring iName,
+ FsmAddr addr optional,
+ EPTF_IntegerList args optional
}
///////////////////////////////////////////////////////////////////////////////
diff --git a/src/LoadGen/EPTF_MBT_LGen_Functions.ttcn b/src/LoadGen/EPTF_MBT_LGen_Functions.ttcn
index 843025d..37cc14a 100644
--- a/src/LoadGen/EPTF_MBT_LGen_Functions.ttcn
+++ b/src/LoadGen/EPTF_MBT_LGen_Functions.ttcn
@@ -106,7 +106,7 @@
activate(as_EPTF_MBT_PCO_Handler());
- map(self:EPTF_MBT_PCO, system:EPTF_MBT_PCO);
+ //map(self:EPTF_MBT_PCO, system:EPTF_MBT_PCO);
v_EPTF_MBT_initialized := true;
}
@@ -136,7 +136,7 @@
if (v_EPTF_MBT_initialized)
{
- unmap(self:EPTF_MBT_PCO, system:EPTF_MBT_PCO);
+ //unmap(self:EPTF_MBT_PCO, system:EPTF_MBT_PCO);
v_EPTF_MBT_initialized := false;
}
@@ -165,11 +165,13 @@
{
f_EPTF_Logging_debug(tsp_EPTF_MBT_LGen_debug, "### " & %definitionId);
var integer vl_temp := -1;
-
+
vl_temp := f_EPTF_LGenBase_declareFsmEvent(c_EPTF_MBT_myBName,c_EPTF_MBT_inputName_incomingUserRequest);
f_EPTF_Base_assert(%definitionId&": Error during registration of "&c_EPTF_MBT_inputName_incomingUserRequest, vl_temp == c_EPTF_MBT_inputIdx_incomingUserRequest);
vl_temp := f_EPTF_LGenBase_declareFsmEvent(c_EPTF_MBT_myBName,c_EPTF_MBT_inputName_incomingTestStepRequest);
f_EPTF_Base_assert(%definitionId&": Error during registration of "&c_EPTF_MBT_inputName_incomingTestStepRequest, vl_temp == c_EPTF_MBT_inputIdx_incomingTestStepRequest);
+ vl_temp := f_EPTF_LGenBase_declareFsmEvent(c_EPTF_MBT_myBName,c_EPTF_MBT_inputName_reportedVerdict);
+ f_EPTF_Base_assert(%definitionId&": Error during registration of "&c_EPTF_MBT_inputName_reportedVerdict, vl_temp == c_EPTF_MBT_inputIdx_reportedVerdict);
}
///////////////////////////////////////////////////////////////////////////////
@@ -208,6 +210,14 @@
pl_bName:=c_EPTF_MBT_myBName,
pl_step:={name:=c_EPTF_MBT_stepName_sendUserResponse,
step:=refers(f_EPTF_MBT_TestStep_sendUserResponse)});
+ f_EPTF_LGenBase_declareStep(
+ pl_bName:=c_EPTF_MBT_myBName,
+ pl_step:={name:=c_EPTF_MBT_stepName_setMainFSM,
+ step:=refers(f_EPTF_MBT_TestStep_setMainFSM)});
+ f_EPTF_LGenBase_declareStep(
+ pl_bName:=c_EPTF_MBT_myBName,
+ pl_step:={name:=c_EPTF_MBT_stepName_reportVerdict,
+ step:=refers(f_EPTF_MBT_TestStep_reportVerdict)});
}
///////////////////////////////////////////////////////////////////////////////
@@ -401,7 +411,7 @@
var integer vl_grpIdx := f_EPTF_LGenBase_getEGrpOfEntity(pl_ptr.eIdx);
var integer vl_eIdx := pl_ptr.eIdx - f_EPTF_LGenBase_getEGrpBaseOffset(vl_grpIdx);
-
+
var EPTF_MBT_TestStepResponse vl_resp :=
{
bName := f_EPTF_LGenBase_bIdx2Str(pl_ptr.reportedEvent.event.bIdx),
@@ -411,7 +421,8 @@
entityGroupName := f_EPTF_LGenBase_entityGroupName(vl_grpIdx),
eIdx := pl_ptr.eIdx,
fIdx := pl_ptr.refContext.fCtxIdx
- }
+ },
+ args := pl_ptr.reportedEvent.reportedArgs
}
f_EPTF_Logging_debug(tsp_EPTF_MBT_LGen_debug, log2str(%definitionId & "() user response: ", vl_resp));
@@ -478,7 +489,7 @@
var integer vl_grpIdx := f_EPTF_LGenBase_getEGrpOfEntity(pl_ptr.eIdx);
var integer vl_eIdx := pl_ptr.eIdx - f_EPTF_LGenBase_getEGrpBaseOffset(vl_grpIdx);
-
+
var EPTF_MBT_TestStepResponse vl_resp :=
{
bName := c_EPTF_MBT_myBName,
@@ -488,13 +499,47 @@
entityGroupName := f_EPTF_LGenBase_entityGroupName(vl_grpIdx),
eIdx := pl_ptr.eIdx,
fIdx := pl_ptr.refContext.fCtxIdx
- }
+ },
+ args := pl_ptr.reportedEvent.reportedArgs
}
var EPTF_IntegerList vl_ctx := f_EPTF_LGenBase_getBehaviorCtx(pl_ptr.eIdx, v_EPTF_MBT_myBIdx);
f_EPTF_Logging_debug(tsp_EPTF_MBT_LGen_debug, log2str(%definitionId & "() user response: ", vl_resp));
EPTF_MBT_PCO.send(vl_resp) to f_EPTF_Base_downcast(vl_ctx[0]);
}
+function f_EPTF_MBT_TestStep_setMainFSM(in EPTF_LGenBase_TestStepArgs pl_ptr) runs on EPTF_MBT_LGen_CT
+{
+ if (sizeof(pl_ptr.refContext.fRefArgs)==2)
+ {
+ var integer vl_eIdx := pl_ptr.refContext.fRefArgs[0];
+ var integer vl_fIdx := pl_ptr.refContext.fRefArgs[1];
+
+ f_EPTF_LGenBase_setBehaviorCtxItem(pl_ptr.eIdx, v_EPTF_MBT_myBIdx, 1, vl_eIdx);
+ f_EPTF_LGenBase_setBehaviorCtxItem(pl_ptr.eIdx, v_EPTF_MBT_myBIdx, 2, vl_fIdx);
+ }
+ else
+ {
+ f_EPTF_Logging_warning(true, log2str("### " & %definitionId & "(): Invalid parametrization, two parameters are required ", pl_ptr.refContext.fRefArgs));
+ }
+}
+
+function f_EPTF_MBT_TestStep_reportVerdict(in EPTF_LGenBase_TestStepArgs pl_ptr) runs on EPTF_MBT_LGen_CT
+{
+ if (sizeof(pl_ptr.refContext.fRefArgs)==1)
+ {
+ var integer vl_verdict := pl_ptr.refContext.fRefArgs[0];
+
+ var integer vl_eIdx := f_EPTF_LGenBase_getBehaviorCtxItem(pl_ptr.eIdx, v_EPTF_MBT_myBIdx, 1);
+ var integer vl_fIdx := f_EPTF_LGenBase_getBehaviorCtxItem(pl_ptr.eIdx, v_EPTF_MBT_myBIdx, 2);
+
+ f_EPTF_LGenBase_postEvent({{v_EPTF_MBT_myBIdx, c_EPTF_MBT_inputIdx_reportedVerdict,{vl_eIdx, vl_fIdx}, omit},{vl_verdict}});
+ }
+ else
+ {
+ f_EPTF_Logging_warning(true, log2str("### " & %definitionId & "(): Invalid parametrization, one parameter is required ", pl_ptr.refContext.fRefArgs));
+ }
+}
+
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_MBT_Listener_catchEntityEvents
//
@@ -724,7 +769,7 @@
var integer vl_fIdx := f_EPTF_LGenBase_activateFsm(vl_entityIdx, vl_fsmTableIdx, 0, -1);
f_EPTF_LGenBase_setBehaviorCtx(vl_entityIdx, v_EPTF_MBT_myBIdx, {vl_senderInt});
- f_EPTF_LGenBase_addEntityIdxListener(vl_entityIdx, refers(f_EPTF_MBT_Listener_catchEntityEvents), {})
+ //f_EPTF_LGenBase_addEntityIdxListener(vl_entityIdx, refers(f_EPTF_MBT_Listener_catchEntityEvents), {}); // FIXME: only if MBT_FSM is actiavted on a new entity
var EPTF_MBT_CreateFSMResponse vl_resp :=
{
@@ -985,7 +1030,7 @@
function f_MBT_execute(in charstring p_name, in EPTF_MBT_LGen_Definitions.FsmAddr p_addr, in EPTF_IntegerList p_params := {}, in boolean p_lock := true)
runs on EPTF_MBT_Tester_CT
{
- action(%definitionId, "TestStep: ", p_name)
+ action(%definitionId, " TestStep: ", p_name)
if (p_lock)
{
var integer v_lock := f_EPTF_Semaphore_new();
@@ -1022,29 +1067,26 @@
//
///////////////////////////////////////////////////////////////////////////////
function f_MBT_waitFor(
- in charstring p_behavior, in charstring p_name,
- in EPTF_MBT_LGen_Definitions.FsmAddr p_addr, in float p_timeout := 3.0)
+ in charstring p_behavior, in template charstring p_name,
+ in template EPTF_MBT_LGen_Definitions.FsmAddr p_addr, in float p_timeout := 30.0)
runs on EPTF_MBT_Tester_CT
return boolean
{
+ var EPTF_MBT_TestStepResponse vl_testStepResp;
+
timer t_wait;
t_wait.start(p_timeout);
alt
{
- [] EPTF_MBT_TESTER_PCO.receive(EPTF_MBT_TestStepResponse:{ bName := p_behavior, iName := p_name, addr := p_addr})
+ [] EPTF_MBT_TESTER_PCO.receive(EPTF_MBT_TestStepResponse:{ bName := p_behavior, iName := p_name, addr := p_addr, args := *})
{
t_wait.stop;
- action(%definitionId, "Received: ", p_name)
+ action(%definitionId, " Received: ", p_name)
return true;
}
- [] EPTF_MBT_TESTER_PCO.receive
- {
- action(%definitionId, "Dropping unexpected message!")
- repeat;
- }
[] t_wait.timeout
{
- action(%definitionId, "Timeout!")
+ action(%definitionId, " Timeout!")
return false;
}
}
@@ -1075,7 +1117,7 @@
function f_MBT_dispatch(in charstring p_bName, in integer p_iIndex, in EPTF_MBT_LGen_Definitions.FsmAddr p_addr)
runs on EPTF_MBT_Tester_CT
{
- action(%definitionId, "Dispatching: ", p_bName, ":",p_iIndex, " to ",p_addr)
+ action(%definitionId, " Dispatching: ", p_bName, ":",p_iIndex, " to ",p_addr)
EPTF_MBT_TESTER_PCO.send(EPTF_MBT_EventDispatchRequest: {p_bName, p_iIndex, p_addr});
}
@@ -1106,6 +1148,7 @@
runs on EPTF_MBT_Tester_CT
return integer
{
+ action(%definitionId, " Activating: ", p_fsmName, " on entity: ",p_eIdx)
EPTF_MBT_TESTER_PCO.send(EPTF_MBT_CreateFSMRequest:
{
entityGroupName := p_entityGroupName,