diff options
28 files changed, 392 insertions, 392 deletions
diff --git a/tests/blogc-git-receiver/check_pre_receive_parser.c b/tests/blogc-git-receiver/check_pre_receive_parser.c index f663f64..0415be1 100644 --- a/tests/blogc-git-receiver/check_pre_receive_parser.c +++ b/tests/blogc-git-receiver/check_pre_receive_parser.c @@ -97,8 +97,8 @@ test_pre_receive_parse(void **state) int main(void) { - const UnitTest tests[] = { - unit_test(test_pre_receive_parse), + const struct CMUnitTest tests[] = { + cmocka_unit_test(test_pre_receive_parse), }; - return run_tests(tests); + return cmocka_run_group_tests(tests, NULL, NULL); } diff --git a/tests/blogc-git-receiver/check_settings.c b/tests/blogc-git-receiver/check_settings.c index cb12037..61cd469 100644 --- a/tests/blogc-git-receiver/check_settings.c +++ b/tests/blogc-git-receiver/check_settings.c @@ -84,8 +84,8 @@ test_settings_get_section(void **state) int main(void) { - const UnitTest tests[] = { - unit_test(test_settings_get_section), + const struct CMUnitTest tests[] = { + cmocka_unit_test(test_settings_get_section), }; - return run_tests(tests); + return cmocka_run_group_tests(tests, NULL, NULL); } diff --git a/tests/blogc-git-receiver/check_shell_command_parser.c b/tests/blogc-git-receiver/check_shell_command_parser.c index 97e7b6e..eafeabb 100644 --- a/tests/blogc-git-receiver/check_shell_command_parser.c +++ b/tests/blogc-git-receiver/check_shell_command_parser.c @@ -208,8 +208,8 @@ test_shell_command_parse(void **state) int main(void) { - const UnitTest tests[] = { - unit_test(test_shell_command_parse), + const struct CMUnitTest tests[] = { + cmocka_unit_test(test_shell_command_parse), }; - return run_tests(tests); + return cmocka_run_group_tests(tests, NULL, NULL); } diff --git a/tests/blogc-make/check_atom.c b/tests/blogc-make/check_atom.c index 6be03d9..e93bc76 100644 --- a/tests/blogc-make/check_atom.c +++ b/tests/blogc-make/check_atom.c @@ -536,17 +536,17 @@ test_atom_legacy_entry_id(void **state) int main(void) { - const UnitTest tests[] = { - unit_test(test_atom_generate_empty_file), - unit_test(test_atom_generate_empty_dir), - unit_test(test_atom_generate_file), - unit_test(test_atom_generate_dir), - unit_test(test_atom_empty_file), - unit_test(test_atom_empty_dir), - unit_test(test_atom_file), - unit_test(test_atom_dir), - unit_test(test_atom_legacy_entry_id_empty), - unit_test(test_atom_legacy_entry_id), + const struct CMUnitTest tests[] = { + cmocka_unit_test(test_atom_generate_empty_file), + cmocka_unit_test(test_atom_generate_empty_dir), + cmocka_unit_test(test_atom_generate_file), + cmocka_unit_test(test_atom_generate_dir), + cmocka_unit_test(test_atom_empty_file), + cmocka_unit_test(test_atom_empty_dir), + cmocka_unit_test(test_atom_file), + cmocka_unit_test(test_atom_dir), + cmocka_unit_test(test_atom_legacy_entry_id_empty), + cmocka_unit_test(test_atom_legacy_entry_id), }; - return run_tests(tests); + return cmocka_run_group_tests(tests, NULL, NULL); } diff --git a/tests/blogc-make/check_exec.c b/tests/blogc-make/check_exec.c index 6812496..6b15423 100644 --- a/tests/blogc-make/check_exec.c +++ b/tests/blogc-make/check_exec.c @@ -304,15 +304,15 @@ test_build_blogc_cmd_print(void **state) int main(void) { - const UnitTest tests[] = { + const struct CMUnitTest tests[] = { #ifndef MAKE_EMBEDDED - unit_test(test_find_binary), + cmocka_unit_test(test_find_binary), #endif - unit_test(test_build_blogc_cmd_with_settings), - unit_test(test_build_blogc_cmd_with_settings_and_dev), - unit_test(test_build_blogc_cmd_with_settings_and_tags), - unit_test(test_build_blogc_cmd_without_settings), - unit_test(test_build_blogc_cmd_print), + cmocka_unit_test(test_build_blogc_cmd_with_settings), + cmocka_unit_test(test_build_blogc_cmd_with_settings_and_dev), + cmocka_unit_test(test_build_blogc_cmd_with_settings_and_tags), + cmocka_unit_test(test_build_blogc_cmd_without_settings), + cmocka_unit_test(test_build_blogc_cmd_print), }; - return run_tests(tests); + return cmocka_run_group_tests(tests, NULL, NULL); } diff --git a/tests/blogc-make/check_rules.c b/tests/blogc-make/check_rules.c index ed2e46a..5da412f 100644 --- a/tests/blogc-make/check_rules.c +++ b/tests/blogc-make/check_rules.c @@ -96,9 +96,9 @@ test_rule_parse_args_error(void **state) int main(void) { - const UnitTest tests[] = { - unit_test(test_rule_parse_args), - unit_test(test_rule_parse_args_error), + const struct CMUnitTest tests[] = { + cmocka_unit_test(test_rule_parse_args), + cmocka_unit_test(test_rule_parse_args_error), }; - return run_tests(tests); + return cmocka_run_group_tests(tests, NULL, NULL); } diff --git a/tests/blogc-make/check_settings.c b/tests/blogc-make/check_settings.c index 7cebedc..d942c45 100644 --- a/tests/blogc-make/check_settings.c +++ b/tests/blogc-make/check_settings.c @@ -348,13 +348,13 @@ test_settings_copy_files(void **state) int main(void) { - const UnitTest tests[] = { - unit_test(test_settings_empty), - unit_test(test_settings), - unit_test(test_settings_env), - unit_test(test_settings2), - unit_test(test_settings_env2), - unit_test(test_settings_copy_files), + const struct CMUnitTest tests[] = { + cmocka_unit_test(test_settings_empty), + cmocka_unit_test(test_settings), + cmocka_unit_test(test_settings_env), + cmocka_unit_test(test_settings2), + cmocka_unit_test(test_settings_env2), + cmocka_unit_test(test_settings_copy_files), }; - return run_tests(tests); + return cmocka_run_group_tests(tests, NULL, NULL); } diff --git a/tests/blogc-make/check_utils.c b/tests/blogc-make/check_utils.c index 5b3614d..09d1580 100644 --- a/tests/blogc-make/check_utils.c +++ b/tests/blogc-make/check_utils.c @@ -460,9 +460,9 @@ test_generate_filename2(void **state) int main(void) { - const UnitTest tests[] = { - unit_test(test_generate_filename), - unit_test(test_generate_filename2), + const struct CMUnitTest tests[] = { + cmocka_unit_test(test_generate_filename), + cmocka_unit_test(test_generate_filename2), }; - return run_tests(tests); + return cmocka_run_group_tests(tests, NULL, NULL); } diff --git a/tests/blogc-runserver/check_httpd_utils.c b/tests/blogc-runserver/check_httpd_utils.c index 3e21e63..9b2c39c 100644 --- a/tests/blogc-runserver/check_httpd_utils.c +++ b/tests/blogc-runserver/check_httpd_utils.c @@ -122,11 +122,11 @@ test_get_extension(void **state) int main(void) { - const UnitTest tests[] = { - unit_test(test_readline), - unit_test(test_hextoi), - unit_test(test_urldecode), - unit_test(test_get_extension), + const struct CMUnitTest tests[] = { + cmocka_unit_test(test_readline), + cmocka_unit_test(test_hextoi), + cmocka_unit_test(test_urldecode), + cmocka_unit_test(test_get_extension), }; - return run_tests(tests); + return cmocka_run_group_tests(tests, NULL, NULL); } diff --git a/tests/blogc-runserver/check_mime.c b/tests/blogc-runserver/check_mime.c index c081b8a..59d7238 100644 --- a/tests/blogc-runserver/check_mime.c +++ b/tests/blogc-runserver/check_mime.c @@ -84,9 +84,9 @@ test_guess_index(void **state) int main(void) { - const UnitTest tests[] = { - unit_test(test_guess_content_type), - unit_test(test_guess_index), + const struct CMUnitTest tests[] = { + cmocka_unit_test(test_guess_content_type), + cmocka_unit_test(test_guess_index), }; - return run_tests(tests); + return cmocka_run_group_tests(tests, NULL, NULL); } diff --git a/tests/blogc/check_content_parser.c b/tests/blogc/check_content_parser.c index 5fa8f06..71f1680 100644 --- a/tests/blogc/check_content_parser.c +++ b/tests/blogc/check_content_parser.c @@ -2735,55 +2735,55 @@ test_content_parse_inline_endash_emdash(void **state) int main(void) { - const UnitTest tests[] = { - unit_test(test_slugify), - unit_test(test_htmlentities), - unit_test(test_fix_description), - unit_test(test_is_ordered_list_item), - unit_test(test_content_parse), - unit_test(test_content_parse_crlf), - unit_test(test_content_parse_with_excerpt), - unit_test(test_content_parse_with_excerpt_crlf), - unit_test(test_content_parse_header), - unit_test(test_content_parse_header_crlf), - unit_test(test_content_parse_html), - unit_test(test_content_parse_html_crlf), - unit_test(test_content_parse_blockquote), - unit_test(test_content_parse_blockquote_crlf), - unit_test(test_content_parse_code), - unit_test(test_content_parse_code_crlf), - unit_test(test_content_parse_horizontal_rule), - unit_test(test_content_parse_horizontal_rule_crlf), - unit_test(test_content_parse_unordered_list), - unit_test(test_content_parse_unordered_list_crlf), - unit_test(test_content_parse_ordered_list), - unit_test(test_content_parse_ordered_list_crlf), - unit_test(test_content_parse_first_header), - unit_test(test_content_parse_first_header_crlf), - unit_test(test_content_parse_headers), - unit_test(test_content_parse_headers_crlf), - unit_test(test_content_parse_description), - unit_test(test_content_parse_description_crlf), - unit_test(test_content_parse_endl), - unit_test(test_content_parse_endl_crlf), - unit_test(test_content_parse_invalid_excerpt), - unit_test(test_content_parse_invalid_header), - unit_test(test_content_parse_invalid_header_empty), - unit_test(test_content_parse_invalid_blockquote), - unit_test(test_content_parse_invalid_code), - unit_test(test_content_parse_invalid_horizontal_rule), - unit_test(test_content_parse_invalid_unordered_list), - unit_test(test_content_parse_invalid_ordered_list), - unit_test(test_content_parse_inline), - unit_test(test_content_parse_inline_em), - unit_test(test_content_parse_inline_strong), - unit_test(test_content_parse_inline_code), - unit_test(test_content_parse_inline_link), - unit_test(test_content_parse_inline_link_auto), - unit_test(test_content_parse_inline_image), - unit_test(test_content_parse_inline_line_break), - unit_test(test_content_parse_inline_line_break_crlf), - unit_test(test_content_parse_inline_endash_emdash), + const struct CMUnitTest tests[] = { + cmocka_unit_test(test_slugify), + cmocka_unit_test(test_htmlentities), + cmocka_unit_test(test_fix_description), + cmocka_unit_test(test_is_ordered_list_item), + cmocka_unit_test(test_content_parse), + cmocka_unit_test(test_content_parse_crlf), + cmocka_unit_test(test_content_parse_with_excerpt), + cmocka_unit_test(test_content_parse_with_excerpt_crlf), + cmocka_unit_test(test_content_parse_header), + cmocka_unit_test(test_content_parse_header_crlf), + cmocka_unit_test(test_content_parse_html), + cmocka_unit_test(test_content_parse_html_crlf), + cmocka_unit_test(test_content_parse_blockquote), + cmocka_unit_test(test_content_parse_blockquote_crlf), + cmocka_unit_test(test_content_parse_code), + cmocka_unit_test(test_content_parse_code_crlf), + cmocka_unit_test(test_content_parse_horizontal_rule), + cmocka_unit_test(test_content_parse_horizontal_rule_crlf), + cmocka_unit_test(test_content_parse_unordered_list), + cmocka_unit_test(test_content_parse_unordered_list_crlf), + cmocka_unit_test(test_content_parse_ordered_list), + cmocka_unit_test(test_content_parse_ordered_list_crlf), + cmocka_unit_test(test_content_parse_first_header), + cmocka_unit_test(test_content_parse_first_header_crlf), + cmocka_unit_test(test_content_parse_headers), + cmocka_unit_test(test_content_parse_headers_crlf), + cmocka_unit_test(test_content_parse_description), + cmocka_unit_test(test_content_parse_description_crlf), + cmocka_unit_test(test_content_parse_endl), + cmocka_unit_test(test_content_parse_endl_crlf), + cmocka_unit_test(test_content_parse_invalid_excerpt), + cmocka_unit_test(test_content_parse_invalid_header), + cmocka_unit_test(test_content_parse_invalid_header_empty), + cmocka_unit_test(test_content_parse_invalid_blockquote), + cmocka_unit_test(test_content_parse_invalid_code), + cmocka_unit_test(test_content_parse_invalid_horizontal_rule), + cmocka_unit_test(test_content_parse_invalid_unordered_list), + cmocka_unit_test(test_content_parse_invalid_ordered_list), + cmocka_unit_test(test_content_parse_inline), + cmocka_unit_test(test_content_parse_inline_em), + cmocka_unit_test(test_content_parse_inline_strong), + cmocka_unit_test(test_content_parse_inline_code), + cmocka_unit_test(test_content_parse_inline_link), + cmocka_unit_test(test_content_parse_inline_link_auto), + cmocka_unit_test(test_content_parse_inline_image), + cmocka_unit_test(test_content_parse_inline_line_break), + cmocka_unit_test(test_content_parse_inline_line_break_crlf), + cmocka_unit_test(test_content_parse_inline_endash_emdash), }; - return run_tests(tests); + return cmocka_run_group_tests(tests, NULL, NULL); } diff --git a/tests/blogc/check_datetime_parser.c b/tests/blogc/check_datetime_parser.c index 44c1af8..fe0ddd8 100644 --- a/tests/blogc/check_datetime_parser.c +++ b/tests/blogc/check_datetime_parser.c @@ -634,38 +634,38 @@ int main(void) { setlocale(LC_ALL, "C"); - const UnitTest tests[] = { - unit_test(test_convert_datetime), - unit_test(test_convert_datetime_implicit_seconds), - unit_test(test_convert_datetime_implicit_minutes), - unit_test(test_convert_datetime_implicit_hours), - unit_test(test_convert_datetime_invalid_formats), - unit_test(test_convert_datetime_invalid_1st_year), - unit_test(test_convert_datetime_invalid_2nd_year), - unit_test(test_convert_datetime_invalid_3rd_year), - unit_test(test_convert_datetime_invalid_4th_year), - unit_test(test_convert_datetime_invalid_year), - unit_test(test_convert_datetime_invalid_1st_hyphen), - unit_test(test_convert_datetime_invalid_1st_month), - unit_test(test_convert_datetime_invalid_2nd_month), - unit_test(test_convert_datetime_invalid_month), - unit_test(test_convert_datetime_invalid_2nd_hyphen), - unit_test(test_convert_datetime_invalid_1st_day), - unit_test(test_convert_datetime_invalid_2nd_day), - unit_test(test_convert_datetime_invalid_day), - unit_test(test_convert_datetime_invalid_space), - unit_test(test_convert_datetime_invalid_1st_hours), - unit_test(test_convert_datetime_invalid_2nd_hours), - unit_test(test_convert_datetime_invalid_hours), - unit_test(test_convert_datetime_invalid_1st_colon), - unit_test(test_convert_datetime_invalid_1st_minutes), - unit_test(test_convert_datetime_invalid_2nd_minutes), - //unit_test(test_convert_datetime_invalid_minutes), // not possible - unit_test(test_convert_datetime_invalid_2nd_colon), - unit_test(test_convert_datetime_invalid_1st_seconds), - unit_test(test_convert_datetime_invalid_2nd_seconds), - unit_test(test_convert_datetime_invalid_seconds), - unit_test(test_convert_datetime_invalid_format_long), + const struct CMUnitTest tests[] = { + cmocka_unit_test(test_convert_datetime), + cmocka_unit_test(test_convert_datetime_implicit_seconds), + cmocka_unit_test(test_convert_datetime_implicit_minutes), + cmocka_unit_test(test_convert_datetime_implicit_hours), + cmocka_unit_test(test_convert_datetime_invalid_formats), + cmocka_unit_test(test_convert_datetime_invalid_1st_year), + cmocka_unit_test(test_convert_datetime_invalid_2nd_year), + cmocka_unit_test(test_convert_datetime_invalid_3rd_year), + cmocka_unit_test(test_convert_datetime_invalid_4th_year), + cmocka_unit_test(test_convert_datetime_invalid_year), + cmocka_unit_test(test_convert_datetime_invalid_1st_hyphen), + cmocka_unit_test(test_convert_datetime_invalid_1st_month), + cmocka_unit_test(test_convert_datetime_invalid_2nd_month), + cmocka_unit_test(test_convert_datetime_invalid_month), + cmocka_unit_test(test_convert_datetime_invalid_2nd_hyphen), + cmocka_unit_test(test_convert_datetime_invalid_1st_day), + cmocka_unit_test(test_convert_datetime_invalid_2nd_day), + cmocka_unit_test(test_convert_datetime_invalid_day), + cmocka_unit_test(test_convert_datetime_invalid_space), + cmocka_unit_test(test_convert_datetime_invalid_1st_hours), + cmocka_unit_test(test_convert_datetime_invalid_2nd_hours), + cmocka_unit_test(test_convert_datetime_invalid_hours), + cmocka_unit_test(test_convert_datetime_invalid_1st_colon), + cmocka_unit_test(test_convert_datetime_invalid_1st_minutes), + cmocka_unit_test(test_convert_datetime_invalid_2nd_minutes), + //cmocka_unit_test(test_convert_datetime_invalid_minutes), // not possible + cmocka_unit_test(test_convert_datetime_invalid_2nd_colon), + cmocka_unit_test(test_convert_datetime_invalid_1st_seconds), + cmocka_unit_test(test_convert_datetime_invalid_2nd_seconds), + cmocka_unit_test(test_convert_datetime_invalid_seconds), + cmocka_unit_test(test_convert_datetime_invalid_format_long), }; - return run_tests(tests); + return cmocka_run_group_tests(tests, NULL, NULL); } diff --git a/tests/blogc/check_filelist_parser.c b/tests/blogc/check_filelist_parser.c index 5883eb7..da1698e 100644 --- a/tests/blogc/check_filelist_parser.c +++ b/tests/blogc/check_filelist_parser.c @@ -122,10 +122,10 @@ test_filelist_parse_crlf(void **state) int main(void) { - const UnitTest tests[] = { - unit_test(test_filelist_parse_empty), - unit_test(test_filelist_parse), - unit_test(test_filelist_parse_crlf), + const struct CMUnitTest tests[] = { + cmocka_unit_test(test_filelist_parse_empty), + cmocka_unit_test(test_filelist_parse), + cmocka_unit_test(test_filelist_parse_crlf), }; - return run_tests(tests); + return cmocka_run_group_tests(tests, NULL, NULL); } diff --git a/tests/blogc/check_funcvars.c b/tests/blogc/check_funcvars.c index 9d094d5..23f1723 100644 --- a/tests/blogc/check_funcvars.c +++ b/tests/blogc/check_funcvars.c @@ -72,9 +72,9 @@ test_funcvars_eval_mocked(void **state) int main(void) { - const UnitTest tests[] = { - unit_test(test_funcvars_eval), - unit_test(test_funcvars_eval_mocked), + const struct CMUnitTest tests[] = { + cmocka_unit_test(test_funcvars_eval), + cmocka_unit_test(test_funcvars_eval_mocked), }; - return run_tests(tests); + return cmocka_run_group_tests(tests, NULL, NULL); } diff --git a/tests/blogc/check_loader.c b/tests/blogc/check_loader.c index 8c9c292..caeb8d8 100644 --- a/tests/blogc/check_loader.c +++ b/tests/blogc/check_loader.c @@ -1022,29 +1022,29 @@ test_source_parse_from_files_null(void **state) int main(void) { - const UnitTest tests[] = { - unit_test(test_get_filename), - unit_test(test_template_parse_from_file), - unit_test(test_template_parse_from_file_null), - unit_test(test_source_parse_from_file), - unit_test(test_source_parse_from_file_maxdepth), - unit_test(test_source_parse_from_file_maxdepth2), - unit_test(test_source_parse_from_file_null), - unit_test(test_source_parse_from_files), - unit_test(test_source_parse_from_files_filter_sort), - unit_test(test_source_parse_from_files_filter_reverse), - unit_test(test_source_parse_from_files_filter_sort_reverse), - unit_test(test_source_parse_from_files_filter_by_tag), - unit_test(test_source_parse_from_files_filter_by_page), - unit_test(test_source_parse_from_files_filter_by_page2), - unit_test(test_source_parse_from_files_filter_by_page3), - unit_test(test_source_parse_from_files_filter_sort_and_by_page_and_tag), - unit_test(test_source_parse_from_files_filter_by_page_invalid), - unit_test(test_source_parse_from_files_filter_by_page_invalid2), - unit_test(test_source_parse_from_files_without_all_dates), - unit_test(test_source_parse_from_files_filter_sort_without_all_dates), - unit_test(test_source_parse_from_files_filter_sort_with_wrong_date), - unit_test(test_source_parse_from_files_null), + const struct CMUnitTest tests[] = { + cmocka_unit_test(test_get_filename), + cmocka_unit_test(test_template_parse_from_file), + cmocka_unit_test(test_template_parse_from_file_null), + cmocka_unit_test(test_source_parse_from_file), + cmocka_unit_test(test_source_parse_from_file_maxdepth), + cmocka_unit_test(test_source_parse_from_file_maxdepth2), + cmocka_unit_test(test_source_parse_from_file_null), + cmocka_unit_test(test_source_parse_from_files), + cmocka_unit_test(test_source_parse_from_files_filter_sort), + cmocka_unit_test(test_source_parse_from_files_filter_reverse), + cmocka_unit_test(test_source_parse_from_files_filter_sort_reverse), + cmocka_unit_test(test_source_parse_from_files_filter_by_tag), + cmocka_unit_test(test_source_parse_from_files_filter_by_page), + cmocka_unit_test(test_source_parse_from_files_filter_by_page2), + cmocka_unit_test(test_source_parse_from_files_filter_by_page3), + cmocka_unit_test(test_source_parse_from_files_filter_sort_and_by_page_and_tag), + cmocka_unit_test(test_source_parse_from_files_filter_by_page_invalid), + cmocka_unit_test(test_source_parse_from_files_filter_by_page_invalid2), + cmocka_unit_test(test_source_parse_from_files_without_all_dates), + cmocka_unit_test(test_source_parse_from_files_filter_sort_without_all_dates), + cmocka_unit_test(test_source_parse_from_files_filter_sort_with_wrong_date), + cmocka_unit_test(test_source_parse_from_files_null), }; - return run_tests(tests); + return cmocka_run_group_tests(tests, NULL, NULL); } diff --git a/tests/blogc/check_renderer.c b/tests/blogc/check_renderer.c index 3c207a7..a5d6729 100644 --- a/tests/blogc/check_renderer.c +++ b/tests/blogc/check_renderer.c @@ -1361,49 +1361,49 @@ test_split_list_variable_not_found(void **state) int main(void) { - const UnitTest tests[] = { - unit_test(test_render_entry), - unit_test(test_render_listing), - unit_test(test_render_listing_entry), - unit_test(test_render_listing_entry2), - unit_test(test_render_listing_entry3), - unit_test(test_render_listing_entry4), - unit_test(test_render_listing_empty), - unit_test(test_render_ifdef), - unit_test(test_render_ifdef2), - unit_test(test_render_ifdef3), - unit_test(test_render_ifdef4), - unit_test(test_render_ifdef5), - unit_test(test_render_ifdef6), - unit_test(test_render_ifdef7), - unit_test(test_render_ifndef), - unit_test(test_render_if_eq), - unit_test(test_render_if_neq), - unit_test(test_render_if_lt), - unit_test(test_render_if_gt), - unit_test(test_render_if_lt_eq), - unit_test(test_render_if_gt_eq), - unit_test(test_render_foreach), - unit_test(test_render_foreach_if), - unit_test(test_render_foreach_if_else), - unit_test(test_render_null), - unit_test(test_render_outside_block), - unit_test(test_render_prefer_local_variable), - unit_test(test_render_respect_variable_scope), - unit_test(test_render_ifcount_bug), - unit_test(test_get_variable), - unit_test(test_get_variable_only_local), - unit_test(test_get_variable_only_global), - unit_test(test_format_date), - unit_test(test_format_date_with_global_format), - unit_test(test_format_date_without_format), - unit_test(test_format_date_without_date), - unit_test(test_format_variable), - unit_test(test_format_variable_with_date), - unit_test(test_format_variable_foreach), - unit_test(test_format_variable_foreach_empty), - unit_test(test_split_list_variable), - unit_test(test_split_list_variable_not_found), + const struct CMUnitTest tests[] = { + cmocka_unit_test(test_render_entry), + cmocka_unit_test(test_render_listing), + cmocka_unit_test(test_render_listing_entry), + cmocka_unit_test(test_render_listing_entry2), + cmocka_unit_test(test_render_listing_entry3), + cmocka_unit_test(test_render_listing_entry4), + cmocka_unit_test(test_render_listing_empty), + cmocka_unit_test(test_render_ifdef), + cmocka_unit_test(test_render_ifdef2), + cmocka_unit_test(test_render_ifdef3), + cmocka_unit_test(test_render_ifdef4), + cmocka_unit_test(test_render_ifdef5), + cmocka_unit_test(test_render_ifdef6), + cmocka_unit_test(test_render_ifdef7), + cmocka_unit_test(test_render_ifndef), + cmocka_unit_test(test_render_if_eq), + cmocka_unit_test(test_render_if_neq), + cmocka_unit_test(test_render_if_lt), + cmocka_unit_test(test_render_if_gt), + cmocka_unit_test(test_render_if_lt_eq), + cmocka_unit_test(test_render_if_gt_eq), + cmocka_unit_test(test_render_foreach), + cmocka_unit_test(test_render_foreach_if), + cmocka_unit_test(test_render_foreach_if_else), + cmocka_unit_test(test_render_null), + cmocka_unit_test(test_render_outside_block), + cmocka_unit_test(test_render_prefer_local_variable), + cmocka_unit_test(test_render_respect_variable_scope), + cmocka_unit_test(test_render_ifcount_bug), + cmocka_unit_test(test_get_variable), + cmocka_unit_test(test_get_variable_only_local), + cmocka_unit_test(test_get_variable_only_global), + cmocka_unit_test(test_format_date), + cmocka_unit_test(test_format_date_with_global_format), + cmocka_unit_test(test_format_date_without_format), + cmocka_unit_test(test_format_date_without_date), + cmocka_unit_test(test_format_variable), + cmocka_unit_test(test_format_variable_with_date), + cmocka_unit_test(test_format_variable_foreach), + cmocka_unit_test(test_format_variable_foreach_empty), + cmocka_unit_test(test_split_list_variable), + cmocka_unit_test(test_split_list_variable_not_found), }; - return run_tests(tests); + return cmocka_run_group_tests(tests, NULL, NULL); } diff --git a/tests/blogc/check_rusage.c b/tests/blogc/check_rusage.c index ff64297..c332991 100644 --- a/tests/blogc/check_rusage.c +++ b/tests/blogc/check_rusage.c @@ -117,11 +117,11 @@ test_rusage_inject(void **state) int main(void) { - const UnitTest tests[] = { - unit_test(test_rusage_get), - unit_test(test_rusage_format_cpu_time), - unit_test(test_rusage_format_memory), - unit_test(test_rusage_inject), + const struct CMUnitTest tests[] = { + cmocka_unit_test(test_rusage_get), + cmocka_unit_test(test_rusage_format_cpu_time), + cmocka_unit_test(test_rusage_format_memory), + cmocka_unit_test(test_rusage_inject), }; - return run_tests(tests); + return cmocka_run_group_tests(tests, NULL, NULL); } diff --git a/tests/blogc/check_source_parser.c b/tests/blogc/check_source_parser.c index c1bf2c7..822133c 100644 --- a/tests/blogc/check_source_parser.c +++ b/tests/blogc/check_source_parser.c @@ -726,36 +726,36 @@ test_source_parse_invalid_separator(void **state) int main(void) { - const UnitTest tests[] = { - unit_test(test_source_parse), - unit_test(test_source_parse_crlf), - unit_test(test_source_parse_with_spaces), - unit_test(test_source_parse_with_excerpt), - unit_test(test_source_parse_with_first_header), - unit_test(test_source_parse_with_description), - unit_test(test_source_parse_with_toctree), - unit_test(test_source_parse_with_toctree_noheader), - unit_test(test_source_parse_with_toctree_maxdepth1), - unit_test(test_source_parse_with_toctree_maxdepth_invalid), - unit_test(test_source_parse_config_empty), - unit_test(test_source_parse_config_invalid_key), - unit_test(test_source_parse_config_no_key), - unit_test(test_source_parse_config_no_key2), - unit_test(test_source_parse_config_no_value), - unit_test(test_source_parse_config_no_value2), - unit_test(test_source_parse_config_reserved_name), - unit_test(test_source_parse_config_reserved_name2), - unit_test(test_source_parse_config_reserved_name3), - unit_test(test_source_parse_config_reserved_name4), - unit_test(test_source_parse_config_reserved_name5), - unit_test(test_source_parse_config_reserved_name6), - unit_test(test_source_parse_config_reserved_name7), - unit_test(test_source_parse_config_reserved_name8), - unit_test(test_source_parse_config_reserved_name9), - unit_test(test_source_parse_config_reserved_name10), - unit_test(test_source_parse_config_reserved_name11), - unit_test(test_source_parse_config_value_no_line_ending), - unit_test(test_source_parse_invalid_separator), + const struct CMUnitTest tests[] = { + cmocka_unit_test(test_source_parse), + cmocka_unit_test(test_source_parse_crlf), + cmocka_unit_test(test_source_parse_with_spaces), + cmocka_unit_test(test_source_parse_with_excerpt), + cmocka_unit_test(test_source_parse_with_first_header), + cmocka_unit_test(test_source_parse_with_description), + cmocka_unit_test(test_source_parse_with_toctree), + cmocka_unit_test(test_source_parse_with_toctree_noheader), + cmocka_unit_test(test_source_parse_with_toctree_maxdepth1), + cmocka_unit_test(test_source_parse_with_toctree_maxdepth_invalid), + cmocka_unit_test(test_source_parse_config_empty), + cmocka_unit_test(test_source_parse_config_invalid_key), + cmocka_unit_test(test_source_parse_config_no_key), + cmocka_unit_test(test_source_parse_config_no_key2), + cmocka_unit_test(test_source_parse_config_no_value), + cmocka_unit_test(test_source_parse_config_no_value2), + cmocka_unit_test(test_source_parse_config_reserved_name), + cmocka_unit_test(test_source_parse_config_reserved_name2), + cmocka_unit_test(test_source_parse_config_reserved_name3), + cmocka_unit_test(test_source_parse_config_reserved_name4), + cmocka_unit_test(test_source_parse_config_reserved_name5), + cmocka_unit_test(test_source_parse_config_reserved_name6), + cmocka_unit_test(test_source_parse_config_reserved_name7), + cmocka_unit_test(test_source_parse_config_reserved_name8), + cmocka_unit_test(test_source_parse_config_reserved_name9), + cmocka_unit_test(test_source_parse_config_reserved_name10), + cmocka_unit_test(test_source_parse_config_reserved_name11), + cmocka_unit_test(test_source_parse_config_value_no_line_ending), + cmocka_unit_test(test_source_parse_invalid_separator), }; - return run_tests(tests); + return cmocka_run_group_tests(tests, NULL, NULL); } diff --git a/tests/blogc/check_sysinfo.c b/tests/blogc/check_sysinfo.c index 01b81b9..3951bbf 100644 --- a/tests/blogc/check_sysinfo.c +++ b/tests/blogc/check_sysinfo.c @@ -208,22 +208,22 @@ test_sysinfo_get_inside_docker(void **state) int main(void) { - const UnitTest tests[] = { + const struct CMUnitTest tests[] = { #ifdef HAVE_SYSINFO_HOSTNAME - unit_test(test_sysinfo_get_hostname), - unit_test(test_sysinfo_inject_hostname), + cmocka_unit_test(test_sysinfo_get_hostname), + cmocka_unit_test(test_sysinfo_inject_hostname), #endif - unit_test(test_sysinfo_get_username), - unit_test(test_sysinfo_inject_username), + cmocka_unit_test(test_sysinfo_get_username), + cmocka_unit_test(test_sysinfo_inject_username), #ifdef HAVE_SYSINFO_DATETIME - unit_test(test_sysinfo_get_datetime), - unit_test(test_sysinfo_inject_datetime), + cmocka_unit_test(test_sysinfo_get_datetime), + cmocka_unit_test(test_sysinfo_inject_datetime), #endif - unit_test(test_sysinfo_get_inside_docker), + cmocka_unit_test(test_sysinfo_get_inside_docker), }; - return run_tests(tests); + return cmocka_run_group_tests(tests, NULL, NULL); } diff --git a/tests/blogc/check_sysinfo2.c b/tests/blogc/check_sysinfo2.c index 2bb4273..7dd440d 100644 --- a/tests/blogc/check_sysinfo2.c +++ b/tests/blogc/check_sysinfo2.c @@ -42,8 +42,8 @@ test_sysinfo_get_inside_docker(void **state) int main(void) { - const UnitTest tests[] = { - unit_test(test_sysinfo_get_inside_docker), + const struct CMUnitTest tests[] = { + cmocka_unit_test(test_sysinfo_get_inside_docker), }; - return run_tests(tests); + return cmocka_run_group_tests(tests, NULL, NULL); } diff --git a/tests/blogc/check_template_parser.c b/tests/blogc/check_template_parser.c index ecb86e1..ace8ac4 100644 --- a/tests/blogc/check_template_parser.c +++ b/tests/blogc/check_template_parser.c @@ -1279,53 +1279,53 @@ test_template_parse_invalid_foreach_not_closed(void **state) int main(void) { - const UnitTest tests[] = { - unit_test(test_template_parse), - unit_test(test_template_parse_crlf), - unit_test(test_template_parse_html), - unit_test(test_template_parse_html_whitespace), - unit_test(test_template_parse_ifdef_and_var_outside_block), - unit_test(test_template_parse_nested_else), - unit_test(test_template_parse_invalid_block_start), - unit_test(test_template_parse_invalid_block_nested), - unit_test(test_template_parse_invalid_foreach_nested), - unit_test(test_template_parse_invalid_block_not_open), - unit_test(test_template_parse_invalid_endif_not_open), - unit_test(test_template_parse_invalid_endif_not_open_inside_block), - unit_test(test_template_parse_invalid_else_not_open_inside_block), - unit_test(test_template_parse_invalid_endforeach_not_open), - unit_test(test_template_parse_invalid_endforeach_not_open_inside_block), - unit_test(test_template_parse_invalid_endforeach_not_open_inside_block2), - unit_test(test_template_parse_invalid_endforeach_not_closed_inside_block), - unit_test(test_template_parse_invalid_endforeach_not_closed_inside_block2), - unit_test(test_template_parse_invalid_block_name), - unit_test(test_template_parse_invalid_block_type_start), - unit_test(test_template_parse_invalid_block_type), - unit_test(test_template_parse_invalid_ifdef_start), - unit_test(test_template_parse_invalid_foreach_start), - unit_test(test_template_parse_invalid_ifdef_variable), - unit_test(test_template_parse_invalid_ifdef_variable2), - unit_test(test_template_parse_invalid_foreach_variable), - unit_test(test_template_parse_invalid_foreach_variable2), - unit_test(test_template_parse_invalid_if_operator), - unit_test(test_template_parse_invalid_if_operand), - unit_test(test_template_parse_invalid_if_operand2), - unit_test(test_template_parse_invalid_if_operand3), - unit_test(test_template_parse_invalid_else1), - unit_test(test_template_parse_invalid_else2), - unit_test(test_template_parse_invalid_else3), - unit_test(test_template_parse_invalid_block_end), - unit_test(test_template_parse_invalid_variable_name), - unit_test(test_template_parse_invalid_variable_name2), - unit_test(test_template_parse_invalid_variable_name3), - unit_test(test_template_parse_invalid_variable_end), - unit_test(test_template_parse_invalid_close), - unit_test(test_template_parse_invalid_close2), - unit_test(test_template_parse_invalid_endif_not_closed), - unit_test(test_template_parse_invalid_endif_not_closed_inside_block), - unit_test(test_template_parse_invalid_else_not_closed_inside_block), - unit_test(test_template_parse_invalid_block_not_closed), - unit_test(test_template_parse_invalid_foreach_not_closed), + const struct CMUnitTest tests[] = { + cmocka_unit_test(test_template_parse), + cmocka_unit_test(test_template_parse_crlf), + cmocka_unit_test(test_template_parse_html), + cmocka_unit_test(test_template_parse_html_whitespace), + cmocka_unit_test(test_template_parse_ifdef_and_var_outside_block), + cmocka_unit_test(test_template_parse_nested_else), + cmocka_unit_test(test_template_parse_invalid_block_start), + cmocka_unit_test(test_template_parse_invalid_block_nested), + cmocka_unit_test(test_template_parse_invalid_foreach_nested), + cmocka_unit_test(test_template_parse_invalid_block_not_open), + cmocka_unit_test(test_template_parse_invalid_endif_not_open), + cmocka_unit_test(test_template_parse_invalid_endif_not_open_inside_block), + cmocka_unit_test(test_template_parse_invalid_else_not_open_inside_block), + cmocka_unit_test(test_template_parse_invalid_endforeach_not_open), + cmocka_unit_test(test_template_parse_invalid_endforeach_not_open_inside_block), + cmocka_unit_test(test_template_parse_invalid_endforeach_not_open_inside_block2), + cmocka_unit_test(test_template_parse_invalid_endforeach_not_closed_inside_block), + cmocka_unit_test(test_template_parse_invalid_endforeach_not_closed_inside_block2), + cmocka_unit_test(test_template_parse_invalid_block_name), + cmocka_unit_test(test_template_parse_invalid_block_type_start), + cmocka_unit_test(test_template_parse_invalid_block_type), + cmocka_unit_test(test_template_parse_invalid_ifdef_start), + cmocka_unit_test(test_template_parse_invalid_foreach_start), + cmocka_unit_test(test_template_parse_invalid_ifdef_variable), + cmocka_unit_test(test_template_parse_invalid_ifdef_variable2), + cmocka_unit_test(test_template_parse_invalid_foreach_variable), + cmocka_unit_test(test_template_parse_invalid_foreach_variable2), + cmocka_unit_test(test_template_parse_invalid_if_operator), + cmocka_unit_test(test_template_parse_invalid_if_operand), + cmocka_unit_test(test_template_parse_invalid_if_operand2), + cmocka_unit_test(test_template_parse_invalid_if_operand3), + cmocka_unit_test(test_template_parse_invalid_else1), + cmocka_unit_test(test_template_parse_invalid_else2), + cmocka_unit_test(test_template_parse_invalid_else3), + cmocka_unit_test(test_template_parse_invalid_block_end), + cmocka_unit_test(test_template_parse_invalid_variable_name), + cmocka_unit_test(test_template_parse_invalid_variable_name2), + cmocka_unit_test(test_template_parse_invalid_variable_name3), + cmocka_unit_test(test_template_parse_invalid_variable_end), + cmocka_unit_test(test_template_parse_invalid_close), + cmocka_unit_test(test_template_parse_invalid_close2), + cmocka_unit_test(test_template_parse_invalid_endif_not_closed), + cmocka_unit_test(test_template_parse_invalid_endif_not_closed_inside_block), + cmocka_unit_test(test_template_parse_invalid_else_not_closed_inside_block), + cmocka_unit_test(test_template_parse_invalid_block_not_closed), + cmocka_unit_test(test_template_parse_invalid_foreach_not_closed), }; - return run_tests(tests); + return cmocka_run_group_tests(tests, NULL, NULL); } diff --git a/tests/blogc/check_toctree.c b/tests/blogc/check_toctree.c index c5cb918..05cc008 100644 --- a/tests/blogc/check_toctree.c +++ b/tests/blogc/check_toctree.c @@ -226,9 +226,9 @@ test_toctree_render(void **state) int main(void) { - const UnitTest tests[] = { - unit_test(test_toctree_append), - unit_test(test_toctree_render), + const struct CMUnitTest tests[] = { + cmocka_unit_test(test_toctree_append), + cmocka_unit_test(test_toctree_render), }; - return run_tests(tests); + return cmocka_run_group_tests(tests, NULL, NULL); } diff --git a/tests/common/check_config_parser.c b/tests/common/check_config_parser.c index 49e2a5b..5360f54 100644 --- a/tests/common/check_config_parser.c +++ b/tests/common/check_config_parser.c @@ -1019,19 +1019,19 @@ test_config_error_key_without_value(void **state) int main(void) { - const UnitTest tests[] = { - unit_test(test_config_empty), - unit_test(test_config_section_empty), - unit_test(test_config_section), - unit_test(test_config_section_multiple_keys), - unit_test(test_config_section_multiple_sections), - unit_test(test_config_section_list), - unit_test(test_config_quoted_values), - unit_test(test_config_empty_values), - unit_test(test_config_key_prefix), - unit_test(test_config_error_start), - unit_test(test_config_error_section_with_newline), - unit_test(test_config_error_key_without_value), + const struct CMUnitTest tests[] = { + cmocka_unit_test(test_config_empty), + cmocka_unit_test(test_config_section_empty), + cmocka_unit_test(test_config_section), + cmocka_unit_test(test_config_section_multiple_keys), + cmocka_unit_test(test_config_section_multiple_sections), + cmocka_unit_test(test_config_section_list), + cmocka_unit_test(test_config_quoted_values), + cmocka_unit_test(test_config_empty_values), + cmocka_unit_test(test_config_key_prefix), + cmocka_unit_test(test_config_error_start), + cmocka_unit_test(test_config_error_section_with_newline), + cmocka_unit_test(test_config_error_key_without_value), }; - return run_tests(tests); + return cmocka_run_group_tests(tests, NULL, NULL); } diff --git a/tests/common/check_error.c b/tests/common/check_error.c index 1b6f855..658ad22 100644 --- a/tests/common/check_error.c +++ b/tests/common/check_error.c @@ -104,11 +104,11 @@ test_error_parser_crlf(void **state) int main(void) { - const UnitTest tests[] = { - unit_test(test_error_new), - unit_test(test_error_new_printf), - unit_test(test_error_parser), - unit_test(test_error_parser_crlf), + const struct CMUnitTest tests[] = { + cmocka_unit_test(test_error_new), + cmocka_unit_test(test_error_new_printf), + cmocka_unit_test(test_error_parser), + cmocka_unit_test(test_error_parser_crlf), }; - return run_tests(tests); + return cmocka_run_group_tests(tests, NULL, NULL); } diff --git a/tests/common/check_sort.c b/tests/common/check_sort.c index f49710c..2bc8751 100644 --- a/tests/common/check_sort.c +++ b/tests/common/check_sort.c @@ -136,13 +136,13 @@ test_slist_sort_mixed2(void **state) int main(void) { - const UnitTest tests[] = { - unit_test(test_slist_sort_empty), - unit_test(test_slist_sort_single), - unit_test(test_slist_sort_sorted), - unit_test(test_slist_sort_reverse), - unit_test(test_slist_sort_mixed1), - unit_test(test_slist_sort_mixed2), + const struct CMUnitTest tests[] = { + cmocka_unit_test(test_slist_sort_empty), + cmocka_unit_test(test_slist_sort_single), + cmocka_unit_test(test_slist_sort_sorted), + cmocka_unit_test(test_slist_sort_reverse), + cmocka_unit_test(test_slist_sort_mixed1), + cmocka_unit_test(test_slist_sort_mixed2), }; - return run_tests(tests); + return cmocka_run_group_tests(tests, NULL, NULL); } diff --git a/tests/common/check_stdin.c b/tests/common/check_stdin.c index 862533d..5616ee9 100644 --- a/tests/common/check_stdin.c +++ b/tests/common/check_stdin.c @@ -51,8 +51,8 @@ test_read(void **state) int main(void) { - const UnitTest tests[] = { - unit_test(test_read), + const struct CMUnitTest tests[] = { + cmocka_unit_test(test_read), }; - return run_tests(tests); + return cmocka_run_group_tests(tests, NULL, NULL); } diff --git a/tests/common/check_utf8.c b/tests/common/check_utf8.c index 803818b..95e2eab 100644 --- a/tests/common/check_utf8.c +++ b/tests/common/check_utf8.c @@ -94,12 +94,12 @@ test_utf8_skip_bom(void **state) int main(void) { - const UnitTest tests[] = { - unit_test(test_utf8_valid), - unit_test(test_utf8_invalid), - unit_test(test_utf8_valid_str), - unit_test(test_utf8_invalid_str), - unit_test(test_utf8_skip_bom), + const struct CMUnitTest tests[] = { + cmocka_unit_test(test_utf8_valid), + cmocka_unit_test(test_utf8_invalid), + cmocka_unit_test(test_utf8_valid_str), + cmocka_unit_test(test_utf8_invalid_str), + cmocka_unit_test(test_utf8_skip_bom), }; - return run_tests(tests); + return cmocka_run_group_tests(tests, NULL, NULL); } diff --git a/tests/common/check_utils.c b/tests/common/check_utils.c index 3ee81e1..20e6891 100644 --- a/tests/common/check_utils.c +++ b/tests/common/check_utils.c @@ -1089,53 +1089,53 @@ test_shell_quote(void **state) int main(void) { - const UnitTest tests[] = { + const struct CMUnitTest tests[] = { // slist - unit_test(test_slist_append), - unit_test(test_slist_prepend), - unit_test(test_slist_append_list), - unit_test(test_slist_free), - unit_test(test_slist_length), + cmocka_unit_test(test_slist_append), + cmocka_unit_test(test_slist_prepend), + cmocka_unit_test(test_slist_append_list), + cmocka_unit_test(test_slist_free), + cmocka_unit_test(test_slist_length), // strfuncs - unit_test(test_strdup), - unit_test(test_strndup), - unit_test(test_strdup_printf), - unit_test(test_str_starts_with), - unit_test(test_str_ends_with), - unit_test(test_str_lstrip), - unit_test(test_str_rstrip), - unit_test(test_str_strip), - unit_test(test_str_split), - unit_test(test_str_replace), - unit_test(test_str_find), - unit_test(test_str_to_bool), - unit_test(test_strv_join), - unit_test(test_strv_length), + cmocka_unit_test(test_strdup), + cmocka_unit_test(test_strndup), + cmocka_unit_test(test_strdup_printf), + cmocka_unit_test(test_str_starts_with), + cmocka_unit_test(test_str_ends_with), + cmocka_unit_test(test_str_lstrip), + cmocka_unit_test(test_str_rstrip), + cmocka_unit_test(test_str_strip), + cmocka_unit_test(test_str_split), + cmocka_unit_test(test_str_replace), + cmocka_unit_test(test_str_find), + cmocka_unit_test(test_str_to_bool), + cmocka_unit_test(test_strv_join), + cmocka_unit_test(test_strv_length), // string - unit_test(test_string_new), - unit_test(test_string_free), - unit_test(test_string_dup), - unit_test(test_string_append_len), - unit_test(test_string_append), - unit_test(test_string_append_c), - unit_test(test_string_append_printf), - unit_test(test_string_append_escaped), + cmocka_unit_test(test_string_new), + cmocka_unit_test(test_string_free), + cmocka_unit_test(test_string_dup), + cmocka_unit_test(test_string_append_len), + cmocka_unit_test(test_string_append), + cmocka_unit_test(test_string_append_c), + cmocka_unit_test(test_string_append_printf), + cmocka_unit_test(test_string_append_escaped), // trie - unit_test(test_trie_new), - unit_test(test_trie_insert), - unit_test(test_trie_insert_duplicated), - unit_test(test_trie_keep_data), - unit_test(test_trie_lookup), - unit_test(test_trie_size), - unit_test(test_trie_foreach), - unit_test(test_trie_inserted_after_prefix), + cmocka_unit_test(test_trie_new), + cmocka_unit_test(test_trie_insert), + cmocka_unit_test(test_trie_insert_duplicated), + cmocka_unit_test(test_trie_keep_data), + cmocka_unit_test(test_trie_lookup), + cmocka_unit_test(test_trie_size), + cmocka_unit_test(test_trie_foreach), + cmocka_unit_test(test_trie_inserted_after_prefix), // shell - unit_test(test_shell_quote), + cmocka_unit_test(test_shell_quote), }; - return run_tests(tests); + return cmocka_run_group_tests(tests, NULL, NULL); } |