-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_asserts.h
67 lines (53 loc) · 1.92 KB
/
test_asserts.h
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#ifndef TEST_ASSERTS_H_INCLUDED
#define TEST_ASSERTS_H_INCLUDED
#include <stdint.h>
#define ASSERT_SEQUENCE(EXPECTED_VALUES, ACTUAL_VALUES, COUNT) \
assert_sequence((EXPECTED_VALUES), \
(ACTUAL_VALUES), \
(COUNT), \
__FILE__, \
__LINE__)
#define ASSERT_RANDOM_SEQUENCE(RND, \
INCLUSIVE_LOWER_BOUND, \
INCLUSIVE_UPPER_BOUND, \
EXPECTED_VALUES, \
COUNT) \
assert_random_sequence((RND), \
(INCLUSIVE_LOWER_BOUND), \
(INCLUSIVE_UPPER_BOUND), \
(EXPECTED_VALUES), \
(COUNT), \
__FILE__, \
__LINE__)
#define ASSERT_IN_RANGE(RND, INCLUSIVE_LOWER_BOUND, \
INCLUSIVE_UPPER_BOUND, \
COUNT) \
assert_in_range((RND), \
(INCLUSIVE_LOWER_BOUND), \
(INCLUSIVE_UPPER_BOUND), \
(COUNT), \
__FILE__, \
__LINE__)
struct rnd;
void
assert_sequence(uint32_t *expected_values,
uint32_t *actual_values,
int count,
char const *file,
int line);
void
assert_random_sequence(struct rnd *rnd,
uint32_t inclusive_lower_bound,
uint32_t inclusive_upper_bound,
uint32_t *expected_values,
int count,
char const *file,
int line);
void
assert_in_range(struct rnd *rnd,
uint32_t inclusive_lower_bound,
uint32_t inclusive_upper_bound,
int count,
char const *file,
int line);
#endif