CORDET Framework - C2 Implementation
CrFwInLoaderTestCases.c File Reference

Implementation of test cases for InLoader component. More...

Go to the source code of this file.

Functions

static void CrFwInLoaderTestCaseSetReroutingDest (CrFwDestSrc_t retValue)
 Function to set the return value of function CrFwInLoaderTestCaseGetReroutingDestination. More...
 
CrFwDestSrc_t CrFwInLoaderTestCaseGetReroutingDestination (CrFwDestSrc_t pcktDest)
 Test implementation of the function which checks the legality of a destination and returns the re-routing destination (adaptation points A7.2.2-9 and A7.2.2-11). More...
 
CrFwBool_t CrFwInLoaderTestCase1 ()
 Check the configuration of a newly created InLoader. More...
 
CrFwBool_t CrFwInLoaderTestCase2 ()
 Check the execution function of an InLoader for the case where there are no pending packet in the InStream. More...
 
CrFwBool_t CrFwInLoaderTestCase3 ()
 Check the execution function of an InLoader for the case where the packet destination is invalid. More...
 
CrFwBool_t CrFwInLoaderTestCase4 ()
 Check the execution function of an InLoader for the case where the packet must be re-routed to another destination. More...
 
CrFwBool_t CrFwInLoaderTestCase5 ()
 Check the execution function of an InLoader for the case where the packet destination is the host application but the packet type is invalid. More...
 
CrFwBool_t CrFwInLoaderTestCase6 ()
 Check the execution function of an InLoader for the case where the packet destination is the host application, the packet type is valid but the make operation fails. More...
 
CrFwBool_t CrFwInLoaderTestCase7 ()
 Check the execution function of an InLoader for the case where the packet destination is the host application, the packet type is valid but the InReport/InCommand component fails its validity check (it does not enter state CONFIGURED). More...
 
CrFwBool_t CrFwInLoaderTestCase8 ()
 Check the execution function of an InLoader for the case where the packet destination is the host application, the packet type is valid, the InReport/InCommand component is successfully configured but the load operation in the InManager fails. More...
 
CrFwBool_t CrFwInLoaderTestCase9 ()
 Check the execution function of an InLoader for the case where the packet destination is the host application, the packet type is valid, the InReport/InCommand component is successfully configured, the load operation in the InManager succeeds and the loaded component is an InReport. More...
 
CrFwBool_t CrFwInLoaderTestCase10 ()
 Check the execution function of an InLoader for the case where the packet destination is the host application, the packet type is valid, the InReport/InCommand component is successfully configured the load operation in the InManager succeeds and the loaded component is an InCommand for which no acknowledgement of acceptance is required. More...
 
CrFwBool_t CrFwInLoaderTestCase11 ()
 Check the execution function of an InLoader for the case where the packet destination is the host application, the packet type is valid, the InReport/InCommand component is successfully configured the load operation in the InManager succeeds and the loaded component is an InCommand for which acknowledgement of acceptance is required. More...
 

Variables

static CrFwDestSrc_t reroutingDest = 0
 Return value of function CrFwInLoaderDefGetReroutingDestination.
 

Detailed Description

Implementation of test cases for InLoader component.

Author
Vaclav Cechticky vacla.nosp@m.v.ce.nosp@m.chtic.nosp@m.ky@p.nosp@m.np-so.nosp@m.ftwa.nosp@m.re.co.nosp@m.m
Alessandro Pasetti paset.nosp@m.ti@p.nosp@m.np-so.nosp@m.ftwa.nosp@m.re.co.nosp@m.m

This file is part of the CORDET Framework.

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

For information on alternative licensing, please contact P&P Software GmbH.

Definition in file CrFwInLoaderTestCases.c.

Function Documentation

◆ CrFwInLoaderTestCase1()

CrFwBool_t CrFwInLoaderTestCase1 ( )

Check the configuration of a newly created InLoader.

The following actions are performed in this test:

  • The InLoader is created and it is checked that it is in state CREATED.
  • The InLoader is initialized and reset and it is checked that it is in state CONFIGURED.
  • The instance identifier and the type identifier of the InLoader is checked.
  • The first of the two default implementations of the function which checks the legality of a destination and returns the re-routing destination (CrFwInLoaderDefGetReroutingDestination) is checked.
  • The second of the two default implementations of the function which checks the legality of a destination and returns the re-routing destination (CrFwInLoaderDefNoRerouting) is checked.
  • The default implementation of the function which selects the InManager to which an incoming InReport or InCommand must be loaded (CrFwInLoaderDefGetInManager) is checked.
