foxBMS - Unit Tests
1.3.0
The foxBMS Unit Tests API Documentation
|
Tests for the SPS driver. More...
#include "unity.h"
#include "Mockcontactor.h"
#include "Mockcontactor_cfg.h"
#include "Mockdatabase.h"
#include "Mockio.h"
#include "Mockmcu.h"
#include "Mockos.h"
#include "Mockpex.h"
#include "Mockpex_cfg.h"
#include "Mockspi.h"
#include "Mockspi_cfg.h"
#include "Mocksps_cfg.h"
#include "Mocksps_types.h"
#include "sps.h"
#include "test_assert_helper.h"
Go to the source code of this file.
Tests for the SPS 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_sps.c.
void setUp | ( | void | ) |
Definition at line 115 of file test_sps.c.
void tearDown | ( | void | ) |
Definition at line 125 of file test_sps.c.
void testContactorSwitchOnAndOff | ( | void | ) |
void testSPS_CtrlAssertOnIllegalState | ( | void | ) |
void testSPS_CtrlNormalOperationCycle | ( | void | ) |
void testSPS_CtrlResetFromStateSPS_CONFIGURE_CONTROL_REGISTER | ( | void | ) |
void testSPS_CtrlResetFromStateSPS_READ_EN_IRQ_PIN | ( | void | ) |
void testSPS_CtrlResetFromStateSPS_READ_MEASURED_CURRENT1 | ( | void | ) |
void testSPS_CtrlResetFromStateSPS_READ_MEASURED_CURRENT2 | ( | void | ) |
void testSPS_CtrlResetFromStateSPS_READ_MEASURED_CURRENT3 | ( | void | ) |
void testSPS_CtrlResetFromStateSPS_READ_MEASURED_CURRENT4 | ( | void | ) |
void testSPS_CtrlResetFromStateSPS_TRIGGER_CURRENT_MEASUREMENT | ( | void | ) |
void testSPS_CtrlResetOnFailedBothTransactions | ( | void | ) |
void testSPS_CtrlResetOnFailedFirstTransaction | ( | void | ) |
void testSPS_CtrlResetOnFailedSecondTransaction | ( | void | ) |
void testSPS_CtrlStartupProcedure | ( | void | ) |
void testSPS_GetChannelAffiliationInvalidIndex | ( | void | ) |
void testSPS_GetChannelAffiliationValidIndex | ( | void | ) |
void testSPS_GetChannelFeedbackChannelHigh | ( | void | ) |
void testSPS_GetChannelFeedbackChannelLow | ( | void | ) |
void testSPS_GetChannelFeedbackInvalidChannelIndex | ( | void | ) |
void testSPS_GetChannelPexFeedback | ( | void | ) |
test the states of PEX feedback function
Definition at line 499 of file test_sps.c.
void testSPS_RequestChannelStateInvalidFunction | ( | void | ) |
void testSPS_RequestChannelStateInvalidIndex | ( | void | ) |
void testSPS_RequestChannelStateSwitchOn | ( | void | ) |
void testSPS_RequestContactorStateCorrectAffiliation | ( | void | ) |
void testSPS_RequestContactorStateWrongAffiliation | ( | void | ) |
void testSPS_RequestContactorStateWrongIndex | ( | void | ) |
void testSPS_RequestGeneralIOStateWrongAffiliation | ( | void | ) |
void testSPS_RequestGeneralIOStateWrongIndex | ( | void | ) |
void testSPS_RequestGIOStateCorrectAffiliation | ( | void | ) |
|
static |
SPI data configuration struct for SPS communication
Definition at line 75 of file test_sps.c.
SPI_INTERFACE_CONFIG_s spi_spsInterface |
SPI interface configuration for SPS communication
Definition at line 84 of file test_sps.c.
SPS_CHANNEL_STATE_s sps_channelStatus[SPS_NR_OF_AVAILABLE_SPS_CHANNELS] |
channel states
Definition at line 92 of file test_sps.c.
const SPS_CHANNEL_FEEDBACK_MAPPING_s sps_kChannelFeedbackMapping[SPS_NR_OF_AVAILABLE_SPS_CHANNELS] |
mapping of channel states to feedback pins
Definition at line 103 of file test_sps.c.