foxBMS - Unit Tests  1.5.0
The foxBMS Unit Tests API Documentation
test_can_cbs_rx_debug.c File Reference

Tests for the CAN driver callbacks. More...

#include "unity.h"
#include "Mockcan.h"
#include "Mockcan_cbs_tx_debug-response.h"
#include "Mockcan_cbs_tx_unsupported-message.h"
#include "Mockdatabase.h"
#include "Mockdiag.h"
#include "Mockfoxmath.h"
#include "Mockfram.h"
#include "Mockimd.h"
#include "Mockos.h"
#include "Mockreset.h"
#include "database_cfg.h"
#include "can_cbs_rx.h"
#include "can_cfg_rx-message-definitions.h"
#include "can_helper.h"
#include "test_assert_helper.h"
#include <stdbool.h>
#include <stdint.h>
Include dependency graph for test_can_cbs_rx_debug.c:

Go to the source code of this file.

Macros

#define MULTIPLEXER_VALUE_VERSION_INFORMATION   (0u)
 
#define MULTIPLEXER_VALUE_RTC   (1u)
 
#define MULTIPLEXER_VALUE_SOFTWARE_RESET   (2u)
 
#define MULTIPLEXER_VALUE_FRAM_INITIALIZATION   (3u)
 
#define MULTIPLEXER_VALUE_TIME_INFO   (4u)
 
#define INVALID_MULTIPLEXER_VALUE   (99u)
 

Functions

void setUp (void)
 
void tearDown (void)
 
void testCANRX_DebugAssertionsParamMessage (void)
 
void testCANRX_DebugAssertionsParamCanData (void)
 
void testCANRX_DebugAssertionsParamDatabaseShim (void)
 
void testCANRX_DebugInvalidMultiplexerValues (void)
 
void testCANRX_DebugVersionInformationMultiplexerValue (void)
 
void testCANRX_DebugRtcMultiplexerValue (void)
 
void testCANRX_DebugSoftwareResetMultiplexerValue (void)
 
void testCANRX_DebugFramInitializationMultiplexerValue (void)
 
void testCANRX_DebugTimeInfoMultiplexerValue (void)
 
void testCANRX_GetHundredthOfSeconds (void)
 
void testCANRX_GetSeconds (void)
 
void testCANRX_GetMinutes (void)
 
void testCANRX_GetHours (void)
 
void testCANRX_GetWeekday (void)
 
void testCANRX_GetDay (void)
 
void testCANRX_GetMonth (void)
 
void testCANRX_GetYear (void)
 
void testCANRX_TriggerBmsSoftwareVersionMessage (void)
 
void testCANRX_TriggerMcuUniqueDieIdMessage (void)
 
void testCANRX_TriggerMcuLotNumberMessage (void)
 
void testCANRX_TriggerMcuWaferInformationMessage (void)
 
void testCANRX_TriggerTimeInfoMessage (void)
 
void testCANRX_CheckIfBmsSoftwareVersionIsRequested (void)
 
void testCANRX_CheckIfMcuUniqueDieIdIsRequested (void)
 
void testCANRX_CheckIfMcuLotNumberIsRequested (void)
 
void testCANRX_CheckIfMcuWaferInformationIsRequested (void)
 
void testCANRX_CheckIfSoftwareResetIsRequested (void)
 
void testCANRX_CheckIfFramInitializationIsRequested (void)
 
void testCANRX_CheckIfTimeInfoIsRequested (void)
 
void testCANRX_ProcessVersionInformationMux (void)
 
void testCANRX_ProcessRtcMux (void)
 
void testCANRX_ProcessSoftwareResetMux (void)
 
void testCANRX_ProcessFramInitializationMux (void)
 
void testCANRX_ProcessTimeInfoMux (void)
 

Variables

CAN_MESSAGE_PROPERTIES_s validRxDebugTestMessage
 
const uint8_t testCanDataZeroArray [CAN_MAX_DLC] = {0}
 
const uint64_t testMessageDataZero = 0u
 
