-
Notifications
You must be signed in to change notification settings - Fork 163
/
Copy pathtest1.c
34 lines (30 loc) · 836 Bytes
/
test1.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include "header.h"
#include "unity.h"
void setUp(void) {
}
void tearDown(void) {
}
/*!
@brief zero input test
@par Details
This test checks that zero input to free_fun() produces zero array.
*/
void TUN_PRJ_free_fun_00(void) {
uint8_t const *result = free_fun(0U);
TEST_ASSERT_EQUAL_UINT8(0, result[0]);
TEST_ASSERT_EQUAL_UINT8(0, result[1]);
TEST_ASSERT_EQUAL_UINT8(0, result[2]);
TEST_ASSERT_EQUAL_UINT8(0, result[3]);
}
/*!
@brief non-zero input
@par Details
This test checks that non-zero input to free_fun() produces expected array.
*/
void TUN_PRJ_free_fun_01(void) {
uint8_t const* result = free_fun(0x1A2B3C4CU);
TEST_ASSERT_EQUAL_UINT8(0x1A, result[0]);
TEST_ASSERT_EQUAL_UINT8(0x2B, result[1]);
TEST_ASSERT_EQUAL_UINT8(0x3C, result[2]);
TEST_ASSERT_EQUAL_UINT8(0x4D, result[3]);
}