CORDET Framework - C2 Implementation
CrFwOutFactoryTestCases.c File Reference

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

Go to the source code of this file.

Functions

CrFwBool_t CrFwOutFactoryTestCase1 ()
 Test the creation and configuration of the OutFactory singleton component. More...
 
CrFwBool_t CrFwOutFactoryTestCase2 ()
 Test the OutComponent creation service in non-nominal situations where the creation fails. More...
 
CrFwBool_t CrFwOutFactoryTestCase3 ()
 Test the Reset and Shutdown functions of the OutFactory component. More...
 
CrFwBool_t CrFwOutFactoryTestCase4 ()
 Test the OutComponent Creation and Release functions of the OutFactory component. More...
 

Detailed Description

Implementation of test cases for OutFactory 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 CrFwOutFactoryTestCases.c.

Function Documentation

◆ CrFwOutFactoryTestCase1()

CrFwBool_t CrFwOutFactoryTestCase1 ( )

Test the creation and configuration of the OutFactory singleton component.

The following actions are performed in this test:

  • Create the OutFactory singleton twice and check that the same component is returned in both cases.
  • Initialize and configure OutFactory and check that it is in state CONFIGURED.
  • Check the correctness of the OutFactory component type identifier and instance identifier.
  • Check that the maximum number of OutComponents which can be generated by the OutFactory is correctly reported.
  • Check that the number of allocated OutComponents is initially equal to zero
Verifies:

Base SM Transition: IPS->CREATED

Base SM Transition: CREATED->INITIALIZED

Base SM Transition: INITIALIZED->CONFIGURED

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 44 of file CrFwOutFactoryTestCases.c.

◆ CrFwOutFactoryTestCase2()

CrFwBool_t CrFwOutFactoryTestCase2 ( )

Test the OutComponent creation service in non-nominal situations where the creation fails.

The following actions are performed in this test:

  • Attempt to retrieve an OutComponent with a service type which is in range (smaller than the highest service type defined in CrFwOutFactoryUserPar.h) but is not valid.
  • Attempt to retrieve an OutComponent with a service type which is out-of-range (greater than the highest service type defined in CrFwOutFactoryUserPar.h).
  • Attempt to retrieve an OutComponent with a valid service type but with a service sub-type which is in range (smaller than the highest service sub-type defined for that type in CrFwOutFactoryUserPar.h) but is not valid.
  • Attempt to retrieve an OutComponent with a valid service type but with a service sub-type which is out-of-range (greater than the highest service sub-type defined for that type in CrFwOutFactoryUserPar.h).
  • Attempt to retrieve an OutComponent with a valid service type and sub-type but with a discriminant which is in range (smaller than the highest discriminant defined for that type/sub-type in CrFwOutFactoryUserPar.h) but is not valid.
  • Attempt to retrieve an OutComponent with a valid service type and sub-type but with a discriminant which is out-of-range (greater than the highest discriminant defined for that type/sub-type in CrFwOutFactoryUserPar.h).
  • Create CR_FW_MAX_NOF_PCKTS packets and then attempt to create an OutComponent (this should fail because, for each OutComponent, a packet is required and no more packets can be created).
  • Create CR_FW_OUTFACTORY_MAX_NOF_OUTCMP OutComponents and then attempt to create one more OutComponent (this should fail because at most CR_FW_OUTFACTORY_MAX_NOF_OUTCMP OutComponents can be created.
Verifies:

Application Error: crIllOutCmpKind

Application Error: crOutCmpAllocationFail

Returns
true if the test was successful, false otherwise.

Definition at line 81 of file CrFwOutFactoryTestCases.c.

◆ CrFwOutFactoryTestCase3()

CrFwBool_t CrFwOutFactoryTestCase3 ( )

Test the Reset and Shutdown functions of the OutFactory component.

The following actions are performed in this test:

  • Initialize and reset the OutFactory and then allocate three OutComponents.
  • Check that the OutFactory correctly sets the source of the OutComponents.
  • Reset the OutFactory and check that no OutComponents are any longer allocated.
  • Allocate three OutComponents from the OutFactory and check that the instance identifiers are re-initialized.
  • Shutdown the OutFactory and check that no OutComponents are any longer allocated.
  • Check the state of the OutFactory and then re-start it.
Verifies:

Base SM Transition: CONFIGURED->FPS

Base SM Transition: CONFIGURED->CONFIGURED

Reset Procedure: Configuration Action Successful

Reset Procedure: Configuration Check Successful

Returns
true if the test was successful, false otherwise.

Definition at line 194 of file CrFwOutFactoryTestCases.c.

◆ CrFwOutFactoryTestCase4()

CrFwBool_t CrFwOutFactoryTestCase4 ( )

Test the OutComponent Creation and Release functions of the OutFactory component.

The following actions are performed in this test:

  • Initialize and reset the OutFactory and then allocate three OutComponents; for one of the three components, override the length specified in the CR_FW_OUTCMP_INIT_KIND_DESC initializer.
  • Check the correctness of the instance identifiers of the OutComponents.
  • Release the OutComponents and verify that they are no longer allocated.
  • Attempt to release an OutComponent twice and check that application error :.crOutCmpRelErr is generated.
  • Allocate a number of OutComponents identical to the number of distinct instance identifiers supported by the OutFactory and then allocate one more OutComponent and check that its instance identifier is identical to that of the first OutComponent to be allocated after the OutFactory is reset.
Verifies:
Application Error: crOutCmpRelErr
Returns
true if the test was successful, false otherwise.

Definition at line 268 of file CrFwOutFactoryTestCases.c.

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