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
46
52
57uint8_t test_helpers_end_get_semphr(void);
58
65
72
79
86
uint8_t test_helpers_end_get_semphr(void)
Gets the semaphore for the test end.
Definition: test_helpers.c:38
void test_helpers_init_semphr(void)
Initializes test start and end semaphores.
Definition: test_helpers.c:29
StatusCode test_helpers_start_give_semphr(void)
Gives the test start semaphore.
Definition: test_helpers.c:42
StatusCode test_helpers_end_take_semphr(void)
Takes the test end semaphore.
Definition: test_helpers.c:66
StatusCode test_helpers_start_take_semphr(void)
Takes the test start semaphore.
Definition: test_helpers.c:58
StatusCode test_helpers_end_give_semphr(void)
Gives the test end semaphore.
Definition: test_helpers.c:50
uint8_t test_helpers_start_get_semphr(void)
Gets the semaphore for the test start.
Definition: test_helpers.c:34
StatusCode
StatusCodes for various errors.
Definition: status.h:27