const CAN_ENDIANNESS_e invalidEndianness = CAN_LITTLE_ENDIAN
 
const CAN_ENDIANNESS_e validEndianness = CAN_BIG_ENDIAN
 
static DATA_BLOCK_CELL_VOLTAGE_s can_tableCellVoltages = {.header.uniqueId = DATA_BLOCK_ID_CELL_VOLTAGE}
 
static DATA_BLOCK_CELL_TEMPERATURE_s can_tableTemperatures = {.header.uniqueId = DATA_BLOCK_ID_CELL_TEMPERATURE}
 
static DATA_BLOCK_MIN_MAX_s can_tableMinimumMaximumValues = {.header.uniqueId = DATA_BLOCK_ID_MIN_MAX}
 
static DATA_BLOCK_CURRENT_SENSOR_s can_tableCurrentSensor = {.header.uniqueId = DATA_BLOCK_ID_CURRENT_SENSOR}
 
static DATA_BLOCK_OPEN_WIRE_s can_tableOpenWire = {.header.uniqueId = DATA_BLOCK_ID_OPEN_WIRE_BASE}
 
static DATA_BLOCK_STATE_REQUEST_s can_tableStateRequest = {.header.uniqueId = DATA_BLOCK_ID_STATE_REQUEST}
 
static DATA_BLOCK_PACK_VALUES_s can_tablePackValues = {.header.uniqueId = DATA_BLOCK_ID_PACK_VALUES}
 
static DATA_BLOCK_SOF_s can_tableSof = {.header.uniqueId = DATA_BLOCK_ID_SOF}
 
static DATA_BLOCK_SOX_s can_tableSox = {.header.uniqueId = DATA_BLOCK_ID_SOX}
 
static DATA_BLOCK_ERROR_STATE_s can_tableErrorState = {.header.uniqueId = DATA_BLOCK_ID_ERROR_STATE}
 
static DATA_BLOCK_INSULATION_MONITORING_s can_tableInsulation
 
static DATA_BLOCK_MSL_FLAG_s can_tableMslFlags = {.header.uniqueId = DATA_BLOCK_ID_MSL_FLAG}
 
static DATA_BLOCK_RSL_FLAG_s can_tableRslFlags = {.header.uniqueId = DATA_BLOCK_ID_RSL_FLAG}
 
static DATA_BLOCK_MOL_FLAG_s can_tableMolFlags = {.header.uniqueId = DATA_BLOCK_ID_MOL_FLAG}
 
OS_QUEUE imd_canDataQueue = NULL_PTR
 
OS_QUEUE ftsk_rtcSetTimeQueue = NULL_PTR
 
const CAN_SHIM_s can_kShim
 

Detailed Description

Tests for the CAN driver callbacks.

SPDX-License-Identifier: BSD-3-Clause

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

We kindly request you to use one or more of the following phrases to refer to foxBMS in your hardware, software, documentation or advertising materials:

  • ″This product uses parts of foxBMS®″
  • ″This product includes parts of foxBMS®″
  • ″This product is derived from foxBMS®″
Author
foxBMS Team
Date
2021-04-22 (date of creation)
Updated
2023-02-03 (date of last update)
Version
v1.5.0
Prefix
TEST

Definition in file test_can_cbs_rx_debug.c.

Macro Definition Documentation

◆ INVALID_MULTIPLEXER_VALUE

#define INVALID_MULTIPLEXER_VALUE   (99u)

Definition at line 87 of file test_can_cbs_rx_debug.c.

◆ MULTIPLEXER_VALUE_FRAM_INITIALIZATION

#define MULTIPLEXER_VALUE_FRAM_INITIALIZATION   (3u)

Definition at line 85 of file test_can_cbs_rx_debug.c.

◆ MULTIPLEXER_VALUE_RTC

#define MULTIPLEXER_VALUE_RTC   (1u)

Definition at line 83 of file test_can_cbs_rx_debug.c.

◆ MULTIPLEXER_VALUE_SOFTWARE_RESET

