CORDET Framework - C2 Implementation
CrFwPacketTestCases.h File Reference

Declaration of the test cases for the default packet implementation of CrFwBaseCmp.h. More...

Go to the source code of this file.

Functions

CrFwBool_t CrFwPacketTestCase1 ()
 Test the creation of a packet and the read and write operations on its attributes. More...
 
CrFwBool_t CrFwPacketTestCase2 ()
 Test the creation and release functions for a packet. More...
 
CrFwBool_t CrFwPacketQueueTestCase1 ()
 Test the packet queue functions which are not covered through other tests. More...
 

Detailed Description

Declaration of the test cases for the default packet implementation of CrFwBaseCmp.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 CrFwPacketTestCases.h.

Function Documentation

CrFwBool_t CrFwPacketQueueTestCase1 ( )

Test the packet queue functions which are not covered through other tests.

The test performs the following actions:

  • It creates a packet queue and attempts to pop an item from the empty packet queue and to get the oldest item from the packet queue.
  • It resets the empty packet queue.
  • It pushes and pops and items from packet queue and verifies that they are managed in FIFO order
  • It creates a situation where the oldest packet in the queue is behind the next free slot in the queue and then resets the packet queue
Returns
true if the test was successful, false otherwise.

Definition at line 257 of file CrFwPacketTestCases.c.

CrFwBool_t CrFwPacketTestCase1 ( )

Test the creation of a packet and the read and write operations on its attributes.

The test performs the following actions:

  • Attempt to create a packet with an illegal length (either greater than the allowed maximum or smaller than 1) and check that nothing is returned.
  • Make a packet and check that its length is correctly set.
  • Set and get all the pre-defined attributes of a packet.
Verifies:
Application Error: crPcktAllocationFail
Returns
true if the test was successful, false otherwise.

Definition at line 36 of file CrFwPacketTestCases.c.

CrFwBool_t CrFwPacketTestCase2 ( )

Test the creation and release functions for a packet.

The test performs the following actions:

  • It creates the maximum allowed number of packets.
  • It verifies that the packet availability check returns false
  • It attempts to create a new packet and checks that the attempt fails.
  • It releases one packet, verifies that the packet availability check now returns true and then attempts to create the new packet and verifies that this time the attempt succeeds.
  • It releases all created packets and then checks that the same number of packets can again be created.
  • It verifies that the packet availability check returns false when the packet length is either negative or zero or greater than the allowed maximum.
Verifies:

Application Error: crPcktAllocationFail

Application Error: crPcktRelErr

Returns
true if the test was successful, false otherwise.

Definition at line 179 of file CrFwPacketTestCases.c.

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