summaryrefslogtreecommitdiff
path: root/auto_tests/crypto_test.c
diff options
context:
space:
mode:
Diffstat (limited to 'auto_tests/crypto_test.c')
-rw-r--r--auto_tests/crypto_test.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/auto_tests/crypto_test.c b/auto_tests/crypto_test.c
index 09b5a982..9d3e2e82 100644
--- a/auto_tests/crypto_test.c
+++ b/auto_tests/crypto_test.c
@@ -190,7 +190,7 @@ START_TEST(test_endtoend)
190 c4len = encrypt_data_fast(k2, n, m, mlen, c4); 190 c4len = encrypt_data_fast(k2, n, m, mlen, c4);
191 191
192 ck_assert_msg(c1len == c2len && c1len == c3len && c1len == c4len, "cyphertext lengths differ"); 192 ck_assert_msg(c1len == c2len && c1len == c3len && c1len == c4len, "cyphertext lengths differ");
193 ck_assert_msg(c1len == mlen + ENCRYPTION_PADDING, "wrong cyphertext length"); 193 ck_assert_msg(c1len == mlen + (int)ENCRYPTION_PADDING, "wrong cyphertext length");
194 ck_assert_msg(memcmp(c1, c2, c1len) == 0 && memcmp(c1, c3, c1len) == 0 194 ck_assert_msg(memcmp(c1, c2, c1len) == 0 && memcmp(c1, c3, c1len) == 0
195 && memcmp(c1, c4, c1len) == 0, "crypertexts differ"); 195 && memcmp(c1, c4, c1len) == 0, "crypertexts differ");
196 196
@@ -251,13 +251,17 @@ END_TEST
251 tcase_add_test(NAME, test_##NAME); \ 251 tcase_add_test(NAME, test_##NAME); \
252 suite_add_tcase(s, NAME); 252 suite_add_tcase(s, NAME);
253 253
254#define DEFTESTCASE_SLOW(NAME, TIMEOUT) \
255 DEFTESTCASE(NAME) \
256 tcase_set_timeout(NAME, TIMEOUT);
257
254Suite *crypto_suite(void) 258Suite *crypto_suite(void)
255{ 259{
256 Suite *s = suite_create("Crypto"); 260 Suite *s = suite_create("Crypto");
257 261
258 DEFTESTCASE(known); 262 DEFTESTCASE(known);
259 DEFTESTCASE(fast_known); 263 DEFTESTCASE(fast_known);
260 DEFTESTCASE(endtoend); 264 DEFTESTCASE_SLOW(endtoend, 15); /* waiting up to 15 seconds */
261 DEFTESTCASE(large_data); 265 DEFTESTCASE(large_data);
262 266
263 return s; 267 return s;