Add test for hamming
This commit is contained in:
parent
6d471d2137
commit
b1c777d1ea
1 changed files with 10 additions and 0 deletions
10
tests/main.c
10
tests/main.c
|
@ -59,6 +59,15 @@ static MunitResult test_frequency_score(const MunitParameter params[],
|
||||||
return MUNIT_OK;
|
return MUNIT_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static MunitResult test_hamming(const MunitParameter params[], void *data) {
|
||||||
|
(void)params;
|
||||||
|
(void)data;
|
||||||
|
|
||||||
|
assert_int(hamming("this is a test", "wokka wokka!!!"), ==, 37);
|
||||||
|
|
||||||
|
return MUNIT_OK;
|
||||||
|
}
|
||||||
|
|
||||||
static MunitTest test_suite_tests[] = {
|
static MunitTest test_suite_tests[] = {
|
||||||
{"/hex_to_byte", test_hex_to_byte, NULL, NULL, MUNIT_TEST_OPTION_NONE,
|
{"/hex_to_byte", test_hex_to_byte, NULL, NULL, MUNIT_TEST_OPTION_NONE,
|
||||||
NULL},
|
NULL},
|
||||||
|
@ -66,6 +75,7 @@ static MunitTest test_suite_tests[] = {
|
||||||
NULL},
|
NULL},
|
||||||
{"/frequency_score", test_frequency_score, NULL, NULL,
|
{"/frequency_score", test_frequency_score, NULL, NULL,
|
||||||
MUNIT_TEST_OPTION_NONE, NULL},
|
MUNIT_TEST_OPTION_NONE, NULL},
|
||||||
|
{"/hamming", test_hamming, NULL, NULL, MUNIT_TEST_OPTION_NONE, NULL},
|
||||||
{NULL, NULL, NULL, NULL, MUNIT_TEST_OPTION_NONE, NULL}};
|
{NULL, NULL, NULL, NULL, MUNIT_TEST_OPTION_NONE, NULL}};
|
||||||
|
|
||||||
static const MunitSuite test_suite = {(char *)"", test_suite_tests, NULL, 1,
|
static const MunitSuite test_suite = {(char *)"", test_suite_tests, NULL, 1,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue