Mercurial > hg > th-libs
comparison tests.c @ 291:886a42023415
Cosmetics.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 22 Feb 2016 16:00:55 +0200 |
parents | 56b0de9f9d44 |
children | 146cfd1dc744 |
comparison
equal
deleted
inserted
replaced
276:56b0de9f9d44 | 291:886a42023415 |
---|---|
3 #include "th_util.h" | 3 #include "th_util.h" |
4 #include "th_string.h" | 4 #include "th_string.h" |
5 #include "th_crypto.h" | 5 #include "th_crypto.h" |
6 | 6 |
7 #define SET_BUF_SIZE 128 | 7 #define SET_BUF_SIZE 128 |
8 | 8 #define SET_SENTINEL_BYTE 0x0e5 |
9 | |
10 | |
11 // Globals | |
9 char *test_str_header = NULL, | 12 char *test_str_header = NULL, |
10 *test_str_res = NULL; | 13 *test_str_res = NULL; |
11 | 14 |
12 int tests_failed, tests_passed, tests_total, tests_set; | 15 int tests_failed, tests_passed, tests_total, tests_set; |
13 | 16 |
109 { | 112 { |
110 test_result_msg_v(check, NULL, NULL); | 113 test_result_msg_v(check, NULL, NULL); |
111 } | 114 } |
112 | 115 |
113 | 116 |
114 #define SET_SENTINEL_BYTE 0x0e5 | |
115 | 117 |
116 void test_snprintf_do(size_t len, const char *fmt, va_list ap, const char *msg) | 118 void test_snprintf_do(size_t len, const char *fmt, va_list ap, const char *msg) |
117 { | 119 { |
118 int ret1, ret2; | 120 int ret1, ret2; |
119 va_list tmp; | 121 va_list tmp; |
151 va_copy(tmp, ap); test_snprintf_do(1, fmt, tmp, "1"); | 153 va_copy(tmp, ap); test_snprintf_do(1, fmt, tmp, "1"); |
152 va_copy(tmp, ap); test_snprintf_do(2, fmt, tmp, "2"); | 154 va_copy(tmp, ap); test_snprintf_do(2, fmt, tmp, "2"); |
153 va_copy(tmp, ap); test_snprintf_do(16, fmt, tmp, "16"); | 155 va_copy(tmp, ap); test_snprintf_do(16, fmt, tmp, "16"); |
154 va_copy(tmp, ap); test_snprintf_do(SET_BUF_SIZE, fmt, tmp, "SET_BUF_SIZE"); | 156 va_copy(tmp, ap); test_snprintf_do(SET_BUF_SIZE, fmt, tmp, "SET_BUF_SIZE"); |
155 va_end(ap); | 157 va_end(ap); |
156 THPRINT(2, "----------------------------------------------\n"); | 158 THPRINT(2, |
159 "-----------------------------------------------------\n"); | |
157 } | 160 } |
158 | 161 |
159 | 162 |
160 void tests_header(const char *str) | 163 void tests_header(const char *str) |
161 { | 164 { |