diff options
author | Marc <foxtrot@malloc.me> | 2021-12-17 18:52:36 +0000 |
---|---|---|
committer | Marc <foxtrot@malloc.me> | 2021-12-17 19:31:25 +0000 |
commit | cd1df65dc36ac35d526de195284d5ebf18e1f92b (patch) | |
tree | fc0c163cd9f86d452fec1eb90d48a22d67cf4256 /test/src/helpers.c | |
parent | 8e09d29df19312583747a3de00fe4269c17e6586 (diff) | |
download | libwifi-cd1df65dc36ac35d526de195284d5ebf18e1f92b.tar.gz libwifi-cd1df65dc36ac35d526de195284d5ebf18e1f92b.tar.bz2 libwifi-cd1df65dc36ac35d526de195284d5ebf18e1f92b.zip |
test: Add ctests for generation functions.
This commit also enforces error code checking on functions inside of the generation functions, such as for `libwifi_quick_add_tag`.
Diffstat (limited to 'test/src/helpers.c')
-rw-r--r-- | test/src/helpers.c | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/test/src/helpers.c b/test/src/helpers.c deleted file mode 100644 index 9fc9d0b..0000000 --- a/test/src/helpers.c +++ /dev/null | |||
@@ -1,31 +0,0 @@ | |||
1 | #include "helpers.h" | ||
2 | #include <stdio.h> | ||
3 | |||
4 | void hexdump(void *data, size_t size) { | ||
5 | char ascii[17]; | ||
6 | size_t i, j; | ||
7 | ascii[16] = '\0'; | ||
8 | for (i = 0; i < size; ++i) { | ||
9 | printf("%02X ", ((unsigned char *) data)[i]); | ||
10 | if (((unsigned char *) data)[i] >= ' ' && ((unsigned char *) data)[i] <= '~') { | ||
11 | ascii[i % 16] = ((unsigned char *) data)[i]; | ||
12 | } else { | ||
13 | ascii[i % 16] = '.'; | ||
14 | } | ||
15 | if ((i + 1) % 8 == 0 || i + 1 == size) { | ||
16 | printf(" "); | ||
17 | if ((i + 1) % 16 == 0) { | ||
18 | printf("| %s \n", ascii); | ||
19 | } else if (i + 1 == size) { | ||
20 | ascii[(i + 1) % 16] = '\0'; | ||
21 | if ((i + 1) % 16 <= 8) { | ||
22 | printf(" "); | ||
23 | } | ||
24 | for (j = (i + 1) % 16; j < 16; ++j) { | ||
25 | printf(" "); | ||
26 | } | ||
27 | printf("| %s \n", ascii); | ||
28 | } | ||
29 | } | ||
30 | } | ||
31 | } | ||