CORDET Framework - C2 Implementation
CrFwUtilityFunctionsTestCases.c File Reference

Implementation of test cases for the Utility Functions. More...

Go to the source code of this file.

Macros

#define CR_FW_UTILITYFUNCTIONS_TESTCASES_EVEN_SIZE   20
 The even size of the test array.
 
#define CR_FW_UTILITYFUNCTIONS_TESTCASES_ODD_SIZE   21
 The odd size of the test array.
 

Functions

CrFwBool_t CrFwUtilityFunctionsTestCase1 ()
 Test the CrFwFindKeyIndex function. More...
 
CrFwBool_t CrFwUtilityFunctionsTestCase2 ()
 Test the convenience utility functions which are not exercised in other test cases. More...
 

Detailed Description

Implementation of test cases for the Utility Functions.

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

Function Documentation

◆ CrFwUtilityFunctionsTestCase1()

CrFwBool_t CrFwUtilityFunctionsTestCase1 ( )

Test the CrFwFindKeyIndex function.

The following actions are performed in this test:

  • A test array of type CrFwCmdRepKindKey_t is set up and filled with key values in increasing order to simulate an array of report or command kinds. The size of this test array is an even integer.
  • The test array is searched through function :.CrFwFindKeyIndex for a key which is present in the array in an odd-numbered intermediate position.
  • The test array is searched through function :.CrFwFindKeyIndex for a key which is present in the array in an even-numbered intermediate position.
  • The test array is searched through function :.CrFwFindKeyIndex for the first key in the array.
  • The test array is searched through function :.CrFwFindKeyIndex for a key which is smaller than all the key in the test array.
  • The test array is searched through function :.CrFwFindKeyIndex for a key which is larger than all the key in the test array.
  • The test array is searched through function :.CrFwFindKeyIndex for a key which is within the range of keys stored in the test array but is not present in the array.
  • The same steps as above are repeated for a test array with a size equal to an odd number.
  • A test array of size 1 is defined and both a successful and a failed search are verified.
Returns
true if the test was successful, false otherwise.

Definition at line 39 of file CrFwUtilityFunctionsTestCases.c.

◆ CrFwUtilityFunctionsTestCase2()

CrFwBool_t CrFwUtilityFunctionsTestCase2 ( )

Test the convenience utility functions which are not exercised in other test cases.

The following actions are performed in this test:

  • Function CrFwSmCheckAlwaysTrue is called with a dummy argument and it is verified that it returns 1.
  • Function CrFwSmEmptyAction is called with a dummy argument and it is verified that it returns without doing anything.
  • Function CrFwSmSuccessAction is called with a command as dummy argument and it is verified that it returns after setting its success outcome to 1.
Returns
true if the test was successful, false otherwise.

Definition at line 111 of file CrFwUtilityFunctionsTestCases.c.

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