Commit 5bcf0dd6 authored by tepelmann's avatar tepelmann
Browse files

Introduced new verdict management in DENM.

parent 17a6edef
Loading
Loading
Loading
Loading
+26 −24
Original line number Original line Diff line number Diff line
@@ -126,8 +126,6 @@ module LibItsDenm_Functions {
            
            
            f_utInitializeIut();
            f_utInitializeIut();
            
            
            f_setVerdictPreOrPostamble(v_ret);
            
            return v_ret;
            return v_ret;
        }
        }
        
        
@@ -141,8 +139,6 @@ module LibItsDenm_Functions {
        function f_poDefault() runs on ItsFa {
        function f_poDefault() runs on ItsFa {
            var FncRetCode v_ret := e_success;
            var FncRetCode v_ret := e_success;
            //empty
            //empty
            f_setVerdictPreOrPostamble(v_ret);
            
        }
        }
        
        
        /**
        /**
@@ -166,7 +162,6 @@ module LibItsDenm_Functions {
            else {
            else {
                v_ret := f_utTriggerEvent(m_utEventCancellation(p_event, c_dataVersionCancellation));
                v_ret := f_utTriggerEvent(m_utEventCancellation(p_event, c_dataVersionCancellation));
            }
            }
            f_setVerdictPreOrPostamble(v_ret);
            
            
            f_poDefault();
            f_poDefault();
        }
        }
@@ -213,30 +208,41 @@ module LibItsDenm_Functions {
        /**
        /**
         * @desc    Checks that the event was indicated at the application layer
         * @desc    Checks that the event was indicated at the application layer
         * @param   p_event The event to check.
         * @param   p_event The event to check.
         * @param   p_discard The event should not appear. Default value: FALSE.
         * @return 
         * @return 
         */
         */
        function f_utCheckEvent(template (value) UtDenmEvent p_event) runs on ItsFa return FncRetCode {
        function f_utCheckEvent(template (value) UtDenmEvent p_event, boolean p_discard := false) runs on ItsFa {
            var FncRetCode v_ret := e_success;
            var template (value) UtDenmCheck v_utMsg := { p_event };
            var template (value) UtDenmCheck v_utMsg := { p_event };
            
            
            utPort.send(v_utMsg);
            utPort.send(v_utMsg);
            tc_ac.start;
            tc_ac.start;
            alt {
            alt {
                [] utPort.receive(UtDenmResult:true) {
                [] utPort.receive(UtDenmResult:true) {
                    setverdict (pass, "*** f_utCheckEvent: Event correctly indicated at application layer ***");
                    if (p_discard == false) {
                    v_ret := e_success;
                        log("*** f_utCheckEvent: Event correctly indicated at application layer ***");
                    }
                    else {
                        f_selfOrClientSyncAndVerdict("error", e_error, "*** f_utCheckEvent: Event indicated at application layer where should not appear ***");
                    }
                }
                }
                [] utPort.receive {
                [] utPort.receive {
                    setverdict (fail, "*** f_utCheckEvent: Event not correctly indicated at application layer ***");
                    if (p_discard == false) {
                    v_ret := e_error;
                        f_selfOrClientSyncAndVerdict("error", e_error, "*** f_utCheckEvent: Event not correctly indicated at application layer ***");
                    }
                    else {
                        log("*** f_utCheckEvent: Another event indicated at application layer, repeating check ***");
                        repeat;
                    }
                }
                }
                [] tc_ac.timeout {
                [] tc_ac.timeout {
                    setverdict (inconc, "*** f_utCheckEvent: Timeout while waiting for event check result ***");
                    if (p_discard == false) {
                    v_ret := e_timeout;
                        f_selfOrClientSyncAndVerdict("error", e_timeout, "*** f_utCheckEvent: Timeout while waiting for event check result ***");
                    }
                    else {
                        log("*** f_utCheckEvent: Event not indicated at application layer ***");
                    }
                }
                }
            }
            }
            
            return v_ret;
        }
        }
        
        
    } // end group upperTester
    } // end group upperTester
@@ -262,9 +268,9 @@ module LibItsDenm_Functions {
         * @param p_rcvMsg The expected message to be received.
         * @param p_rcvMsg The expected message to be received.


         */
         */
        function f_awaitDenMessage(template (present) DenmInd p_rcvMsg) runs on ItsFa return FncRetCode {
        function f_awaitDenMessage(template (present) DenmInd p_rcvMsg) runs on ItsFa {
            var DenmInd v_denmInd;
            var DenmInd v_denmInd;
            return f_awaitDenMessageOut(p_rcvMsg, v_denmInd);
            f_awaitDenMessageOut(p_rcvMsg, v_denmInd);
        }
        }
        
        
        /**
        /**
@@ -273,22 +279,18 @@ module LibItsDenm_Functions {
         * @param p_rcvdMsg The received message - OUT.
         * @param p_rcvdMsg The received message - OUT.
         * @return 
         * @return 
         */
         */
        function f_awaitDenMessageOut(in template (present) DenmInd p_rcvMsg, out DenmInd p_rcvdMsg) runs on ItsFa return FncRetCode {
        function f_awaitDenMessageOut(in template (present) DenmInd p_rcvMsg, out DenmInd p_rcvdMsg) runs on ItsFa {
            var FncRetCode v_ret := e_timeout;
            
            
            tc_ac.start;
            tc_ac.start;
            alt {
            alt {
                [] denmPort.receive(p_rcvMsg) -> value p_rcvdMsg {
                [] denmPort.receive(p_rcvMsg) -> value p_rcvdMsg {
                    tc_ac.stop;
                    tc_ac.stop;
                    v_ret := e_success;
                }
                }
                [] tc_ac.timeout {
                [] tc_ac.timeout {
                	log("*** f_awaitDenMessageOut: INFO: Timeout while awaiting the reception of a message ***");
                    f_selfOrClientSyncAndVerdict("error", e_timeout, "*** f_awaitDenMessageOut: INFO: Timeout while awaiting the reception of a message ***");
                	v_ret := e_timeout;
                }
                }
            }
            }
            
            
            return v_ret;
        }
        }
        
        
    } // end receiveFunctions
    } // end receiveFunctions