foxBMS - Unit Tests
1.5.0
The foxBMS Unit Tests API Documentation
|
Tests for the sys_mon module. More...
#include "unity.h"
#include "Mockdiag.h"
#include "Mockfram.h"
#include "Mockfram_cfg.h"
#include "Mockos.h"
#include "Mocksys_mon_cfg.h"
#include "fassert.h"
#include "sys_mon.h"
#include "test_assert_helper.h"
#include <stdbool.h>
#include <stdint.h>
Go to the source code of this file.
Macros | |
#define | DUMMY_TASK_ID_0 (0) |
#define | DUMMY_TASK_ID_1 (1) |
#define | DUMMY_TASK_ID_2 (2) |
#define | DUMMY_CYCLE_TIME (10) |
#define | DUMMY_MAX_JITTER (1) |
Functions | |
void | TEST_SYSM_DummyCallback_0 (SYSM_TASK_ID_e taskId) |
void | TEST_SYSM_DummyCallback_1 (SYSM_TASK_ID_e taskId) |
void | TEST_SYSM_DummyCallback_2 (SYSM_TASK_ID_e taskId) |
void | setUp (void) |
void | tearDown (void) |
void | testSYSM_CheckNotificationsEarlyExitOnTimestampEquality (void) |
void | testSYSM_CheckNotificationsSYSMDisabled (void) |
void | testSYSM_CheckNotificationsProvokeDurationViolation (void) |
void | testSYSM_CheckNotificationsProvokeDurationViolationWithRecording (void) |
void | testSYSM_NotifyInvalidTaskID (void) |
void | testSYSM_NotifyEnterTimestampProperlySet (void) |
void | testSYSM_NotifyExitTimestampProperlySetAndDurationCalculated (void) |
void | testSYSM_NotifyHitAssertWithIllegalNotifyType (void) |
void | testSYSM_GetRecordedTimingViolations (void) |
void | testSYSM_CopyFramStructInvalidInput (void) |
void | testSYSM_CopyFramStruct (void) |
Variables | |
SYSM_MONITORING_CFG_s | sysm_ch_cfg [3] |
FRAM_SYS_MON_RECORD_s | fram_sys_mon_record = {0} |
Tests for the sys_mon module.
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_sys_mon.c.
#define DUMMY_CYCLE_TIME (10) |
Definition at line 74 of file test_sys_mon.c.
#define DUMMY_MAX_JITTER (1) |
Definition at line 75 of file test_sys_mon.c.
#define DUMMY_TASK_ID_0 (0) |
Definition at line 71 of file test_sys_mon.c.
#define DUMMY_TASK_ID_1 (1) |
Definition at line 72 of file test_sys_mon.c.
#define DUMMY_TASK_ID_2 (2) |
Definition at line 73 of file test_sys_mon.c.
void setUp | ( | void | ) |
void tearDown | ( | void | ) |
Definition at line 142 of file test_sys_mon.c.
void TEST_SYSM_DummyCallback_0 | ( | SYSM_TASK_ID_e | taskId | ) |
Definition at line 77 of file test_sys_mon.c.
void TEST_SYSM_DummyCallback_1 | ( | SYSM_TASK_ID_e | taskId | ) |
Definition at line 81 of file test_sys_mon.c.
void TEST_SYSM_DummyCallback_2 | ( | SYSM_TASK_ID_e | taskId | ) |
Definition at line 85 of file test_sys_mon.c.
void testSYSM_CheckNotificationsEarlyExitOnTimestampEquality | ( | void | ) |
void testSYSM_CheckNotificationsProvokeDurationViolation | ( | void | ) |
void testSYSM_CheckNotificationsProvokeDurationViolationWithRecording | ( | void | ) |
same test as testSYSM_CheckNotificationsProvokeDurationViolation() but with recording enabled
Definition at line 188 of file test_sys_mon.c.
void testSYSM_CheckNotificationsSYSMDisabled | ( | void | ) |
void testSYSM_CopyFramStruct | ( | void | ) |
test copy function of SYSM_CopyFramStruct()
Definition at line 298 of file test_sys_mon.c.
void testSYSM_CopyFramStructInvalidInput | ( | void | ) |
test SYSM_CopyFramStruct() and its reaction to invalid input
Definition at line 291 of file test_sys_mon.c.
void testSYSM_GetRecordedTimingViolations | ( | void | ) |
test the edge cases of the function that can return recorded violations
Definition at line 264 of file test_sys_mon.c.
void testSYSM_NotifyEnterTimestampProperlySet | ( | void | ) |
void testSYSM_NotifyExitTimestampProperlySetAndDurationCalculated | ( | void | ) |
void testSYSM_NotifyHitAssertWithIllegalNotifyType | ( | void | ) |
void testSYSM_NotifyInvalidTaskID | ( | void | ) |
FRAM_SYS_MON_RECORD_s fram_sys_mon_record = {0} |
placeholder variable for the FRAM entry of sys mon
Definition at line 114 of file test_sys_mon.c.
SYSM_MONITORING_CFG_s sysm_ch_cfg[3] |
diag system monitoring struct
Definition at line 89 of file test_sys_mon.c.