diff options
author | Indent <please@skip.me> | 2015-02-19 02:47:20 -0300 |
---|---|---|
committer | dequis <dx@dxzone.com.ar> | 2015-02-20 19:50:54 -0300 |
commit | 5ebff60479fc7a9f7f50ac03b124c91d4e6ebe11 (patch) | |
tree | 9fc0d50cb1f4bc9768d9f00de94eafd876bb55b0 /tests/check_arc.c | |
parent | af359b4316f9d392c6b752495a1b2ed631576ed8 (diff) |
Reindent everything to K&R style with tabs
Used uncrustify, with the configuration file in ./doc/uncrustify.cfg
Commit author set to "Indent <please@skip.me>" so that it's easier to
skip while doing git blame.
Diffstat (limited to 'tests/check_arc.c')
-rw-r--r-- | tests/check_arc.c | 66 |
1 files changed, 32 insertions, 34 deletions
diff --git a/tests/check_arc.c b/tests/check_arc.c index e9e7d382..9fcd4b25 100644 --- a/tests/check_arc.c +++ b/tests/check_arc.c @@ -20,27 +20,25 @@ char *clear_tests[] = static void check_codec(int l) { int i; - - for( i = 0; clear_tests[i]; i++ ) - { - tcase_fn_start (clear_tests[i], __FILE__, __LINE__); + + for (i = 0; clear_tests[i]; i++) { + tcase_fn_start(clear_tests[i], __FILE__, __LINE__); unsigned char *crypted; char *decrypted; int len; - - len = arc_encode( clear_tests[i], 0, &crypted, password, 12 ); - len = arc_decode( crypted, len, &decrypted, password ); - - fail_if( strcmp( clear_tests[i], decrypted ) != 0, - "%s didn't decrypt back properly", clear_tests[i] ); - - g_free( crypted ); - g_free( decrypted ); + + len = arc_encode(clear_tests[i], 0, &crypted, password, 12); + len = arc_decode(crypted, len, &decrypted, password); + + fail_if(strcmp(clear_tests[i], decrypted) != 0, + "%s didn't decrypt back properly", clear_tests[i]); + + g_free(crypted); + g_free(decrypted); } } -struct -{ +struct { unsigned char crypted[30]; int len; char *decrypted; @@ -52,7 +50,7 @@ struct 0xb1, 0x31, 0xc9, 0xdb, 0xf9, 0xaa }, 18, "short pass" }, - + /* Two blocks with padding. */ { { @@ -77,31 +75,31 @@ struct static void check_decod(int l) { int i; - - for( i = 0; decrypt_tests[i].len; i++ ) - { - tcase_fn_start (decrypt_tests[i].decrypted, __FILE__, __LINE__); + + for (i = 0; decrypt_tests[i].len; i++) { + tcase_fn_start(decrypt_tests[i].decrypted, __FILE__, __LINE__); char *decrypted; int len; - - len = arc_decode( decrypt_tests[i].crypted, decrypt_tests[i].len, - &decrypted, password ); - - fail_if( len == -1, - "`%s' didn't decrypt properly", decrypt_tests[i].decrypted ); - fail_if( strcmp( decrypt_tests[i].decrypted, decrypted ) != 0, - "`%s' didn't decrypt properly", decrypt_tests[i].decrypted ); - - g_free( decrypted ); + + len = arc_decode(decrypt_tests[i].crypted, decrypt_tests[i].len, + &decrypted, password); + + fail_if(len == -1, + "`%s' didn't decrypt properly", decrypt_tests[i].decrypted); + fail_if(strcmp(decrypt_tests[i].decrypted, decrypted) != 0, + "`%s' didn't decrypt properly", decrypt_tests[i].decrypted); + + g_free(decrypted); } } -Suite *arc_suite (void) +Suite *arc_suite(void) { Suite *s = suite_create("ArcFour"); TCase *tc_core = tcase_create("Core"); - suite_add_tcase (s, tc_core); - tcase_add_test (tc_core, check_codec); - tcase_add_test (tc_core, check_decod); + + suite_add_tcase(s, tc_core); + tcase_add_test(tc_core, check_codec); + tcase_add_test(tc_core, check_decod); return s; } |