CORDET Framework - C2 Implementation
CrFwOutStreamTestCases.h File Reference

Declaration of the test cases for the OutStream Component (see CrFwOutStream.h). More...

Go to the source code of this file.

Functions

CrFwBool_t CrFwOutStreamTestCase1 ()
 Test the initialization and packet queue (PQ) management of the OutStream. More...
 
CrFwBool_t CrFwOutStreamTestCase2 ()
 Test the OutStream with overridden initialization check and initialization action. More...
 
CrFwBool_t CrFwOutStreamTestCase3 ()
 Test the packet flushing functionality of an OutStream for a packet originating from the host application (as opposed to a re-routed packet). More...
 
CrFwBool_t CrFwOutStreamTestCase4 ()
 Test the registry functionality of an OutStream. More...
 
CrFwBool_t CrFwOutStreamTestCase5 ()
 Test the Shutdown Operation of an OutStream. More...
 
CrFwBool_t CrFwOutStreamTestCase6 ()
 Test the packet flushing functionality of an OutStream for a re-routed packet (as opposed to a packet originating from the host application). More...
 
CrFwBool_t CrFwOutStreamTestCase7 ()
 Test the management of the sequence counters for different groups and of the type counters. More...
 

Detailed Description

Declaration of the test cases for the OutStream Component (see CrFwOutStream.h).

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 CrFwOutStreamTestCases.h.

Function Documentation

◆ CrFwOutStreamTestCase1()

CrFwBool_t CrFwOutStreamTestCase1 ( )

Test the initialization and packet queue (PQ) management of the OutStream.

The following actions are performed in this test:

  • Attempt to instantiate an OutStream with an illegal identifier and check that the operation fails.
  • Instantiate one OutStream twice and check that the same instance is returned on both occasions.
  • Check that the OutStream is correctly configured.
  • Initialize and configure the OutStream and bring its state machine to state CONFIGURED-READY
  • Check that the OutStream sequence counters and PQ size are correct
  • Configure the Packet Hand-Over Operation to return "hand-over failed", send a packet to the OutStream and check that the PQ state is correctly updated and that the OutStream goes to state BUFFERING.
  • Send the same packet multiple times until the PQ is full and check that its state is as expected.
  • Send one more packet and check that an error report is generated.
  • Check that the association between destination and OutStream is correct.

In all cases, the packet is configured to belong to the first group associated to the OutStream.

Verifies:

Error Report: crOutStreamPQFull

Application Error: crOutStreamIllId

Base SM Transition: IPS->CREATED

Base SM Transition: CREATED->INITIALIZED

Base SM Transition: INITIALIZED->CONFIGURED

Base SM Transition: CONFIGURED->FPS

OutStream SM Transition: IPS->READY

OutStream SM Transition: READY->BUFFERING

OutStream SM Transition: BUFFERING->BUFFERING

OutStream SM Transition: Enqueue Action with PQ Not Full

OutStream SM Transition: Enqueue Action with PQ Full

Initialization Procedure: Initialization Action Successful

Initialization Procedure: Initialization Check Successful

Reset Procedure: Configuration Action Successful

Reset Procedure: Configuration Check Successful

Returns
true if the test was successful, false otherwise.

Definition at line 42 of file CrFwOutStreamTestCases.c.

◆ CrFwOutStreamTestCase2()

CrFwBool_t CrFwOutStreamTestCase2 ( )

Test the OutStream with overridden initialization check and initialization action.

The following actions are performed in this test:

  • Verify that initialization of OutStream only succeeds when both the initialization check and the initialization action succeed.
  • Verify that configuration of OutStream only succeeds when both the configuration check and the configuration action succeed.
  • Verify that a reset of a configured OutStream fails if the configuration check fails.

After this test has run, the second OutStream component may no longer be usable.

Verifies:

Base SM Transition: IPS->CREATED

Base SM Transition: CREATED->CREATED

Base SM Transition: CREATED->INITIALIZED

Base SM Transition: INITIALIZED->INITIALIZED

Base SM Transition: INITIALIZED->CONFIGURED

Base SM Transition: CONFIGURED->INITIALIZED

Initialization Procedure: Initialization Action Successful

Initialization Procedure: Initialization Check Successful

Initialization Procedure: Initialization Action Failed

Initialization Procedure: Initialization Check Failed

Reset Procedure: Configuration Action Successful

Reset Procedure: Configuration Action Failed

Reset Procedure: Configuration Check Successful

Reset Procedure: Configuration Check Failed

Returns
true if the test was successful, false otherwise.