#define MULTIPLEXER_VALUE_SOFTWARE_RESET   (2u)

Definition at line 84 of file test_can_cbs_rx_debug.c.

◆ MULTIPLEXER_VALUE_TIME_INFO

#define MULTIPLEXER_VALUE_TIME_INFO   (4u)

Definition at line 86 of file test_can_cbs_rx_debug.c.

◆ MULTIPLEXER_VALUE_VERSION_INFORMATION

#define MULTIPLEXER_VALUE_VERSION_INFORMATION   (0u)

Definition at line 82 of file test_can_cbs_rx_debug.c.

Function Documentation

◆ setUp()

void setUp ( void  )

Definition at line 140 of file test_can_cbs_rx_debug.c.

◆ tearDown()

void tearDown ( void  )

Definition at line 143 of file test_can_cbs_rx_debug.c.

◆ testCANRX_CheckIfBmsSoftwareVersionIsRequested()

void testCANRX_CheckIfBmsSoftwareVersionIsRequested ( void  )

Definition at line 339 of file test_can_cbs_rx_debug.c.

Here is the call graph for this function:

◆ testCANRX_CheckIfFramInitializationIsRequested()

void testCANRX_CheckIfFramInitializationIsRequested ( void  )

Definition at line 390 of file test_can_cbs_rx_debug.c.

Here is the call graph for this function:

◆ testCANRX_CheckIfMcuLotNumberIsRequested()

void testCANRX_CheckIfMcuLotNumberIsRequested ( void  )

Definition at line 359 of file test_can_cbs_rx_debug.c.

Here is the call graph for this function:

◆ testCANRX_CheckIfMcuUniqueDieIdIsRequested()

void testCANRX_CheckIfMcuUniqueDieIdIsRequested ( void  )

Definition at line 349 of file test_can_cbs_rx_debug.c.

Here is the call graph for this function:

◆ testCANRX_CheckIfMcuWaferInformationIsRequested()

void testCANRX_CheckIfMcuWaferInformationIsRequested ( void  )

Definition at line 369 of file test_can_cbs_rx_debug.c.

Here is the call graph for this function:

◆ testCANRX_CheckIfSoftwareResetIsRequested()

void testCANRX_CheckIfSoftwareResetIsRequested ( void  )

Definition at line 380 of file test_can_cbs_rx_debug.c.

Here is the call graph for this function:

◆ testCANRX_CheckIfTimeInfoIsRequested()

void testCANRX_CheckIfTimeInfoIsRequested ( void  )

Definition at line 401 of file test_can_cbs_rx_debug.c.

Here is the call graph for this function:

◆ testCANRX_DebugAssertionsParamCanData()

void testCANRX_DebugAssertionsParamCanData ( void  )

Definition at line 175 of file test_can_cbs_rx_debug.c.

Here is the call graph for this function:

◆ testCANRX_DebugAssertionsParamDatabaseShim()

void testCANRX_DebugAssertionsParamDatabaseShim ( void  )

Definition at line 180 of file test_can_cbs_rx_debug.c.

Here is the call graph for this function:

◆ testCANRX_DebugAssertionsParamMessage()

void testCANRX_DebugAssertionsParamMessage ( void  )

Definition at line 150 of file test_can_cbs_rx_debug.c.

Here is the call graph for this function:

◆ testCANRX_DebugFramInitializationMultiplexerValue()

void testCANRX_DebugFramInitializationMultiplexerValue ( void  )

Definition at line 222 of file test_can_cbs_rx_debug.c.

Here is the call graph for this function:

◆ testCANRX_DebugInvalidMultiplexerValues()

void testCANRX_DebugInvalidMultiplexerValues ( void  )

Definition at line 189 of file test_can_cbs_rx_debug.c.

Here is the call graph for this function:

◆ testCANRX_DebugRtcMultiplexerValue()

void testCANRX_DebugRtcMultiplexerValue ( void  )

Definition at line 206 of file test_can_cbs_rx_debug.c.

Here is the call graph for this function:

