some tests format according to norm
This commit is contained in:
parent
efd7701b78
commit
814dd940b0
3 changed files with 84 additions and 61 deletions
|
@ -1,3 +1,15 @@
|
||||||
|
/* ************************************************************************** */
|
||||||
|
/* */
|
||||||
|
/* ::: :::::::: */
|
||||||
|
/* md5_tests.c :+: :+: :+: */
|
||||||
|
/* +:+ +:+ +:+ */
|
||||||
|
/* By: gtertysh <marvin@42.fr> +#+ +:+ +#+ */
|
||||||
|
/* +#+#+#+#+#+ +#+ */
|
||||||
|
/* Created: 2018/10/23 21:06:22 by gtertysh #+# #+# */
|
||||||
|
/* Updated: 2018/10/23 21:06:33 by gtertysh ### ########.fr */
|
||||||
|
/* */
|
||||||
|
/* ************************************************************************** */
|
||||||
|
|
||||||
#include "tests.h"
|
#include "tests.h"
|
||||||
#include "tests_macros.h"
|
#include "tests_macros.h"
|
||||||
#include "ft_md5.h"
|
#include "ft_md5.h"
|
||||||
|
|
|
@ -1,3 +1,15 @@
|
||||||
|
/* ************************************************************************** */
|
||||||
|
/* */
|
||||||
|
/* ::: :::::::: */
|
||||||
|
/* sha_tests.c :+: :+: :+: */
|
||||||
|
/* +:+ +:+ +:+ */
|
||||||
|
/* By: gtertysh <marvin@42.fr> +#+ +:+ +#+ */
|
||||||
|
/* +#+#+#+#+#+ +#+ */
|
||||||
|
/* Created: 2018/10/23 21:06:43 by gtertysh #+# #+# */
|
||||||
|
/* Updated: 2018/10/23 21:06:44 by gtertysh ### ########.fr */
|
||||||
|
/* */
|
||||||
|
/* ************************************************************************** */
|
||||||
|
|
||||||
#include "tests.h"
|
#include "tests.h"
|
||||||
#include "tests_macros.h"
|
#include "tests_macros.h"
|
||||||
#include "ft_sha.h"
|
#include "ft_sha.h"
|
||||||
|
|
49
t/tests.c
49
t/tests.c
|
@ -1,8 +1,19 @@
|
||||||
|
/* ************************************************************************** */
|
||||||
|
/* */
|
||||||
|
/* ::: :::::::: */
|
||||||
|
/* tests.c :+: :+: :+: */
|
||||||
|
/* +:+ +:+ +:+ */
|
||||||
|
/* By: gtertysh <marvin@42.fr> +#+ +:+ +#+ */
|
||||||
|
/* +#+#+#+#+#+ +#+ */
|
||||||
|
/* Created: 2018/10/23 21:00:24 by gtertysh #+# #+# */
|
||||||
|
/* Updated: 2018/10/23 21:05:47 by gtertysh ### ########.fr */
|
||||||
|
/* */
|
||||||
|
/* ************************************************************************** */
|
||||||
|
|
||||||
#include "tests.h"
|
#include "tests.h"
|
||||||
#include "tests_macros.h"
|
#include "tests_macros.h"
|
||||||
|
|
||||||
|
MunitTest g_md5_tests[] = {
|
||||||
MunitTest md5_tests[] = {
|
|
||||||
IT("/init_ctx", should_init_ctx, NULL, NULL, 0, NULL),
|
IT("/init_ctx", should_init_ctx, NULL, NULL, 0, NULL),
|
||||||
IT("/updates_ctx_count", update_should_change_count, NULL, NULL, 0, NULL),
|
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("/decode_string_to_int", decode_string_to_int, NULL, NULL, 0, NULL),
|
||||||
|
@ -13,7 +24,7 @@ MunitTest md5_tests[] = {
|
||||||
END_IT
|
END_IT
|
||||||
};
|
};
|
||||||
|
|
||||||
MunitTest sha_tests[] = {
|
MunitTest g_sha_tests[] = {
|
||||||
IT("/init_ctx_256", should_init_ctx_sha256, NULL, NULL, 0, NULL),
|
IT("/init_ctx_256", should_init_ctx_sha256, NULL, NULL, 0, NULL),
|
||||||
IT("/init_ctx_224", should_init_ctx_sha224, NULL, NULL, 0, NULL),
|
IT("/init_ctx_224", should_init_ctx_sha224, NULL, NULL, 0, NULL),
|
||||||
IT("/decode_string", decode_string_to_int_sha256, NULL, NULL, 0, NULL),
|
IT("/decode_string", decode_string_to_int_sha256, NULL, NULL, 0, NULL),
|
||||||
|
@ -28,33 +39,21 @@ MunitTest sha_tests[] = {
|
||||||
IT("/creates_string_224", create_digest_string_sha224, NULL, NULL, 0, NULL),
|
IT("/creates_string_224", create_digest_string_sha224, NULL, NULL, 0, NULL),
|
||||||
END_IT};
|
END_IT};
|
||||||
|
|
||||||
static const MunitSuite ft_ssl_suites[] = {
|
static const MunitSuite g_ft_ssl_suites[] = {
|
||||||
{
|
{(char *)"/md5_suite", g_md5_tests, NULL, 1, MUNIT_SUITE_OPTION_NONE},
|
||||||
(char *)"/md5_suite", /* name */
|
{(char *)"/sha_suite", g_sha_tests, NULL, 1, MUNIT_SUITE_OPTION_NONE},
|
||||||
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}
|
{NULL, NULL, NULL, 0, MUNIT_SUITE_OPTION_NONE}
|
||||||
};
|
};
|
||||||
|
|
||||||
static const MunitSuite main_suite = {
|
static const MunitSuite g_main_suite = {
|
||||||
(char *)"/ft_ssl", /* name */
|
(char *)"/ft_ssl",
|
||||||
NULL, /* tests */
|
NULL,
|
||||||
(MunitSuite *)ft_ssl_suites, /* suites */
|
(MunitSuite *)g_ft_ssl_suites,
|
||||||
1, /* iterations */
|
1,
|
||||||
MUNIT_SUITE_OPTION_NONE /* options */
|
MUNIT_SUITE_OPTION_NONE
|
||||||
};
|
};
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
return munit_suite_main(&main_suite, NULL, argc, argv);
|
return (munit_suite_main(&g_main_suite, NULL, argc, argv));
|
||||||
}
|
}
|
Loading…
Reference in a new issue