Definition at line 212 of file CrFwOutStreamTestCases.c.

◆ CrFwOutStreamTestCase3()

CrFwBool_t CrFwOutStreamTestCase3 ( )

Test the packet flushing functionality of an OutStream for a packet originating from the host application (as opposed to a re-routed packet).

The following actions are performed in this test:

  • The first OutStream is started and the Packet Hand-Over Operation is configured to return "hand-over successful".
  • It is checked that the destination assigned to the OutStream is correctly reported by the OutStream
  • A packet is sent to the OutStream and it is checked that it is successfully flushed.
  • The Packet Hand-Over Operation is configured to return "hand-over failed", two packets are sent to the OutStream, and it is checked that they are buffered.
  • The packet factory is configured to be empty and then a packet is sent to the OutStream and it is checked that error crOutStreamNoMorePckt is raised.
  • The ConnectionAvailable signal is sent to the OutStream and it is checked that the packet queue remains unchanged.
  • The Packet Hand-Over Operation is configured to return "hand-over successful", the ConnectionAvailable signal is sent again to the OutStream and it is checked that the packet queue is successfully flushed.
  • The Packet Hand-Over Operation is configured to return "hand-over failed", the packet factory is configured to be empty, and then a packet is sent to the OutStream and it is checked that error crOutStreamNoMorePckt is raised.
  • The OutStream is reset and it is checked that its state is correctly reset In all cases, the packets sent to an OutStream are configured to belong to the first group associated to the OutStream.
Verifies:

Base SM Transition: IPS->CREATED

Base SM Transition: CREATED->INITIALIZED

Base SM Transition: INITIALIZED->CONFIGURED

Base SM Transition: CONFIGURED->CONFIGURED

OutStream SM Transition: IPS->READY

OutStream SM Transition: READY->BUFFERING

OutStream SM Transition: BUFFERING->READY

OutStream SM Transition: Enqueue Action with No More Packets Available

OutStream SM Transition: Enqueue Action with PQ Not Full

OutStream SM Transition: Flush Packet Queue Action with Middleware Accepting Packet

OutStream SM Transition: Flush Packet Queue Action with Middleware Rejecting Packet

OutStream SM Transition: Flush Packet Queue Action with Packet Originating in Application

OutStream SM Transition: Flush Packet Queue Action with Legal Packet Group

OutStream SM Transition: Send or Enqueue Action with No More Packets Available

OutStream SM Transition: Send or Enqueue Action with Middleware Accepting Packet

OutStream SM Transition: Send or Enqueue Action with Middleware Rejecting Packet

OutStream SM Transition: Send or Enqueue Action with Packet Originating in Application

OutStream SM Transition: Send or Enqueue Action with Legal Packet Group

OutStream SM Transition: Flush Packet Queue Action with Illegal Group Report

OutStream SM Transition: Send or Enqueue Action with Illegal Group Report

Initialization Procedure: Initialization Action Successful

Initialization Procedure: Initialization Check Successful

Reset Procedure: Configuration Action Successful

Reset Procedure: Configuration Check Successful

Application Error: crOutStreamUndefDest

Returns
true if the test was successful, false otherwise.

Definition at line 299 of file CrFwOutStreamTestCases.c.

◆ CrFwOutStreamTestCase4()

CrFwBool_t CrFwOutStreamTestCase4 ( )

Test the registry functionality of an OutStream.

The following actions are performed in this test:

  • The OutStreams are made by their factory function and associated to their destinations.
  • The same OutStreams are retrieved from their destinations.
  • An attempt is made to retrieve an OutStream from an illegal destination.
Verifies:
Application Error: crOutStreamUndefDest
Returns
true if the test was successful, false otherwise.

Definition at line 495 of file CrFwOutStreamTestCases.c.

◆ CrFwOutStreamTestCase5()

CrFwBool_t CrFwOutStreamTestCase5 ( )

Test the Shutdown Operation of an OutStream.

The following actions are performed in this test:

  • Bring an OutStream to its CONFIGURED state
  • Shut down the OutStream and check that the new Shutdown Operation is executed.
Verifies:

Base SM Transition: IPS->CREATED

Base SM Transition: CREATED->INITIALIZED

Base SM Transition: INITIALIZED->CONFIGURED

Base SM Transition: CONFIGURED->FPS

Returns
true if the test was successful, false otherwise.

Definition at line 533 of file CrFwOutStreamTestCases.c.

◆ CrFwOutStreamTestCase6()

CrFwBool_t CrFwOutStreamTestCase6 ( )

