|
LibJuno 1.0.4
LibJuno is a lightweight C11 library designed specifically for embedded systems.
|
Google Test suite for the UDP module (JunoUdp_Init and vtable dispatch). More...
#include <gtest/gtest.h>#include <string.h>#include <stdint.h>#include "udp_api.h"#include "juno/status.h"#include "juno/module.h"
Data Structures | |
| class | UdpModuleTest |
Functions | |
| static JUNO_STATUS_T | TestSend (JUNO_UDP_ROOT_T *ptRoot, const UDP_THREAD_MSG_T *ptMsg) |
| static JUNO_STATUS_T | TestReceive (JUNO_UDP_ROOT_T *ptRoot, UDP_THREAD_MSG_T *ptMsg) |
| static JUNO_STATUS_T | TestFree (JUNO_UDP_ROOT_T *ptRoot) |
| static void | TestFailureHandler (JUNO_STATUS_T tStatus, const char *pcMsg, void *pvUserData) |
| static void | ResetAllDoubles (void) |
| TEST_F (UdpModuleTest, InitHappyPathWiresVtable) | |
| TEST_F (UdpModuleTest, InitNullRootReturnsNullptrError) | |
| TEST_F (UdpModuleTest, InitNullVtableReturnsNullptrError) | |
| TEST_F (UdpModuleTest, InitStoresFailureHandlerAndUserData) | |
| TEST_F (UdpModuleTest, InitNullHandlerAndNullUserDataArePermitted) | |
| TEST_F (UdpModuleTest, RootHoldsPtApiField) | |
| TEST_F (UdpModuleTest, RootHoldsFailureHandlerField) | |
| TEST_F (UdpModuleTest, AllApiOperationsReturnStatusT) | |
| TEST_F (UdpModuleTest, FailureHandlerFiredViaJunoFailRoot) | |
| TEST_F (UdpModuleTest, FailureHandlerReceivesCorrectUserData) | |
| TEST_F (UdpModuleTest, FailureHandlerNotInvokedOnSuccess) | |
| TEST_F (UdpModuleTest, SendDispatchesViaVtable) | |
| TEST_F (UdpModuleTest, SendInjectedFailureReturnsExactStatus) | |
| TEST_F (UdpModuleTest, ReceiveDispatchesViaVtableAndPopulatesOutput) | |
| TEST_F (UdpModuleTest, ReceiveInjectedFailureReturnsExactStatus) | |
| TEST_F (UdpModuleTest, ReceiveTimeoutReturnsTimeoutError) | |
| TEST_F (UdpModuleTest, ReceiveTimeoutStatusCodeIsDistinctFromSuccess) | |
| TEST_F (UdpModuleTest, FreeDispatchesViaVtable) | |
| TEST_F (UdpModuleTest, FreeInjectedFailureReturnsExactStatus) | |
| TEST_F (UdpModuleTest, MessageStructSizeIs76Bytes) | |
Variables | ||
| struct { | ||
| int iSendCallCount | ||
| int iReceiveCallCount | ||
| int iFreeCalled | ||
| bool bFailSend | ||
| bool bFailReceive | ||
| bool bFailFree | ||
| JUNO_STATUS_T tSendStatus | ||
| JUNO_STATUS_T tReceiveStatus | ||
| JUNO_STATUS_T tFreeStatus | ||
| const UDP_THREAD_MSG_T * ptLastSendMsg | ||
| UDP_THREAD_MSG_T * ptLastReceiveMsg | ||
| UDP_THREAD_MSG_T tReceivePayload | ||
| } | s_tFakeState | |
| static const JUNO_UDP_API_T | s_tTestApi | |
| struct { | ||
| int iCallCount | ||
| JUNO_STATUS_T tLastStatus | ||
| void * pvLastUserData | ||
| } | s_tFhDouble | |
Google Test suite for the UDP module (JunoUdp_Init and vtable dispatch).
Covers requirements: REQ-UDP-001, REQ-UDP-003, REQ-UDP-006, REQ-UDP-007, REQ-UDP-008, REQ-UDP-009, REQ-UDP-012, REQ-UDP-013, REQ-UDP-016.
Test doubles use a vtable-injected fake JUNO_UDP_API_T. No POSIX socket API is called from this file. No dynamic allocation is used anywhere in this file.
|
static |
| TEST_F | ( | UdpModuleTest | , |
| AllApiOperationsReturnStatusT | |||
| ) |
| TEST_F | ( | UdpModuleTest | , |
| FailureHandlerFiredViaJunoFailRoot | |||
| ) |
| TEST_F | ( | UdpModuleTest | , |
| FailureHandlerNotInvokedOnSuccess | |||
| ) |
| TEST_F | ( | UdpModuleTest | , |
| FailureHandlerReceivesCorrectUserData | |||
| ) |
| TEST_F | ( | UdpModuleTest | , |
| FreeDispatchesViaVtable | |||
| ) |
| TEST_F | ( | UdpModuleTest | , |
| FreeInjectedFailureReturnsExactStatus | |||
| ) |
| TEST_F | ( | UdpModuleTest | , |
| InitHappyPathWiresVtable | |||
| ) |
| TEST_F | ( | UdpModuleTest | , |
| InitNullHandlerAndNullUserDataArePermitted | |||
| ) |
| TEST_F | ( | UdpModuleTest | , |
| InitNullRootReturnsNullptrError | |||
| ) |
| TEST_F | ( | UdpModuleTest | , |
| InitNullVtableReturnsNullptrError | |||
| ) |
| TEST_F | ( | UdpModuleTest | , |
| InitStoresFailureHandlerAndUserData | |||
| ) |
| TEST_F | ( | UdpModuleTest | , |
| MessageStructSizeIs76Bytes | |||
| ) |
| TEST_F | ( | UdpModuleTest | , |
| ReceiveDispatchesViaVtableAndPopulatesOutput | |||
| ) |
| TEST_F | ( | UdpModuleTest | , |
| ReceiveInjectedFailureReturnsExactStatus | |||
| ) |
| TEST_F | ( | UdpModuleTest | , |
| ReceiveTimeoutReturnsTimeoutError | |||
| ) |
| TEST_F | ( | UdpModuleTest | , |
| ReceiveTimeoutStatusCodeIsDistinctFromSuccess | |||
| ) |
| TEST_F | ( | UdpModuleTest | , |
| RootHoldsFailureHandlerField | |||
| ) |
| TEST_F | ( | UdpModuleTest | , |
| RootHoldsPtApiField | |||
| ) |
| TEST_F | ( | UdpModuleTest | , |
| SendDispatchesViaVtable | |||
| ) |
| TEST_F | ( | UdpModuleTest | , |
| SendInjectedFailureReturnsExactStatus | |||
| ) |
|
static |
|
static |
|
static |
|
static |
| bool bFailFree |
| bool bFailReceive |
| bool bFailSend |
| int iCallCount |
| int iFreeCalled |
| int iReceiveCallCount |
| int iSendCallCount |
| UDP_THREAD_MSG_T* ptLastReceiveMsg |
| const UDP_THREAD_MSG_T* ptLastSendMsg |
| void* pvLastUserData |
| struct { ... } s_tFakeState |
| struct { ... } s_tFhDouble |
|
static |
| JUNO_STATUS_T tFreeStatus |
| JUNO_STATUS_T tLastStatus |
| UDP_THREAD_MSG_T tReceivePayload |
| JUNO_STATUS_T tReceiveStatus |
| JUNO_STATUS_T tSendStatus |