Verifies:

Base Component SM Transition: IPS->CREATED

Base Component SM Transition: CREATED->INITIALIZED

Base Component SM Transition: INITIALIZED->CONFIGURED

Returns
true if the test was successful, false otherwise.

Definition at line 75 of file CrFwInLoaderTestCases.c.

◆ CrFwInLoaderTestCase10()

CrFwBool_t CrFwInLoaderTestCase10 ( )

Check the execution function of an InLoader for the case where the packet destination is the host application, the packet type is valid, the InReport/InCommand component is successfully configured the load operation in the InManager succeeds and the loaded component is an InCommand for which no acknowledgement of acceptance is required.

The following actions are performed in this test:

  • The InLoader is created, initialized and configured.
  • The InFactory is created, initialized and is configured.
  • The InManager for InCommands is created, initialized and is configured to be empty.
  • An InStream is created, initialized and configured to have one pending packet representing a valid Sample 1 InCommand.
  • The Sample 1 InCommand is configured to pass its validity check and not to require acknowledgement of acceptance.
  • The function which checks the validity of a destination is configured to return the host application as a destination.
  • The InStream is loaded in the InLoader and then the InLoader is executed.
  • It is checked that neither acceptance nfailure report nor acceptance successful report is generated and that the InCommand has been loaded in the InManager.
Verifies:

InLoader Execution Procedure: Packet Destination is Valid && Packet Destination is the Host Application

InLoader Load Command/Report Procedure: Packet Type is Valid

InLoader Load Command/Report Procedure: Make Operation returns an InCmd/InRep

InLoader Load Command/Report Procedure: InCmd/InRep is in State CONFIGURED

InLoader Load Command/Report Procedure: Load Operation Succeeded

InLoader Load Command/Report Procedure: Component Being Loaded is an InCommand && No Acknowledgement of Acceptance is Required

Returns
true if the test was successful, false otherwise.

Definition at line 997 of file CrFwInLoaderTestCases.c.

◆ CrFwInLoaderTestCase11()

CrFwBool_t CrFwInLoaderTestCase11 ( )

Check the execution function of an InLoader for the case where the packet destination is the host application, the packet type is valid, the InReport/InCommand component is successfully configured the load operation in the InManager succeeds and the loaded component is an InCommand for which acknowledgement of acceptance is required.

The following actions are performed in this test:

  • The InLoader is created, initialized and configured.
  • The InFactory is created, initialized and is configured.
  • The InManager for InCommands is created, initialized and is configured to be empty.
  • An InStream is created, initialized and configured to have one pending packet representing a valid Sample 1 InCommand.
  • The Sample 1 InCommand is configured to pass its validity check and to require acknowledgement of acceptance.
  • The function which checks the validity of a destination is configured to return the host application as a destination.
  • The InStream is loaded in the InLoader and then the InLoader is executed.
  • It is checked that an acceptance successful report is generated and that the InCommand has been loaded in the InManager.
Verifies:

InLoader Execution Procedure: Packet Destination is Valid && Packet Destination is the Host Application

InLoader Load Command/Report Procedure: Packet Type is Valid

InLoader Load Command/Report Procedure: Make Operation returns an InCmd/InRep

InLoader Load Command/Report Procedure: InCmd/InRep is in State CONFIGURED

InLoader Load Command/Report Procedure: Load Operation Succeeded

InLoader Load Command/Report Procedure: Component Being Loaded is an InCommand && Acknowledgement of Acceptance is Required

Returns
true if the test was successful, false otherwise.

Definition at line 1102 of file CrFwInLoaderTestCases.c.

◆ CrFwInLoaderTestCase2()

CrFwBool_t CrFwInLoaderTestCase2 ( )

Check the execution function of an InLoader for the case where there are no pending packet in the InStream.

The following actions are performed in this test:

  • The InLoader is created, initialized and configured.
  • An InStream is created, initialized and configured to have no pending packets.
  • The function which checks the validity of a destination is configured to return: "destination invalid".
  • The InStream is loaded in the InLoader and then the InLoader is executed.
  • It is checked that the InLoader returns without taking any further action (this is done by checking that no report is generated for the "invalid destination").
Verifies:
InLoader Execution Procedure: No Packet Returned by InStream
Returns
true if the test was successful, false otherwise.

Definition at line 133 of file CrFwInLoaderTestCases.c.

◆ CrFwInLoaderTestCase3()

CrFwBool_t CrFwInLoaderTestCase3 ( )

Check the execution function of an InLoader for the case where the packet destination is invalid.

