2018-10-18 21:57:26 +03:00
|
|
|
#include "tests.h"
|
|
|
|
|
|
|
|
MunitTest md5_tests[] = {
|
2018-10-21 20:46:05 +03:00
|
|
|
IT("/init_ctx", should_init_ctx, NULL, NULL, 0, NULL),
|
2018-10-20 20:56:18 +03:00
|
|
|
IT("/updates_ctx_count", update_should_change_count, NULL, NULL, 0, NULL),
|
|
|
|
IT("/decode_string_to_int", decode_string_to_int, NULL, NULL, 0, NULL),
|
|
|
|
IT("/encode_bits_to_string", encode_bits_to_string, NULL, NULL, 0, NULL),
|
|
|
|
IT("/encode_register", encode_register, NULL, NULL, 0, NULL),
|
|
|
|
IT("/creates_digest", create_digest, NULL, NULL, 0, NULL),
|
|
|
|
IT("/creates_string", create_string, NULL, NULL, 0, NULL),
|
2018-10-18 21:57:26 +03:00
|
|
|
END_IT
|
|
|
|
};
|
|
|
|
|
2018-10-21 20:46:05 +03:00
|
|
|
MunitTest sha_tests[] = {
|
|
|
|
IT("/init_ctx", should_init_ctx_sha256, NULL, NULL, 0, NULL),
|
|
|
|
IT("/decode_string", decode_string_to_int_sha256, NULL, NULL, 0, NULL),
|
|
|
|
IT("/encode_len", encode_len_to_string_sha256, NULL, NULL, 0, NULL),
|
|
|
|
IT("/enc_register", encode_register_to_string_sha256, NULL, NULL, 0, NULL),
|
|
|
|
IT("/update_bit_count", update_bit_count_sha256, NULL, NULL, 0, NULL),
|
|
|
|
IT("/fill_buffer", fill_buffer_sha256, NULL, NULL, 0, NULL),
|
|
|
|
IT("/add_right_padding", add_right_padding_sha256, NULL, NULL, 0, NULL),
|
|
|
|
IT("/compute_digest", compute_digest_sha256, NULL, NULL, 0, NULL),
|
|
|
|
IT("/creates_string", create_digest_string_sha256, NULL, NULL, 0, NULL),
|
|
|
|
END_IT};
|
|
|
|
|
|
|
|
static const MunitSuite ft_ssl_suites[] = {
|
|
|
|
{
|
|
|
|
(char *)"/md5_suite", /* name */
|
|
|
|
md5_tests, /* tests */
|
|
|
|
NULL, /* suites */
|
|
|
|
1, /* iterations */
|
|
|
|
MUNIT_SUITE_OPTION_NONE /* options */
|
|
|
|
},
|
|
|
|
{
|
|
|
|
(char *)"/sha_suite", /* name */
|
|
|
|
sha_tests, /* tests */
|
|
|
|
NULL, /* suites */
|
|
|
|
1, /* iterations */
|
|
|
|
MUNIT_SUITE_OPTION_NONE /* options */
|
|
|
|
},
|
|
|
|
{NULL, NULL, NULL, 0, MUNIT_SUITE_OPTION_NONE}
|
|
|
|
};
|
|
|
|
|
|
|
|
static const MunitSuite main_suite = {
|
|
|
|
(char *)"/ft_ssl", /* name */
|
|
|
|
NULL, /* tests */
|
|
|
|
(MunitSuite *)ft_ssl_suites, /* suites */
|
2018-10-18 21:57:26 +03:00
|
|
|
1, /* iterations */
|
2018-10-21 20:46:05 +03:00
|
|
|
MUNIT_SUITE_OPTION_NONE /* options */
|
2018-10-18 21:57:26 +03:00
|
|
|
};
|
|
|
|
|
2018-10-21 20:46:05 +03:00
|
|
|
int main(int argc, char **argv)
|
2018-10-18 21:57:26 +03:00
|
|
|
{
|
2018-10-21 20:46:05 +03:00
|
|
|
return munit_suite_main(&main_suite, NULL, argc, argv);
|
2018-10-18 21:57:26 +03:00
|
|
|
}
|