CDI SDK
SDK for transporting chunks of data reliably and with low latency using a polled mode network driver.
Loading...
Searching...
No Matches
cdi_test_unit_api.c File Reference

This file contains the definitions of the functions that comprise the CDI Utility Functions API. More...

#include "cdi_utility_api.h"
#include "cdi_logger_api.h"
#include <assert.h>
#include <stddef.h>
#include "cdi_test_unit_api.h"

Data Structures

struct  RunTestParams
 Enum/name/function keys. More...
 

Typedefs

typedef CdiReturnStatus(* RunTestAPI) (void)
 Type used as a pointer to function that runs a unit test.
 

Functions

CdiReturnStatus TestUnitAll (void)
 External declarations.
 
CdiReturnStatus TestUnitAvmApi (void)
 External declarations.
 
CdiReturnStatus TestUnitSgl (void)
 External declarations.
 
CdiReturnStatus TestUnitTimeout (void)
 External declarations.
 
CdiReturnStatus TestUnitTDigest (void)
 External declarations.
 
CdiReturnStatus TestUnitRxReorderPackets (void)
 External declarations.
 
CdiReturnStatus TestUnitRxReorderPayloads (void)
 External declarations.
 
CdiReturnStatus TestUnitList (void)
 External declarations.
 
CdiReturnStatus TestUnitLogger (void)
 External declarations.
 
static bool RunTest (CdiTestUnitName test_key)
 Log a pass/fail status message.
 
const CdiEnumStringKeyCdiTestUnitGetKeyArray (void)
 Get key array, only used internally by the CDI-SDK.
 
bool CdiTestUnitRun (CdiTestUnitName test_name)
 

Variables

static const RunTestParams tests []
 Enum/string keys for CdiTestUnitRun.
 
static CdiEnumStringKey test_unit_name_key_array [sizeof(tests)/sizeof(tests[0])] = { 0 }
 Enum/string keys for CdiConnectionStatus.
 

Detailed Description

This file contains the definitions of the functions that comprise the CDI Utility Functions API.

Function Documentation

◆ CdiTestUnitGetKeyArray()

const CdiEnumStringKey * CdiTestUnitGetKeyArray ( void )

Get key array, only used internally by the CDI-SDK.

Returns
Pointer to enum string array.

◆ CdiTestUnitRun()

bool CdiTestUnitRun ( CdiTestUnitName test_name)

Function used to convert a string to a matching enum value.

Parameters
test_nameEnum from CdiTestUnitName which indicates which unit test to run.
Returns
true if all tests were successful, otherwise false.

◆ RunTest()

static bool RunTest ( CdiTestUnitName test_key)
static

Log a pass/fail status message.

Parameters
test_keyKey identifying a test.
Returns
true if success, otherwise false.

◆ TestUnitSgl()

CdiReturnStatus TestUnitSgl ( void )
extern

External declarations.

Runs all of the defined CdiCoreGather() test cases. Testing stops on the first failed case.

Returns
bool true if all of the cases passed, false if one case failed.

◆ TestUnitTDigest()

CdiReturnStatus TestUnitTDigest ( void )
extern

External declarations.

External declarations.

Returns
Status code.

◆ TestUnitTimeout()

CdiReturnStatus TestUnitTimeout ( void )
extern

External declarations.

External declarations.

Variable Documentation

◆ tests

const RunTestParams tests[]
static
Initial value:
= {
{ kTestUnitAll, "All", NULL },
{ CDI_INVALID_ENUM_VALUE, NULL, NULL }
}
CdiReturnStatus TestUnitAvmApi(void)
External declarations.
Definition test_unit_avm_api.c:1073
CdiReturnStatus TestUnitList(void)
External declarations.
Definition test_unit_list.c:36
CdiReturnStatus TestUnitSgl(void)
External declarations.
Definition test_unit_sgl.c:148
CdiReturnStatus TestUnitTimeout(void)
External declarations.
Definition test_unit_timeout.c:321
CdiReturnStatus TestUnitTDigest(void)
External declarations.
Definition test_unit_t_digest.c:452
CdiReturnStatus TestUnitRxReorderPayloads(void)
External declarations.
Definition test_unit_rx_reorder_payloads.c:55
CdiReturnStatus TestUnitRxReorderPackets(void)
External declarations.
Definition test_unit_rx_reorder_packets.c:46
CdiReturnStatus TestUnitLogger(void)
External declarations.
Definition test_unit_logger.c:50
@ kTestUnitAll
Test all unit tests.
Definition cdi_test_unit_api.h:30
@ kTestUnitLogger
Test logger functions.
Definition cdi_test_unit_api.h:38
@ kTestUnitTDigest
Test unit T-digest.
Definition cdi_test_unit_api.h:34
@ kTestUnitList
Unit test for doubly linked list implementation.
Definition cdi_test_unit_api.h:37
@ kTestUnitSgl
Test unit SGL.
Definition cdi_test_unit_api.h:32
@ kTestUnitAvmApi
Test unit AVM functions.
Definition cdi_test_unit_api.h:31
@ kTestUnitRxPayloadReorder
Test unit Rx payload reorderer.
Definition cdi_test_unit_api.h:36
@ kTestUnitTimeout
Test unit timeout.
Definition cdi_test_unit_api.h:33
@ kTestUnitRxpacketReorder
Test unit Rx packet reorderer.
Definition cdi_test_unit_api.h:35
#define CDI_INVALID_ENUM_VALUE
Used to define an invalid enum found.
Definition cdi_utility_api.h:38

Enum/string keys for CdiTestUnitRun.