foxBMS-UnitTests  1.0.0
The foxBMS Unit Tests API Documentation
test_ftask.c
Go to the documentation of this file.
1 /**
2  *
3  * @copyright © 2010 - 2021, Fraunhofer-Gesellschaft zur Foerderung der
4  * angewandten Forschung e.V. All rights reserved.
5  *
6  * BSD 3-Clause License
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions are met:
9  * 1. Redistributions of source code must retain the above copyright notice,
10  * this list of conditions and the following disclaimer.
11  * 2. Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the distribution.
14  * 3. Neither the name of the copyright holder nor the names of its
15  * contributors may be used to endorse or promote products derived from
16  * this software without specific prior written permission.
17  *
18  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
22  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28  * POSSIBILITY OF SUCH DAMAGE.
29  *
30  * We kindly request you to use one or more of the following phrases to refer
31  * to foxBMS in your hardware, software, documentation or advertising
32  * materials:
33  *
34  * ″This product uses parts of foxBMS®″
35  *
36  * ″This product includes parts of foxBMS®″
37  *
38  * ″This product is derived from foxBMS®″
39  *
40  */
41 
42 /**
43  * @file test_ftask.c
44  * @author foxBMS Team
45  * @date 2020-04-02 (date of creation)
46  * @updated 2020-05-25 (date of last update)
47  * @ingroup UNIT_TEST_IMPLEMENTATION
48  * @prefix TEST
49  *
50  * @brief Test of the ftask module
51  *
52  */
53 
54 /*========== Includes =======================================================*/
55 #include "general.h"
56 
57 #include "unity.h"
58 #include "MockHL_gio.h"
59 #include "Mockadc.h"
60 #include "Mockalgorithm.h"
61 #include "Mockbal.h"
62 #include "Mockbms.h"
63 #include "Mockcan.h"
64 #include "Mockcontactor.h"
65 #include "Mockdatabase.h"
66 #include "Mockdiag.h"
67 #include "Mockdiag_cfg.h"
68 #include "Mockfram.h"
69 #include "Mockimd.h"
70 #include "Mockinterlock.h"
71 #include "Mockmeas.h"
72 #include "Mockmic.h"
73 #include "Mockmpu_prototypes.h"
74 #include "Mockos.h"
75 #include "Mockredundancy.h"
76 #include "Mocksbc.h"
77 #include "Mocksof.h"
78 #include "Mocksps.h"
79 #include "Mockstate_estimation.h"
80 #include "Mocksys.h"
81 #include "Mocksys_mon.h"
82 
83 #include "ftask_cfg.h"
84 #include "sys_mon_cfg.h"
85 
86 #include "fassert.h"
87 #include "ftask.h"
88 
89 /*========== Definitions and Implementations for Unit Test ==================*/
91 volatile OS_TIMER_s os_timer = {0, 0, 0, 0, 0, 0, 0};
92 uint32_t os_schedulerStartTime = 0;
93 uint32_t fram_voltage = 0u;
96 
98 
99 QueueHandle_t imd_canDataQueue = NULL_PTR;
100 StaticQueue_t imd_queueStructure = {0};
102 
103 /*========== Setup and Teardown =============================================*/
104 void setUp(void) {
105 }
106 
107 void tearDown(void) {
108 }
109 
110 void testDummy(void) {
111 }
112 
113 /*========== Test Cases =====================================================*/
general.h
TODO.
fassert.h
Assert macro implementation.
sys_state
SYS_STATE_s sys_state
Definition: test_ftask.c:97
OS_OFF
@ OS_OFF
Definition: os.h:91
IMD_QUEUE_ITEM_SIZE
#define IMD_QUEUE_ITEM_SIZE
Definition: imd.h:68
fram_soc
FRAM_SOC_s fram_soc
Definition: test_ftask.c:94
SYS_STATE
Definition: sys.h:161
imd_queueStorageArea
uint8_t imd_queueStorageArea[IMD_QUEUE_LENGTH *IMD_QUEUE_ITEM_SIZE]
size of Queue storage
Definition: test_ftask.c:101
ftask_cfg.h
Task configuration header.
IMD_QUEUE_LENGTH
#define IMD_QUEUE_LENGTH
Definition: imd.h:66
FRAM_SOC
Definition: fram_cfg.h:119
ftask.h
Header of task driver implementation.
os_schedulerStartTime
uint32_t os_schedulerStartTime
Scheduler "zero" time for task phase control.
Definition: test_ftask.c:92
testDummy
void testDummy(void)
Definition: test_ftask.c:110
sbc_stateMcuSupervisor
SBC_STATE_s sbc_stateMcuSupervisor
Definition: test_ftask.c:95
os_timer
volatile OS_TIMER_s os_timer
Definition: test_ftask.c:91
imd_canDataQueue
QueueHandle_t imd_canDataQueue
Definition: test_ftask.c:99
os_boot
volatile OS_BOOT_STATE_e os_boot
Definition: test_ftask.c:90
SBC_STATE
Definition: sbc.h:154
imd_queueStructure
StaticQueue_t imd_queueStructure
Definition: test_ftask.c:100
OS_TIMER
OS timer.
Definition: os.h:107
NULL_PTR
#define NULL_PTR
Null pointer.
Definition: fstd_types.h:66
fram_voltage
uint32_t fram_voltage
Definition: test_ftask.c:93
OS_BOOT_STATE_e
enum OS_BOOT_STATE OS_BOOT_STATE_e
enum of OS boot states
tearDown
void tearDown(void)
Definition: test_ftask.c:107
sys_mon_cfg.h
TODO.
setUp
void setUp(void)
Definition: test_ftask.c:104