◆ testCANRX_DebugSoftwareResetMultiplexerValue()

void testCANRX_DebugSoftwareResetMultiplexerValue ( void  )

Definition at line 214 of file test_can_cbs_rx_debug.c.

Here is the call graph for this function:

◆ testCANRX_DebugTimeInfoMultiplexerValue()

void testCANRX_DebugTimeInfoMultiplexerValue ( void  )

Definition at line 230 of file test_can_cbs_rx_debug.c.

Here is the call graph for this function:

◆ testCANRX_DebugVersionInformationMultiplexerValue()

void testCANRX_DebugVersionInformationMultiplexerValue ( void  )

Definition at line 198 of file test_can_cbs_rx_debug.c.

Here is the call graph for this function:

◆ testCANRX_GetDay()

void testCANRX_GetDay ( void  )

Definition at line 269 of file test_can_cbs_rx_debug.c.

Here is the call graph for this function:

◆ testCANRX_GetHours()

void testCANRX_GetHours ( void  )

Definition at line 257 of file test_can_cbs_rx_debug.c.

Here is the call graph for this function:

◆ testCANRX_GetHundredthOfSeconds()

void testCANRX_GetHundredthOfSeconds ( void  )

Definition at line 239 of file test_can_cbs_rx_debug.c.

Here is the call graph for this function:

◆ testCANRX_GetMinutes()

void testCANRX_GetMinutes ( void  )

Definition at line 251 of file test_can_cbs_rx_debug.c.

Here is the call graph for this function:

◆ testCANRX_GetMonth()

void testCANRX_GetMonth ( void  )

Definition at line 275 of file test_can_cbs_rx_debug.c.

Here is the call graph for this function:

◆ testCANRX_GetSeconds()

void testCANRX_GetSeconds ( void  )

Definition at line 245 of file test_can_cbs_rx_debug.c.

Here is the call graph for this function:

◆ testCANRX_GetWeekday()

void testCANRX_GetWeekday ( void  )

Definition at line 263 of file test_can_cbs_rx_debug.c.

Here is the call graph for this function:

◆ testCANRX_GetYear()

void testCANRX_GetYear ( void  )

Definition at line 281 of file test_can_cbs_rx_debug.c.

Here is the call graph for this function:

◆ testCANRX_ProcessFramInitializationMux()

void testCANRX_ProcessFramInitializationMux ( void  )

Definition at line 455 of file test_can_cbs_rx_debug.c.

Here is the call graph for this function:

◆ testCANRX_ProcessRtcMux()

void testCANRX_ProcessRtcMux ( void  )

Definition at line 435 of file test_can_cbs_rx_debug.c.

Here is the call graph for this function:

◆ testCANRX_ProcessSoftwareResetMux()

void testCANRX_ProcessSoftwareResetMux ( void  )

Definition at line 446 of file test_can_cbs_rx_debug.c.

Here is the call graph for this function:

◆ testCANRX_ProcessTimeInfoMux()

void testCANRX_ProcessTimeInfoMux ( void  )

Definition at line 465 of file test_can_cbs_rx_debug.c.

Here is the call graph for this function:

◆ testCANRX_ProcessVersionInformationMux()

void testCANRX_ProcessVersionInformationMux ( void  )

Definition at line 414 of file test_can_cbs_rx_debug.c.

Here is the call graph for this function:

◆ testCANRX_TriggerBmsSoftwareVersionMessage()

void testCANRX_TriggerBmsSoftwareVersionMessage ( void  )

Definition at line 288 of file test_can_cbs_rx_debug.c.

Here is the call graph for this function:

◆ testCANRX_TriggerMcuLotNumberMessage()

void testCANRX_TriggerMcuLotNumberMessage ( void  )

Definition at line 308 of file test_can_cbs_rx_debug.c.

Here is the call graph for this function:

◆ testCANRX_TriggerMcuUniqueDieIdMessage()

void testCANRX_TriggerMcuUniqueDieIdMessage ( void  )

Definition at line 298 of file test_can_cbs_rx_debug.c.

