aboutsummaryrefslogtreecommitdiffstats
path: root/tests/common
diff options
context:
space:
mode:
authorRafael G. Martins <rafael@rafaelmartins.eng.br>2020-11-05 22:03:02 +0100
committerRafael G. Martins <rafael@rafaelmartins.eng.br>2020-11-05 22:03:02 +0100
commit3ff8703ca68709c116762a5feda378903e2419d9 (patch)
tree7a807d07a45766443cb492414eefb31703ef072c /tests/common
parent68feeee28d2121cd2311650c5a21740bbad8074b (diff)
downloadblogc-3ff8703ca68709c116762a5feda378903e2419d9.tar.gz
blogc-3ff8703ca68709c116762a5feda378903e2419d9.tar.bz2
blogc-3ff8703ca68709c116762a5feda378903e2419d9.zip
tests: upgrade deprecated cmocka test runner
Diffstat (limited to 'tests/common')
-rw-r--r--tests/common/check_config_parser.c28
-rw-r--r--tests/common/check_error.c12
-rw-r--r--tests/common/check_sort.c16
-rw-r--r--tests/common/check_stdin.c6
-rw-r--r--tests/common/check_utf8.c14
-rw-r--r--tests/common/check_utils.c76
6 files changed, 76 insertions, 76 deletions
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);
}