The following actions are performed in this test:

  • The InLoader is created, initialized and configured.
  • An InStream is created, initialized and configured to have one pending packet.
  • The function which checks the validity of a destination is configured to return: "destination invalid".
  • The InStream is loaded in the InLoader and then the InLoader is executed.
  • It is checked that the InLoader releases the packet and reports that the packet destination is invalid.
Verifies:
InLoader Execution Procedure: Packet Destination is Invalid
Returns
true if the test was successful, false otherwise.

Definition at line 178 of file CrFwInLoaderTestCases.c.

◆ CrFwInLoaderTestCase4()

CrFwBool_t CrFwInLoaderTestCase4 ( )

Check the execution function of an InLoader for the case where the packet must be re-routed to another destination.

The following actions are performed in this test:

  • The InLoader is created, initialized and configured.
  • An InStream is created, initialized and configured to have one pending packet.
  • An OutStream is created, initialized and configured.
  • The function which checks the validity of a destination is configured to return the destination associated to the OutStream.
  • The InStream is loaded in the InLoader and then the InLoader is executed.
  • It is checked that the packet is loaded into the OutStream.
Verifies:
InLoader Execution Procedure: Packet Destination is Valid && Packet Destination is not the Host Application
Returns
true if the test was successful, false otherwise.

Definition at line 235 of file CrFwInLoaderTestCases.c.

◆ CrFwInLoaderTestCase5()

CrFwBool_t CrFwInLoaderTestCase5 ( )

Check the execution function of an InLoader for the case where the packet destination is the host application but the packet type is invalid.

The following actions are performed in this test:

  • The InLoader is created, initialized and configured.
  • The InFactory is created, initialized and configured.
  • An InStream is created, initialized and configured to have one pending packet representing an InReport with an invalid type.
  • The function which checks the validity of a destination is configured to return the host application as a destination.
  • The InStream is loaded in the InLoader and then the InLoader is executed.
  • It is checked that no InReport components are allocated; that an acceptance failure error report is generated; and that the application code is set to crIllInRepKind.
  • The same actions as above are repeated when the packet in the InStream is an InCommand.
Verifies:

InLoader Execution Procedure: Packet Destination is Valid && Packet Destination is the Host Application

InLoader Load Command/Report Procedure: Packet Type is Invalid

Application Error: crIllInRepKind

Returns
true if the test was successful, false otherwise.

Definition at line 306 of file CrFwInLoaderTestCases.c.

◆ CrFwInLoaderTestCase6()

CrFwBool_t CrFwInLoaderTestCase6 ( )

Check the execution function of an InLoader for the case where the packet destination is the host application, the packet type is valid but the make operation fails.

The following actions are performed in this test:

  • The InLoader is created, initialized and configured.
  • The InFactory is created, initialized and it is configured to have no more spare InReport components.
  • An InStream is created, initialized and configured to have one pending packet representing a valid InReport.
  • The function which checks the validity of a destination is configured to return the host application as a destination.
  • The InStream is loaded in the InLoader and then the InLoader is executed.
  • It is checked that no InReport components are allocated; that an acceptance failure report is generated; and that the application code is set to crInRepAllocationFail.
  • The same actions as above are repeated when the packet in the InStream is an InCommand.
Verifies:

InLoader Execution Procedure: Packet Destination is Valid && Packet Destination is the Host Application

InLoader Load Command/Report Procedure: Packet Type is Valid

InLoader Load Command/Report Procedure: Make Operation Fails

Application Error: crInRepAllocationFail

Returns
true if the test was successful, false otherwise.

Definition at line 439 of file CrFwInLoaderTestCases.c.

◆ CrFwInLoaderTestCase7()

CrFwBool_t CrFwInLoaderTestCase7 ( )

Check the execution function of an InLoader for the case where the packet destination is the host application, the packet type is valid but the InReport/InCommand component fails its validity check (it does not enter state CONFIGURED).

The following actions are performed in this test:

  • The InLoader is created, initialized and configured.
  • The InFactory is created, initialized and is configured.
  • An InStream is created, initialized and configured to have one pending packet representing a valid Sample 1 InReport.
  • The Sample 1 InReport is configured to fail its validity check.
  • The function which checks the validity of a destination is configured to return the host application as a destination.
  • The InStream is loaded in the InLoader and then the InLoader is executed.
  • It is checked that no InReport components are allocated and that an acceptance failure report is generated.
  • The same actions as above are repeated when the packet in the InStream is an InCommand.
Verifies:

InLoader Execution Procedure: Packet Destination is Valid && Packet Destination is the Host Application