Here is the call graph for this function:

◆ testCANRX_TriggerMcuWaferInformationMessage()

void testCANRX_TriggerMcuWaferInformationMessage ( void  )

Definition at line 318 of file test_can_cbs_rx_debug.c.

Here is the call graph for this function:

◆ testCANRX_TriggerTimeInfoMessage()

void testCANRX_TriggerTimeInfoMessage ( void  )

Definition at line 328 of file test_can_cbs_rx_debug.c.

Here is the call graph for this function:

Variable Documentation

◆ can_kShim

const CAN_SHIM_s can_kShim
Initial value:
= {
.pQueueImd = &imd_canDataQueue,
.pTableCellVoltage = &can_tableCellVoltages,
.pTableCellTemperature = &can_tableTemperatures,
.pTableCurrentSensor = &can_tableCurrentSensor,
.pTableOpenWire = &can_tableOpenWire,
.pTableStateRequest = &can_tableStateRequest,
.pTablePackValues = &can_tablePackValues,
.pTableSof = &can_tableSof,
.pTableSox = &can_tableSox,
.pTableErrorState = &can_tableErrorState,
.pTableInsulation = &can_tableInsulation,
.pTableMsl = &can_tableMslFlags,
.pTableRsl = &can_tableRslFlags,
.pTableMol = &can_tableMolFlags,
}
static DATA_BLOCK_CELL_VOLTAGE_s can_tableCellVoltages
static DATA_BLOCK_MSL_FLAG_s can_tableMslFlags
static DATA_BLOCK_MIN_MAX_s can_tableMinimumMaximumValues
static DATA_BLOCK_OPEN_WIRE_s can_tableOpenWire
static DATA_BLOCK_PACK_VALUES_s can_tablePackValues
static DATA_BLOCK_MOL_FLAG_s can_tableMolFlags
static DATA_BLOCK_ERROR_STATE_s can_tableErrorState
static DATA_BLOCK_CELL_TEMPERATURE_s can_tableTemperatures
static DATA_BLOCK_SOX_s can_tableSox
static DATA_BLOCK_RSL_FLAG_s can_tableRslFlags
static DATA_BLOCK_STATE_REQUEST_s can_tableStateRequest
static DATA_BLOCK_INSULATION_MONITORING_s can_tableInsulation
static DATA_BLOCK_SOF_s can_tableSof
static DATA_BLOCK_CURRENT_SENSOR_s can_tableCurrentSensor
OS_QUEUE imd_canDataQueue

variable for storing and passing on the local database table handles

Definition at line 121 of file test_can_cbs_rx_debug.c.

◆ can_tableCellVoltages

DATA_BLOCK_CELL_VOLTAGE_s can_tableCellVoltages = {.header.uniqueId = DATA_BLOCK_ID_CELL_VOLTAGE}
static

Definition at line 102 of file test_can_cbs_rx_debug.c.

◆ can_tableCurrentSensor

DATA_BLOCK_CURRENT_SENSOR_s can_tableCurrentSensor = {.header.uniqueId = DATA_BLOCK_ID_CURRENT_SENSOR}
static

Definition at line 105 of file test_can_cbs_rx_debug.c.

◆ can_tableErrorState

DATA_BLOCK_ERROR_STATE_s can_tableErrorState = {.header.uniqueId = DATA_BLOCK_ID_ERROR_STATE}
static

Definition at line 111 of file test_can_cbs_rx_debug.c.

◆ can_tableInsulation

