CORDET Framework - C2 Implementation
CrFwSocketTestCases.c File Reference

Implementation of test cases for Socket-Based InStream and OutStream Components. More...

Go to the source code of this file.

Functions

CrFwBool_t CrFwSocketTestCase1 ()
 Test the initialization and configuration of the socket-based InStream and OutStream. More...
 
CrFwBool_t CrFwSocketTestCase2 ()
 Test the initialization and configuration of the client and server sockets of CrFwClientSocket.h and CrFwServerSocket.h. More...
 
CrFwBool_t CrFwSocketTestCase3 ()
 Test the sending and receiving of multiple packets through client and server sockets of CrFwClientSocket.h and CrFwServerSocket.h. More...
 
CrFwBool_t CrFwSocketTestCase4 ()
 Test the interleaved sending and receiving of multiple packets through client and server sockets of CrFwClientSocket.h and CrFwServerSocket.h. More...
 

Detailed Description

Implementation of test cases for Socket-Based InStream and OutStream Components.

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 CrFwSocketTestCases.c.

Function Documentation

◆ CrFwSocketTestCase1()

CrFwBool_t CrFwSocketTestCase1 ( )

Test the initialization and configuration of the socket-based InStream and OutStream.

The following actions are performed in this test:

  • The Socket-Based InStream and OutStream are created, initialized and configured and it is checked that both enter state CONFIGURED.
  • A packet is sent to the OutStream and it is checked that it is correctly received by the InStream.
  • Several packets are sent to the OutStream and then the InStream is polled and it is checked that all packets are correctly received.
  • The InStream is polled without any packet having been sent by the OutStream and it is checked that nothing is returned.
Returns
true if the test was successful, false otherwise.

Definition at line 48 of file CrFwSocketTestCases.c.

◆ CrFwSocketTestCase2()

CrFwBool_t CrFwSocketTestCase2 ( )

Test the initialization and configuration of the client and server sockets of CrFwClientSocket.h and CrFwServerSocket.h.

The configuration of the client and server sockets is as follows (see CrFwInStreamUserPar.h and CrFwOutStreamUserPar.h):

  • InStream6 and OutStream6 are attached to the client socket
  • InStream7 and OutStream7 are attached to the server socket

The following actions are performed in this test:

  • The InStream and OutStreams 6 and 7 which use the CrFwClientSocket.h and CrFwServerSocket.h are created.
  • The server socket is initialized (by initializing an InStream or OutStream attached to it), then the client socket is initialized (by initializing an InStream or OutStream attached to it), and then both are configured (by configuring the InStreams and OutStream.
  • A packet is sent from the server socket (OutStream7) to the client socket (InStream6) and it is checked that it is correctly received.
  • A packet is sent from the client socket (OutStream6) to the server socket (InStream7) and it is checked that it is correctly received.
Returns
true if the test was successful, false otherwise.

Definition at line 188 of file CrFwSocketTestCases.c.

◆ CrFwSocketTestCase3()

CrFwBool_t CrFwSocketTestCase3 ( )

Test the sending and receiving of multiple packets through client and server sockets of CrFwClientSocket.h and CrFwServerSocket.h.

The configuration of the client and server sockets is as follows (see CrFwInStreamUserPar.h and CrFwOutStreamUserPar.h):

  • InStream6 and OutStream6 are attached to the client socket
  • InStream7 and OutStream7 are attached to the server socket

The following actions are performed in this test:

  • The InStream and OutStreams 6 and 7 which use the CrFwClientSocket.h and CrFwServerSocket.h are created, initialized and configured.
  • Several packets are sent from the server socket (OutStream7) to the client socket (InStream6) and it is checked that they are correctly received.
  • Several packets are sent from the client socket (OutStream6) to the server socket (InStream7) and it is checked that they are correctly received.
Returns
true if the test was successful, false otherwise.

Definition at line 314 of file CrFwSocketTestCases.c.

◆ CrFwSocketTestCase4()

CrFwBool_t CrFwSocketTestCase4 ( )

Test the interleaved sending and receiving of multiple packets through client and server sockets of CrFwClientSocket.h and CrFwServerSocket.h.

The configuration of the client and server sockets is as follows (see CrFwInStreamUserPar.h and CrFwOutStreamUserPar.h):

  • InStream6 and OutStream6 are attached to the client socket
  • InStream7 and OutStream7 are attached to the server socket
  • The client socket is designed to route incoming packets to InStream6
  • The server socket is designed to route incoming packets to InStream7

The following actions are performed in this test:

  • The InStream and OutStreams 6 and 7 which use the CrFwClientSocket.h and CrFwServerSocket.h are created, initialized and configured.
  • Several packets are sent from the server socket (OutStream7) to the client socket (InStream6) and from the client socket (OutStream6) to the server socket (InStream7); the sending operation through the two sockets are interleaved.
  • It is checked that all packets are correctly received.
Returns
true if the test was successful, false otherwise.

Definition at line 490 of file CrFwSocketTestCases.c.

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