Test the packet flushing functionality of an OutStream for a re-routed packet (as opposed to a packet originating from the host application).

The following actions are performed in this test:

  • The first OutStream is started and the Packet Hand-Over Operation is configured to return "hand-over successful".
  • A packet is sent to the OutStream and it is checked that it is successfully flushed and that its sequence counter is not modified.
  • The Packet Hand-Over Operation is configured to return "hand-over failed", two packets are sent to the OutStream, and it is checked that they are buffered.
  • The ConnectionAvailable signal is sent to the OutStream and it is checked that the packet queue is successfully flushed.
  • The OutStream is reset and it is checked that its state is correctly reset
Verifies:

Base SM Transition: IPS->CREATED

Base SM Transition: CREATED->INITIALIZED

Base SM Transition: INITIALIZED->CONFIGURED

Base SM Transition: CONFIGURED->CONFIGURED

OutStream SM Transition: IPS->READY

OutStream SM Transition: READY->BUFFERING

OutStream SM Transition: BUFFERING->READY

OutStream SM Transition: Enqueue Action with PQ Not Full

OutStream SM Transition: Flush Packet Queue Action with Middleware Accepting Packet

OutStream SM Transition: Flush Packet Queue Action with Middleware Rejecting Packet

OutStream SM Transition: Flush Packet Queue Action with Packet not Originating in Application

OutStream SM Transition: Send or Enqueue Action with Packet not Originating in Application

Initialization Procedure: Initialization Action Successful

Initialization Procedure: Initialization Check Successful

Reset Procedure: Configuration Action Successful

Reset Procedure: Configuration Check Successful

Returns
true if the test was successful, false otherwise.

Definition at line 569 of file CrFwOutStreamTestCases.c.

◆ CrFwOutStreamTestCase7()

CrFwBool_t CrFwOutStreamTestCase7 ( )

Test the management of the sequence counters for different groups and of the type counters.

This test assumes that the OutStreams have been configured to have 2 groups and that it uses the default function CrFwOutStreamDefSetDTS to compute the the DTS_SET.

  • The second OutStream is started and its Packet Hand-Over Operation is configured to return "hand-over successful".
  • It is checked that the number of groups is equal to 2 and that the number of type counters is consistent with the definition of types and sub-types in CR_FW_OUTCMP_INIT_KIND_DESC.
  • It is checked that the default value of the sequence counters is 1
  • It is checked that the default type counter is equal to 1 if the packet is in the DTS and is equal to 0 if it not in the DTS
  • Two packets belonging to different groups and with a non-zero type-counter are sent to the OutStream and it is checked that they are successfully flushed and that their sequence counters and type counters are successfully incremented.
  • Two more packets belonging to different groups and with a non-zero type-counter are sent to the OutStream and it is checked that they are successfully flushed and that their sequence counter is successfully incremented.
  • A packet belonging to a non-existent group is sent to the OutStream and it is checked that it is successfully flushed but that an error report is raised.
  • A packet not belonging to the DTS_SET is sent to the OutStream and it is checked that it is successfully flushed and that its type counter is set to zero.
  • The Packet Hand-Over Operation is configured to return "hand-over failed", three packets belonging to, respectively, the first, second and a non-existent group are sent to the OutStream, and it is checked that they are buffered.
  • The ConnectionAvailable signal is sent to the OutStream and it is checked that the packet queue remains unchanged.
  • The Packet Hand-Over Operation is configured to return "hand-over successful", the ConnectionAvailable signal is sent again to the OutStream and it is checked that the packet queue is successfully flushed and that one error report for the illegal group is created.
  • The OutStream is reset and it is checked that its state is correctly reset
Verifies:

Base SM Transition: IPS->CREATED

Base SM Transition: CREATED->INITIALIZED

Base SM Transition: INITIALIZED->CONFIGURED

Base SM Transition: CONFIGURED->CONFIGURED

OutStream SM Transition: IPS->READY

OutStream SM Transition: READY->BUFFERING

OutStream SM Transition: BUFFERING->READY

OutStream SM Transition: Flush Packet Queue Action with Illegal Group Report

OutStream SM Transition: Send or Enqueue Action with Illegal Group Report

Initialization Procedure: Initialization Action Successful

Initialization Procedure: Initialization Check Successful

Reset Procedure: Configuration Action Successful

Reset Procedure: Configuration Check Successful

Error Report: crOutStreamIllGroup

Returns
true if the test was successful, false otherwise.

Definition at line 712 of file CrFwOutStreamTestCases.c.

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