DATA_BLOCK_INSULATION_MONITORING_s can_tableInsulation
static
Initial value:
= {
@ DATA_BLOCK_ID_INSULATION_MONITORING
Definition: database_cfg.h:107

Definition at line 112 of file test_can_cbs_rx_debug.c.

◆ can_tableMinimumMaximumValues

DATA_BLOCK_MIN_MAX_s can_tableMinimumMaximumValues = {.header.uniqueId = DATA_BLOCK_ID_MIN_MAX}
static

Definition at line 104 of file test_can_cbs_rx_debug.c.

◆ can_tableMolFlags

DATA_BLOCK_MOL_FLAG_s can_tableMolFlags = {.header.uniqueId = DATA_BLOCK_ID_MOL_FLAG}
static

Definition at line 116 of file test_can_cbs_rx_debug.c.

◆ can_tableMslFlags

DATA_BLOCK_MSL_FLAG_s can_tableMslFlags = {.header.uniqueId = DATA_BLOCK_ID_MSL_FLAG}
static

Definition at line 114 of file test_can_cbs_rx_debug.c.

◆ can_tableOpenWire

DATA_BLOCK_OPEN_WIRE_s can_tableOpenWire = {.header.uniqueId = DATA_BLOCK_ID_OPEN_WIRE_BASE}
static

Definition at line 106 of file test_can_cbs_rx_debug.c.

◆ can_tablePackValues

DATA_BLOCK_PACK_VALUES_s can_tablePackValues = {.header.uniqueId = DATA_BLOCK_ID_PACK_VALUES}
static

Definition at line 108 of file test_can_cbs_rx_debug.c.

◆ can_tableRslFlags

DATA_BLOCK_RSL_FLAG_s can_tableRslFlags = {.header.uniqueId = DATA_BLOCK_ID_RSL_FLAG}
static

Definition at line 115 of file test_can_cbs_rx_debug.c.

◆ can_tableSof

DATA_BLOCK_SOF_s can_tableSof = {.header.uniqueId = DATA_BLOCK_ID_SOF}
static

Definition at line 109 of file test_can_cbs_rx_debug.c.

◆ can_tableSox

DATA_BLOCK_SOX_s can_tableSox = {.header.uniqueId = DATA_BLOCK_ID_SOX}
static

Definition at line 110 of file test_can_cbs_rx_debug.c.

◆ can_tableStateRequest

DATA_BLOCK_STATE_REQUEST_s can_tableStateRequest = {.header.uniqueId = DATA_BLOCK_ID_STATE_REQUEST}
static

Definition at line 107 of file test_can_cbs_rx_debug.c.

◆ can_tableTemperatures

DATA_BLOCK_CELL_TEMPERATURE_s can_tableTemperatures = {.header.uniqueId = DATA_BLOCK_ID_CELL_TEMPERATURE}
static

Definition at line 103 of file test_can_cbs_rx_debug.c.

◆ ftsk_rtcSetTimeQueue

OS_QUEUE ftsk_rtcSetTimeQueue = NULL_PTR

handle of the rtc driver data queue

Definition at line 119 of file test_can_cbs_rx_debug.c.

◆ imd_canDataQueue

OS_QUEUE imd_canDataQueue = NULL_PTR

Definition at line 118 of file test_can_cbs_rx_debug.c.

◆ invalidEndianness

const CAN_ENDIANNESS_e invalidEndianness = CAN_LITTLE_ENDIAN

Definition at line 99 of file test_can_cbs_rx_debug.c.

◆ testCanDataZeroArray

const uint8_t testCanDataZeroArray[CAN_MAX_DLC] = {0}

Definition at line 97 of file test_can_cbs_rx_debug.c.

◆ testMessageDataZero

const uint64_t testMessageDataZero = 0u

Definition at line 98 of file test_can_cbs_rx_debug.c.

◆ validEndianness

const CAN_ENDIANNESS_e validEndianness = CAN_BIG_ENDIAN

Definition at line 100 of file test_can_cbs_rx_debug.c.

◆ validRxDebugTestMessage

CAN_MESSAGE_PROPERTIES_s validRxDebugTestMessage
Initial value:
= {
.endianness = CANRX_DEBUG_ENDIANNESS,
}
#define CAN_DEFAULT_DLC
Definition: can_cfg.h:103
#define CANRX_DEBUG_ID_TYPE
#define CANRX_DEBUG_ENDIANNESS
#define CANRX_DEBUG_ID

Definition at line 89 of file test_can_cbs_rx_debug.c.