summaryrefslogtreecommitdiff
path: root/auto_tests/crypto_test.c
diff options
context:
space:
mode:
authorCoren[m] <Break@Ocean>2013-09-16 23:02:38 +0200
committerCoren[m] <Break@Ocean>2013-09-16 23:02:38 +0200
commit0de40d01cbc7acd96429f75a89e8bdf6b61464a5 (patch)
tree8567796e294b69512a28a00840602a650b79e8b9 /auto_tests/crypto_test.c
parent1d2f4465bf634f45704eb69791c45bd623154909 (diff)
Make test "endtoend" pass on 'slow' systems
auto_test/crypto_test.c: - test "endtoend": increased timeout from default ~5s to 15s, making it pass on slower systems - signed/unsiged warning fixed by cast
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;