Changeset 5ebff60 for tests/check_md5.c
- Timestamp:
- 2015-02-20T22:50:54Z (9 years ago)
- Branches:
- master
- Children:
- 0b9daac, 3d45471, 7733b8c
- Parents:
- af359b4
- git-author:
- Indent <please@…> (19-02-15 05:47:20)
- git-committer:
- dequis <dx@…> (20-02-15 22:50:54)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/check_md5.c
raf359b4 r5ebff60 12 12 md5_byte_t expected[16]; 13 13 } tests[] = { 14 { "", 15 14 { "", 15 { 0xd4, 0x1d, 0x8c, 0xd9, 0x8f, 0x00, 0xb2, 0x04, 0xe9, 0x80, 0x09, 0x98, 0xec, 0xf8, 0x42, 0x7e } }, 16 16 { "a", 17 18 { "abc", 19 20 { "message digest", 21 22 { "abcdefghijklmnopqrstuvwxyz", 23 17 { 0x0c, 0xc1, 0x75, 0xb9, 0xc0, 0xf1, 0xb6, 0xa8, 0x31, 0xc3, 0x99, 0xe2, 0x69, 0x77, 0x26, 0x61 } }, 18 { "abc", 19 { 0x90, 0x01, 0x50, 0x98, 0x3c, 0xd2, 0x4f, 0xb0, 0xd6, 0x96, 0x3f, 0x7d, 0x28, 0xe1, 0x7f, 0x72 } }, 20 { "message digest", 21 { 0xf9, 0x6b, 0x69, 0x7d, 0x7c, 0xb7, 0x93, 0x8d, 0x52, 0x5a, 0x2f, 0x31, 0xaa, 0xf1, 0x61, 0xd0 } }, 22 { "abcdefghijklmnopqrstuvwxyz", 23 { 0xc3, 0xfc, 0xd3, 0xd7, 0x61, 0x92, 0xe4, 0x00, 0x7d, 0xfb, 0x49, 0x6c, 0xca, 0x67, 0xe1, 0x3b } }, 24 24 { "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", 25 26 { "12345678901234567890123456789012345678901234567890123456789012345678901234567890", 27 25 { 0xd1, 0x74, 0xab, 0x98, 0xd2, 0x77, 0xd9, 0xf5, 0xa5, 0x61, 0x1c, 0x2c, 0x9f, 0x41, 0x9d, 0x9f } }, 26 { "12345678901234567890123456789012345678901234567890123456789012345678901234567890", 27 { 0x57, 0xed, 0xf4, 0xa2, 0x2b, 0xe3, 0xc9, 0x55, 0xac, 0x49, 0xda, 0x2e, 0x21, 0x07, 0xb6, 0x7a } }, 28 28 29 29 { NULL }, … … 33 33 { 34 34 int i; 35 35 36 for (i = 0; tests[i].str; i++) { 36 37 md5_byte_t sum[16]; 37 tcase_fn_start(tests[i].str, __FILE__, __LINE__);38 tcase_fn_start(tests[i].str, __FILE__, __LINE__); 38 39 md5_state_t state; 39 40 40 41 md5_init(&state); 41 md5_append(&state, (const md5_byte_t *) tests[i].str, strlen(tests[i].str));42 md5_append(&state, (const md5_byte_t *) tests[i].str, strlen(tests[i].str)); 42 43 md5_finish(&state, sum); 43 44 … … 46 47 } 47 48 48 Suite *md5_suite 49 Suite *md5_suite(void) 49 50 { 50 51 Suite *s = suite_create("MD5"); 51 52 TCase *tc_core = tcase_create("Core"); 52 suite_add_tcase (s, tc_core); 53 tcase_add_test (tc_core, check_sums); 53 54 suite_add_tcase(s, tc_core); 55 tcase_add_test(tc_core, check_sums); 54 56 return s; 55 57 }
Note: See TracChangeset
for help on using the changeset viewer.