Midnight Sun Firmware
Loading...
Searching...
No Matches
test_helpers.h
1#pragma once
2
3/************************************************************************************************
4 * @file test_helpers.h
5 *
6 * @brief Unity test framework helper library
7 *
8 * @date 2024-10-27
9 * @author Midnight Sun Team #24 - MSXVI
10 ************************************************************************************************/
11
12/* Standard library Headers */
13
14/* Inter-component Headers */
15
16/* Intra-component Headers */
17#include "status.h"
18#include "unity.h"
19
26// General use:
27#define TEST_ASSERT_OK(code) TEST_ASSERT_EQUAL(STATUS_CODE_OK, (code))
28#define TEST_ASSERT_NOT_OK(code) TEST_ASSERT_NOT_EQUAL(STATUS_CODE_OK, (code))
29
30// Mocking
31#define TEST_MOCK(func) __attribute__((used)) __wrap_##func
32
33// Parameterized tests, see test_parameterized.c for usage examples
34#define TEST_CASE(...)
35
36#ifndef TEST_PRE_TASK
37// define in-task/pre-task tests
38#define TEST_PRE_TASK
39#define TEST_IN_TASK
40#endif
41