InLoader Load Command/Report Procedure: Packet Type is Valid

InLoader Load Command/Report Procedure: Make Operation returns an InCmd/InRep

InLoader Load Command/Report Procedure: InCmd/InRep is not in State CONFIGURED

Returns
true if the test was successful, false otherwise.

Definition at line 606 of file CrFwInLoaderTestCases.c.

◆ CrFwInLoaderTestCase8()

CrFwBool_t CrFwInLoaderTestCase8 ( )

Check the execution function of an InLoader for the case where the packet destination is the host application, the packet type is valid, the InReport/InCommand component is successfully configured but the load operation in the InManager fails.

The following actions are performed in this test:

  • The InLoader is created, initialized and configured.
  • The InFactory is created, initialized and is configured.
  • The InManager for InReports is created, initialized and is configured to be full.
  • An InStream is created, initialized and configured to have one pending packet representing a valid Sample 1 InReport.
  • The Sample 1 InReport is configured to pass its validity check.
  • The function which checks the validity of a destination is configured to return the host application as a destination.
  • The InStream is loaded in the InLoader and then the InLoader is executed.
  • It is checked that an acceptance failure report is generated and that the application code is set to crInManagerPcrlFull.
  • The same actions as above are repeated when the packet in the InStream is an InCommand.
Verifies:

InLoader Execution Procedure: Packet Destination is Valid && Packet Destination is the Host Application

InLoader Load Command/Report Procedure: Packet Type is Valid

InLoader Load Command/Report Procedure: Make Operation returns an InCmd/InRep

InLoader Load Command/Report Procedure: InCmd/InRep is in State CONFIGURED

InLoader Load Command/Report Procedure: Load Operation Failed

Application Error: crInManagerPcrlFull

Returns
true if the test was successful, false otherwise.

Definition at line 729 of file CrFwInLoaderTestCases.c.

◆ CrFwInLoaderTestCase9()

CrFwBool_t CrFwInLoaderTestCase9 ( )

Check the execution function of an InLoader for the case where the packet destination is the host application, the packet type is valid, the InReport/InCommand component is successfully configured, the load operation in the InManager succeeds and the loaded component is an InReport.

The following actions are performed in this test:

  • The InLoader is created, initialized and configured.
  • The InFactory is created, initialized and is configured.
  • The InManager for InReports is created, initialized and is configured to be empty.
  • An InStream is created, initialized and configured to have one pending packet representing a valid Sample 1 InReport.
  • The Sample 1 InReport is configured to pass its validity check.
  • The function which checks the validity of a destination is configured to return the host application as a destination.
  • The InStream is loaded in the InLoader and then the InLoader is executed.
  • It is checked that no acceptance failure report is generated and that the InReport has been loaded in the InManager.
Verifies:

InLoader Execution Procedure: Packet Destination is Valid && Packet Destination is the Host Application

InLoader Load Command/Report Procedure: Packet Type is Valid

InLoader Load Command/Report Procedure: Make Operation returns an InCmd/InRep

InLoader Load Command/Report Procedure: InCmd/InRep is in State CONFIGURED

InLoader Load Command/Report Procedure: Load Operation Succeeded

InLoader Load Command/Report Procedure: Component Being Loaded is an InReport

Returns
true if the test was successful, false otherwise.

Definition at line 894 of file CrFwInLoaderTestCases.c.

◆ CrFwInLoaderTestCaseGetReroutingDestination()

CrFwDestSrc_t CrFwInLoaderTestCaseGetReroutingDestination ( CrFwDestSrc_t  pcktDest)

Test implementation of the function which checks the legality of a destination and returns the re-routing destination (adaptation points A7.2.2-9 and A7.2.2-11).

This test implementation can be configured to return either zero (to signify that the argument destination is invalid) or a positive integer (to represent a re-routing destination). This function must conform to the prototype defined by CrFwInLoaderGetReroutingDest_t.

Parameters
pcktDestthe packet destination.
Returns
the re-routing destination or zero if the argument destination is illegal.

Definition at line 69 of file CrFwInLoaderTestCases.c.

◆ CrFwInLoaderTestCaseSetReroutingDest()

static void CrFwInLoaderTestCaseSetReroutingDest ( CrFwDestSrc_t  retValue)
static

Function to set the return value of function CrFwInLoaderTestCaseGetReroutingDestination.

Parameters
retValuethe return value of function CrFwInLoaderTestCaseGetReroutingDestination.

Definition at line 64 of file CrFwInLoaderTestCases.c.

P&P Software GmbH, Copyright 2012-2013, All Rights Reserved