foxBMS - Unit Tests
1.3.0
The foxBMS Unit Tests API Documentation
|
Tests for the CAN driver. More...
#include "unity.h"
#include "MockHL_can.h"
#include "Mockcan_cfg.h"
#include "Mockdatabase.h"
#include "Mockdiag.h"
#include "Mockfoxmath.h"
#include "Mockftask.h"
#include "Mockimd.h"
#include "Mockio.h"
#include "Mockmcu.h"
#include "Mockos.h"
#include "Mockpex.h"
#include "Mockqueue.h"
#include "Mocktest_can_mpu_prototype_queue_create_stub.h"
#include "version_cfg.h"
#include "can.h"
#include "test_assert_helper.h"
Go to the source code of this file.
Functions | |
static uint32_t | can_dummy (uint32_t id, uint8_t dlc, CAN_ENDIANNESS_e endianness, uint8_t *pCanData, uint8_t *pMuxId, const CAN_SHIM_s const *kpkCanShim) |
void | setUp (void) |
void | tearDown (void) |
void | testDataSendNullPointerAsNode (void) |
void | testDataSendNullPointerAsData (void) |
void | testDataSendNoMessagePending (void) |
void | testDataSendMessagePending (void) |
void | testEnablePeriodic (void) |
void | testIsCurrentSensorPresent (void) |
void | testIsCurrentSensorCcPresent (void) |
void | testCAN_TransmitBootMessage (void) |
void | testCAN_TransmitDieId (void) |
test CAN_TransmitDieId() More... | |
Tests for the CAN driver.
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:
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:
Definition in file test_can.c.
|
static |
Definition at line 108 of file test_can.c.
void setUp | ( | void | ) |
void tearDown | ( | void | ) |
Definition at line 148 of file test_can.c.
void testCAN_TransmitBootMessage | ( | void | ) |
Definition at line 240 of file test_can.c.
void testCAN_TransmitDieId | ( | void | ) |
test CAN_TransmitDieId()
Currently not implemented. Implementing a test for this function would require implementing a harness that mocks away the systemREG1 (defined in HAL) as otherwise the test would attempt to read random memory addresses. Since the benefit of testing this function on unit level is rather low (next to no interaction with rest of code base), it should be tested in the integration test.
Definition at line 254 of file test_can.c.
void testDataSendMessagePending | ( | void | ) |
void testDataSendNoMessagePending | ( | void | ) |
void testDataSendNullPointerAsData | ( | void | ) |
void testDataSendNullPointerAsNode | ( | void | ) |
void testEnablePeriodic | ( | void | ) |
void testIsCurrentSensorCcPresent | ( | void | ) |
void testIsCurrentSensorPresent | ( | void | ) |
const CAN_SHIM_s can_kShim |
variable for storing and passing on the local database table handles
Definition at line 98 of file test_can.c.
const uint8_t can_rxLength = sizeof(can_rxMessages) / sizeof(can_rxMessages[0]) |
Definition at line 127 of file test_can.c.
const CAN_MSG_RX_TYPE_s can_rxMessages[] |
registry of CAN RX messages
Definition at line 122 of file test_can.c.
|
static |
Definition at line 89 of file test_can.c.
|
static |
Definition at line 92 of file test_can.c.
|
static |
Definition at line 91 of file test_can.c.
|
static |
Definition at line 93 of file test_can.c.
|
static |
Definition at line 94 of file test_can.c.
|
static |
Definition at line 90 of file test_can.c.
const uint8_t can_txLength = sizeof(can_txMessages) / sizeof(can_txMessages[0]) |
array length for transmission CAN0 message definition
length of CAN message arrays
Definition at line 126 of file test_can.c.
const CAN_MSG_TX_TYPE_s can_txMessages[] |
CAN_STATE_s* canTestState = NULL_PTR |
Definition at line 129 of file test_can.c.
const VERSION_s foxbmsVersionInfo |
version information of the system
Definition at line 78 of file test_can.c.
volatile bool ftsk_allQueuesCreated = false |
indicator whether the queues have successfully been initialized to be used in other parts of the software
Definition at line 134 of file test_can.c.
QueueHandle_t ftsk_canRxQueue = NULL_PTR |
handle of the can driver data queue
Definition at line 133 of file test_can.c.
QueueHandle_t ftsk_dataQueue = NULL_PTR |
Definition at line 131 of file test_can.c.
QueueHandle_t ftsk_imdCanDataQueue = NULL_PTR |
handle of the imd can data queue
Definition at line 132 of file test_can.c.
QueueHandle_t imd_canDataQueue = NULL_PTR |
Definition at line 96 of file test_can.c.