Tests clean up.

Remove mc-specific macros mctest_assert_int_eq and mctest_assert_int_ne.
Use ck_assert_int_eq() and ck_assert_int_ne() functions respectively.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2022-02-20 17:21:37 +03:00
parent f0924b954d
commit f411d44fea
26 changed files with 107 additions and 119 deletions

View File

@ -168,9 +168,7 @@ START_PARAMETRIZED_TEST (test_hex_translate_to_regex, test_hex_translate_to_rege
g_string_free (dest_str, TRUE);
}
else
{
mctest_assert_int_eq (error, data->expected_error);
}
ck_assert_int_eq (error, data->expected_error);
}
/* *INDENT-OFF* */
END_PARAMETRIZED_TEST

View File

@ -196,9 +196,9 @@ START_PARAMETRIZED_TEST (test_regex_replace_esc_seq_prepare, test_regex_replace_
&actual_flags);
/* then */
mctest_assert_int_eq (actual_result, data->expected_result);
mctest_assert_int_eq (actual_skipped_len, data->expected_skipped_len);
mctest_assert_int_eq (actual_flags, data->expected_flags);
ck_assert_int_eq (actual_result, data->expected_result);
ck_assert_int_eq (actual_skipped_len, data->expected_skipped_len);
ck_assert_int_eq (actual_flags, data->expected_flags);
g_string_free (replace_str, TRUE);
}

View File

@ -162,7 +162,7 @@ START_PARAMETRIZED_TEST (test_deserialize_incorrect, test_deserialize_incorrect_
/* then */
mctest_assert_null (actual_result);
mctest_assert_int_eq (error->code, data->expected_error_code);
ck_assert_int_eq (error->code, data->expected_error_code);
mctest_assert_str_eq (error->message, data->expected_error_string);
}
/* *INDENT-OFF* */
@ -300,7 +300,7 @@ START_PARAMETRIZED_TEST (test_deserialize_config_incorrect, test_deserialize_con
/* then */
mctest_assert_null (actual_result);
mctest_assert_int_eq (error->code, data->expected_error_code);
ck_assert_int_eq (error->code, data->expected_error_code);
mctest_assert_str_eq (error->message, data->expected_error_string);
}
/* *INDENT-OFF* */
@ -331,9 +331,9 @@ START_TEST (test_deserialize_config)
mctest_assert_str_eq (actual_value, "some value ");
g_free (actual_value);
mctest_assert_int_eq (mc_config_get_bool (actual, "group2", "param1", FALSE), TRUE);
ck_assert_int_eq (mc_config_get_bool (actual, "group2", "param1", FALSE), TRUE);
mctest_assert_int_eq (mc_config_get_int (actual, "group2", "param2", 0), 123456);
ck_assert_int_eq (mc_config_get_int (actual, "group2", "param2", 0), 123456);
actual_value = mc_config_get_string_raw (actual, "group3", "param1", "");
mctest_assert_str_eq (actual_value, "::bla-bla::");
@ -343,9 +343,9 @@ START_TEST (test_deserialize_config)
mctest_assert_str_eq (actual_value, "bla-:p1:w:v2:12:g3:123:bla-bla\n");
g_free (actual_value);
mctest_assert_int_eq (mc_config_get_bool (actual, "group4", "param1", TRUE), FALSE);
ck_assert_int_eq (mc_config_get_bool (actual, "group4", "param1", TRUE), FALSE);
mctest_assert_int_eq (mc_config_get_int (actual, "group4", "param2", 0), 654321);
ck_assert_int_eq (mc_config_get_int (actual, "group4", "param2", 0), 654321);
mc_config_deinit (actual);
}

View File

@ -91,7 +91,7 @@ START_TEST (filevercmp_test1)
actual_result = filevercmp (data->s1, data->s2);
/* then */
mctest_assert_int_eq (sign (actual_result), sign (data->expected_result));
ck_assert_int_eq (sign (actual_result), sign (data->expected_result));
}
/* *INDENT-OFF* */
END_TEST

View File

@ -108,7 +108,7 @@ START_TEST (str_verscmp_test)
actual_result = str_verscmp (data->s1, data->s2);
/* then */
mctest_assert_int_eq (sign (actual_result), sign (data->expected_result));
ck_assert_int_eq (sign (actual_result), sign (data->expected_result));
}
/* *INDENT-OFF* */
END_TEST

View File

@ -217,13 +217,13 @@ START_PARAMETRIZED_TEST (mc_pstream_get_string_test, data_source)
{
GString *ret;
mctest_assert_int_eq (stream.pos, data->pos[j]);
ck_assert_int_eq (stream.pos, data->pos[j]);
ret = mc_pstream_get_string (&stream);
if (ret == NULL)
break;
mctest_assert_int_eq (ret->len, data->len[j]);
ck_assert_int_eq (ret->len, data->len[j]);
mctest_assert_str_eq (ret->str, data->str[j]);
g_string_free (ret, TRUE);

View File

@ -239,7 +239,7 @@ execvp__deinit (void)
#define VERIFY_SIGACTION__ACT_IGNORED(_pntr) { \
struct sigaction *_act = (struct sigaction *) _pntr; \
mctest_assert_ptr_eq (_act->sa_handler, SIG_IGN); \
mctest_assert_int_eq (_act->sa_flags, 0); \
ck_assert_int_eq (_act->sa_flags, 0); \
}
#define VERIFY_SIGACTION__IS_RESTORED(oldact_idx, act_idx) { \
@ -251,14 +251,14 @@ execvp__deinit (void)
/* @Verify */
#define VERIFY_SIGACTION_CALLS() { \
mctest_assert_int_eq (sigaction_signum__captured->len, 6); \
ck_assert_int_eq (sigaction_signum__captured->len, 6); \
\
mctest_assert_int_eq (*((int *) g_ptr_array_index(sigaction_signum__captured, 0)), SIGINT); \
mctest_assert_int_eq (*((int *) g_ptr_array_index(sigaction_signum__captured, 1)), SIGQUIT); \
mctest_assert_int_eq (*((int *) g_ptr_array_index(sigaction_signum__captured, 2)), SIGTSTP); \
mctest_assert_int_eq (*((int *) g_ptr_array_index(sigaction_signum__captured, 3)), SIGINT); \
mctest_assert_int_eq (*((int *) g_ptr_array_index(sigaction_signum__captured, 4)), SIGQUIT); \
mctest_assert_int_eq (*((int *) g_ptr_array_index(sigaction_signum__captured, 5)), SIGTSTP); \
ck_assert_int_eq (*((int *) g_ptr_array_index(sigaction_signum__captured, 0)), SIGINT); \
ck_assert_int_eq (*((int *) g_ptr_array_index(sigaction_signum__captured, 1)), SIGQUIT); \
ck_assert_int_eq (*((int *) g_ptr_array_index(sigaction_signum__captured, 2)), SIGTSTP); \
ck_assert_int_eq (*((int *) g_ptr_array_index(sigaction_signum__captured, 3)), SIGINT); \
ck_assert_int_eq (*((int *) g_ptr_array_index(sigaction_signum__captured, 4)), SIGQUIT); \
ck_assert_int_eq (*((int *) g_ptr_array_index(sigaction_signum__captured, 5)), SIGTSTP); \
\
VERIFY_SIGACTION__ACT_IGNORED(g_ptr_array_index(sigaction_act__captured, 0)); \
VERIFY_SIGACTION__ACT_IGNORED(g_ptr_array_index(sigaction_act__captured, 1)); \
@ -289,11 +289,11 @@ execvp__deinit (void)
/* @Verify */
#define VERIFY_SIGNAL_CALLS() { \
mctest_assert_int_eq (signal_signum__captured->len, 4); \
mctest_assert_int_eq (*((int *) g_ptr_array_index(signal_signum__captured, 0)), SIGINT); \
mctest_assert_int_eq (*((int *) g_ptr_array_index(signal_signum__captured, 1)), SIGQUIT); \
mctest_assert_int_eq (*((int *) g_ptr_array_index(signal_signum__captured, 2)), SIGTSTP); \
mctest_assert_int_eq (*((int *) g_ptr_array_index(signal_signum__captured, 3)), SIGCHLD); \
ck_assert_int_eq (signal_signum__captured->len, 4); \
ck_assert_int_eq (*((int *) g_ptr_array_index(signal_signum__captured, 0)), SIGINT); \
ck_assert_int_eq (*((int *) g_ptr_array_index(signal_signum__captured, 1)), SIGQUIT); \
ck_assert_int_eq (*((int *) g_ptr_array_index(signal_signum__captured, 2)), SIGTSTP); \
ck_assert_int_eq (*((int *) g_ptr_array_index(signal_signum__captured, 3)), SIGCHLD); \
\
VERIFY_SIGNAL_HANDLER_IS_SIG_DFL (0); \
VERIFY_SIGNAL_HANDLER_IS_SIG_DFL (1); \

View File

@ -46,19 +46,19 @@ START_TEST (fork_child)
actual_value = my_system (0, "/bin/some-command", "some parameter");
/* then */
mctest_assert_int_eq (actual_value, 0);
ck_assert_int_eq (actual_value, 0);
VERIFY_SIGACTION_CALLS ();
VERIFY_SIGNAL_CALLS ();
mctest_assert_str_eq (execvp__file__captured, "/bin/some-command");
mctest_assert_int_eq (execvp__args__captured->len, 2);
ck_assert_int_eq (execvp__args__captured->len, 2);
mctest_assert_str_eq (g_ptr_array_index (execvp__args__captured, 0), "/bin/some-command");
mctest_assert_str_eq (g_ptr_array_index (execvp__args__captured, 1), "some parameter");
/* All exec* calls is mocked, so call to _exit() function with 127 status code it's a normal situation */
mctest_assert_int_eq (my_exit__status__captured, 127);
ck_assert_int_eq (my_exit__status__captured, 127);
}
/* *INDENT-OFF* */
END_TEST

View File

@ -46,20 +46,20 @@ START_TEST (fork_child_as_shell)
actual_value = my_system (EXECUTE_AS_SHELL, "/bin/shell", "some command");
/* then */
mctest_assert_int_eq (actual_value, 0);
ck_assert_int_eq (actual_value, 0);
VERIFY_SIGACTION_CALLS ();
VERIFY_SIGNAL_CALLS ();
mctest_assert_str_eq (execvp__file__captured, "/bin/shell");
mctest_assert_int_eq (execvp__args__captured->len, 3);
ck_assert_int_eq (execvp__args__captured->len, 3);
mctest_assert_str_eq (g_ptr_array_index (execvp__args__captured, 0), "/bin/shell");
mctest_assert_str_eq (g_ptr_array_index (execvp__args__captured, 1), "-c");
mctest_assert_str_eq (g_ptr_array_index (execvp__args__captured, 2), "some command");
/* All exec* calls is mocked, so call to _exit() function with 127 status code it's a normal situation */
mctest_assert_int_eq (my_exit__status__captured, 127);
ck_assert_int_eq (my_exit__status__captured, 127);
}
/* *INDENT-OFF* */
END_TEST

View File

@ -50,11 +50,11 @@ START_TEST (fork_fail)
actual_value = my_system (0, NULL, NULL);
/* then */
mctest_assert_int_eq (actual_value, -1);
ck_assert_int_eq (actual_value, -1);
VERIFY_SIGACTION_CALLS ();
mctest_assert_int_eq (signal_signum__captured->len, 0);
ck_assert_int_eq (signal_signum__captured->len, 0);
}
/* *INDENT-OFF* */
END_TEST

View File

@ -135,7 +135,7 @@ START_PARAMETRIZED_TEST (test_path_equal, test_path_equal_ds)
actual_result = vfs_path_equal (vpath1, vpath2);
/* then */
mctest_assert_int_eq (actual_result, data->expected_result);
ck_assert_int_eq (actual_result, data->expected_result);
vfs_path_free (vpath1, TRUE);
vfs_path_free (vpath2, TRUE);
@ -223,7 +223,7 @@ START_PARAMETRIZED_TEST (test_path_equal_len, test_path_equal_len_ds)
actual_result = vfs_path_equal_len (vpath1, vpath2, data->input_length);
/* then */
mctest_assert_int_eq (actual_result, data->expected_result);
ck_assert_int_eq (actual_result, data->expected_result);
vfs_path_free (vpath1, TRUE);
vfs_path_free (vpath2, TRUE);

View File

@ -113,7 +113,7 @@ START_PARAMETRIZED_TEST (test_path_length, test_path_length_ds)
actual_length = vfs_path_len (vpath);
/* then */
mctest_assert_int_eq (actual_length, data->expected_length);
ck_assert_int_eq (actual_length, data->expected_length);
vfs_path_free (vpath, TRUE);
}

View File

@ -160,7 +160,7 @@ START_PARAMETRIZED_TEST (test_vfs_path_tokens_count, test_vfs_path_tokens_count_
tokens_count = vfs_path_tokens_count (vpath);
/* then */
mctest_assert_int_eq (tokens_count, data->expected_token_count);
ck_assert_int_eq (tokens_count, data->expected_token_count);
vfs_path_free (vpath, TRUE);
}
@ -343,7 +343,7 @@ START_PARAMETRIZED_TEST (test_vfs_path_append_vpath, test_vfs_path_append_vpath_
vpath3 = vfs_path_append_vpath_new (vpath1, vpath2, NULL);
/* then */
mctest_assert_int_eq (vfs_path_elements_count (vpath3), data->expected_element_count);
ck_assert_int_eq (vfs_path_elements_count (vpath3), data->expected_element_count);
mctest_assert_str_eq (vfs_path_as_str (vpath3), data->expected_path);
vfs_path_free (vpath1, TRUE);
@ -391,7 +391,7 @@ START_PARAMETRIZED_TEST (test_vfs_path_relative, test_vfs_path_relative_ds)
vpath = vfs_path_from_str_flags (data->input_path, VPF_NO_CANON);
/* then */
mctest_assert_int_eq (vpath->relative, TRUE);
ck_assert_int_eq (vpath->relative, TRUE);
mctest_assert_str_eq (vfs_path_get_last_path_str (vpath), data->expected_last_path_in_element);
mctest_assert_str_eq (vfs_path_as_str (vpath), data->expected_path);
@ -418,7 +418,7 @@ START_PARAMETRIZED_TEST (test_vfs_path_relative_clone, test_vfs_path_relative_ds
cloned_vpath = vfs_path_clone (vpath);
/* then */
mctest_assert_int_eq (cloned_vpath->relative, TRUE);
ck_assert_int_eq (cloned_vpath->relative, TRUE);
mctest_assert_str_eq (vfs_path_get_last_path_str (cloned_vpath),
data->expected_last_path_in_element);
mctest_assert_str_eq (vfs_path_as_str (cloned_vpath), data->expected_path);

View File

@ -146,7 +146,7 @@ START_PARAMETRIZED_TEST (test_relative_cd, test_relative_cd_ds)
{
const vfs_path_element_t *element;
mctest_assert_int_eq (actual_result, 0);
ck_assert_int_eq (actual_result, 0);
element = vfs_path_get_by_index (vpath, -1);
mctest_assert_str_eq (element->path, data->expected_element_path);
vfs_path_free (vpath, TRUE);

View File

@ -104,7 +104,7 @@ START_TEST (test_mc_mkstemps)
/* then */
close (fd);
mctest_assert_int_ne (fd, -1);
ck_assert_int_ne (fd, -1);
ck_assert_msg (g_file_test
(vfs_path_as_str (pname_vpath), G_FILE_TEST_EXISTS | G_FILE_TEST_IS_REGULAR),
"\nNo such file: %s\n", vfs_path_as_str (pname_vpath));

View File

@ -177,9 +177,9 @@ START_PARAMETRIZED_TEST (test_vfs_adjust_stat, test_vfs_adjust_stat_ds)
vfs_adjust_stat (&expected_stat);
/* then */
mctest_assert_int_eq (data->etalon_stat.st_blocks, expected_stat.st_blocks);
ck_assert_int_eq (data->etalon_stat.st_blocks, expected_stat.st_blocks);
#else
mctest_assert_int_eq (0, 0);
ck_assert_int_eq (0, 0);
#endif /* HAVE_STRUCT_STAT_ST_BLOCKS */
}
/* *INDENT-OFF* */

View File

@ -274,37 +274,37 @@ START_PARAMETRIZED_TEST (test_vfs_parse_ls_lga, test_vfs_parse_ls_lga_ds)
vfs_parse_ls_lga (data->input_string, &test_stat, &filename, &linkname, &filepos);
/* then */
mctest_assert_int_eq (actual_result, data->expected_result);
ck_assert_int_eq (actual_result, data->expected_result);
mctest_assert_str_eq (filename, data->expected_filename);
mctest_assert_str_eq (linkname, data->expected_linkname);
mctest_assert_int_eq (etalon_stat.st_dev, test_stat.st_dev);
mctest_assert_int_eq (etalon_stat.st_ino, test_stat.st_ino);
mctest_assert_int_eq (etalon_stat.st_mode, test_stat.st_mode);
mctest_assert_int_eq (etalon_stat.st_uid, test_stat.st_uid);
mctest_assert_int_eq (etalon_stat.st_gid, test_stat.st_gid);
ck_assert_int_eq (etalon_stat.st_dev, test_stat.st_dev);
ck_assert_int_eq (etalon_stat.st_ino, test_stat.st_ino);
ck_assert_int_eq (etalon_stat.st_mode, test_stat.st_mode);
ck_assert_int_eq (etalon_stat.st_uid, test_stat.st_uid);
ck_assert_int_eq (etalon_stat.st_gid, test_stat.st_gid);
#ifdef HAVE_STRUCT_STAT_ST_RDEV
mctest_assert_int_eq (etalon_stat.st_rdev, test_stat.st_rdev);
ck_assert_int_eq (etalon_stat.st_rdev, test_stat.st_rdev);
#endif
mctest_assert_int_eq (etalon_stat.st_size, test_stat.st_size);
ck_assert_int_eq (etalon_stat.st_size, test_stat.st_size);
#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE
mctest_assert_int_eq (etalon_stat.st_blksize, test_stat.st_blksize);
ck_assert_int_eq (etalon_stat.st_blksize, test_stat.st_blksize);
#endif
#ifdef HAVE_STRUCT_STAT_ST_BLOCKS
mctest_assert_int_eq (etalon_stat.st_blocks, test_stat.st_blocks);
ck_assert_int_eq (etalon_stat.st_blocks, test_stat.st_blocks);
#endif
/* FIXME: these commented checks are related to time zone!
mctest_assert_int_eq (etalon_stat.st_atime, test_stat.st_atime);
mctest_assert_int_eq (etalon_stat.st_mtime, test_stat.st_mtime);
mctest_assert_int_eq (etalon_stat.st_ctime, test_stat.st_ctime);
ck_assert_int_eq (etalon_stat.st_atime, test_stat.st_atime);
ck_assert_int_eq (etalon_stat.st_mtime, test_stat.st_mtime);
ck_assert_int_eq (etalon_stat.st_ctime, test_stat.st_ctime);
*/
#ifdef HAVE_STRUCT_STAT_ST_MTIM
mctest_assert_int_eq (0, test_stat.st_atim.tv_nsec);
mctest_assert_int_eq (0, test_stat.st_mtim.tv_nsec);
mctest_assert_int_eq (0, test_stat.st_ctim.tv_nsec);
ck_assert_int_eq (0, test_stat.st_atim.tv_nsec);
ck_assert_int_eq (0, test_stat.st_mtim.tv_nsec);
ck_assert_int_eq (0, test_stat.st_ctim.tv_nsec);
#endif
}

View File

@ -182,7 +182,7 @@ START_PARAMETRIZED_TEST (test_from_to_string, test_from_to_string_ds)
path_element = vfs_path_get_by_index (vpath, -1);
/* then */
mctest_assert_int_eq (vpath_len, data->expected_elements_count);
ck_assert_int_eq (vpath_len, data->expected_elements_count);
mctest_assert_str_eq (actual_result, data->expected_result);
mctest_assert_ptr_eq (path_element->class, data->expected_vfs_class);
mctest_assert_str_eq (path_element->path, data->expected_element_path);

View File

@ -208,9 +208,9 @@ START_PARAMETRIZED_TEST (test_complete_engine_fill_completions,
/* then */
mctest_assert_str_eq (try_complete__text__captured, data->input_buffer);
mctest_assert_int_eq (try_complete__lc_start__captured, data->expected_start);
mctest_assert_int_eq (try_complete__lc_end__captured, data->expected_end);
mctest_assert_int_eq (try_complete__flags__captured, data->input_completion_flags);
ck_assert_int_eq (try_complete__lc_start__captured, data->expected_start);
ck_assert_int_eq (try_complete__lc_end__captured, data->expected_end);
ck_assert_int_eq (try_complete__flags__captured, data->input_completion_flags);
}
/* *INDENT-OFF* */
END_PARAMETRIZED_TEST

View File

@ -140,7 +140,7 @@ START_PARAMETRIZED_TEST (test_hotkey_equal,
result = hotkey_equal (data->hotkey1, data->hotkey2);
/* then */
mctest_assert_int_eq (result, data->expected_result);
ck_assert_int_eq (result, data->expected_result);
}
/* *INDENT-OFF* */
END_PARAMETRIZED_TEST

View File

@ -17,14 +17,6 @@
g_assert_cmpstr (actual_result, ==, etalon_result); \
}
#define mctest_assert_int_eq(actual_result, etalon_result) { \
ck_assert_int_eq (actual_result, etalon_result); \
}
#define mctest_assert_int_ne(actual_result, etalon_result) { \
ck_assert_int_ne (actual_result, etalon_result); \
}
#define mctest_assert_ptr_eq(actual_pointer, etalon_pointer) { \
ck_assert_msg ( actual_pointer == etalon_pointer, \
"%s(%p) pointer should be equal to %s(%p)\n", \

View File

@ -268,9 +268,9 @@ START_PARAMETRIZED_TEST (test_autocomplete, test_autocomplete_ds)
/* then */
mctest_assert_ptr_eq (edit_completion_dialog_show__edit, test_edit);
mctest_assert_int_eq (g_queue_get_length (edit_completion_dialog_show__compl),
data->expected_compl_word_count);
mctest_assert_int_eq (edit_completion_dialog_show__max_width, data->expected_max_width);
ck_assert_int_eq (g_queue_get_length (edit_completion_dialog_show__compl),
data->expected_compl_word_count);
ck_assert_int_eq (edit_completion_dialog_show__max_width, data->expected_max_width);
{
off_t i = 0;

View File

@ -156,15 +156,14 @@ START_TEST (do_open_external_editor_or_viewer)
/* check call to execute_get_external_cmd_opts_from_config() */
mctest_assert_str_eq (execute_external_cmd_opts__command__captured, "editor_or_viewer");
mctest_assert_int_eq (vfs_path_equal
(execute_external_cmd_opts__filename_vpath__captured, filename_vpath),
TRUE);
mctest_assert_int_eq (execute_external_cmd_opts__start_line__captured, 123);
ck_assert_int_eq (vfs_path_equal
(execute_external_cmd_opts__filename_vpath__captured, filename_vpath), TRUE);
ck_assert_int_eq (execute_external_cmd_opts__start_line__captured, 123);
/* check call to do_executev() */
mctest_assert_str_eq (do_executev__lc_shell__captured, "editor_or_viewer");
mctest_assert_int_eq (do_executev__flags__captured, EXECUTE_INTERNAL);
mctest_assert_int_eq (do_executev__argv__captured->len, 7);
ck_assert_int_eq (do_executev__flags__captured, EXECUTE_INTERNAL);
ck_assert_int_eq (do_executev__argv__captured->len, 7);
mctest_assert_str_eq (g_ptr_array_index (do_executev__argv__captured, 0),
"param 1 with spaces");

View File

@ -65,16 +65,16 @@ START_PARAMETRIZED_TEST (the_file_is_local, the_file_is_local_ds)
mctest_assert_str_eq (do_execute__lc_shell__captured, "cmd_for_local_file");
mctest_assert_str_eq (do_execute__command__captured, data->input_path);
mctest_assert_int_eq (vfs_file_is_local__vpath__captured->len, 1);
ck_assert_int_eq (vfs_file_is_local__vpath__captured->len, 1);
{
const vfs_path_t *tmp_vpath;
tmp_vpath = (data->input_path == NULL) ? vfs_get_raw_current_dir () : filename_vpath;
mctest_assert_int_eq (vfs_path_equal
(g_ptr_array_index (vfs_file_is_local__vpath__captured, 0),
tmp_vpath), TRUE);
ck_assert_int_eq (vfs_path_equal
(g_ptr_array_index (vfs_file_is_local__vpath__captured, 0),
tmp_vpath), TRUE);
}
mctest_assert_int_eq (do_execute__flags__captured, EXECUTE_INTERNAL);
ck_assert_int_eq (do_execute__flags__captured, EXECUTE_INTERNAL);
ck_assert_msg (mc_getlocalcopy__pathname_vpath__captured == NULL,
"\nFunction mc_getlocalcopy() shouldn't be called!");
@ -104,11 +104,11 @@ START_TEST (the_file_is_remote_but_empty)
mctest_assert_str_eq (do_execute__lc_shell__captured, NULL);
mctest_assert_str_eq (do_execute__command__captured, NULL);
mctest_assert_int_eq (vfs_file_is_local__vpath__captured->len, 2);
ck_assert_int_eq (vfs_file_is_local__vpath__captured->len, 2);
mctest_assert_int_eq (vfs_path_equal
(g_ptr_array_index (vfs_file_is_local__vpath__captured, 0),
vfs_get_raw_current_dir ()), TRUE);
ck_assert_int_eq (vfs_path_equal
(g_ptr_array_index (vfs_file_is_local__vpath__captured, 0),
vfs_get_raw_current_dir ()), TRUE);
ck_assert_msg (g_ptr_array_index (vfs_file_is_local__vpath__captured, 1) == NULL,
"\nParameter for second call to vfs_file_is_local() should be NULL!");
ck_assert_msg (mc_getlocalcopy__pathname_vpath__captured == NULL,
@ -142,14 +142,14 @@ START_TEST (the_file_is_remote_fail_to_create_local_copy)
mctest_assert_str_eq (do_execute__lc_shell__captured, NULL);
mctest_assert_str_eq (do_execute__command__captured, NULL);
mctest_assert_int_eq (vfs_file_is_local__vpath__captured->len, 1);
ck_assert_int_eq (vfs_file_is_local__vpath__captured->len, 1);
mctest_assert_int_eq (vfs_path_equal
(g_ptr_array_index (vfs_file_is_local__vpath__captured, 0),
filename_vpath), TRUE);
ck_assert_int_eq (vfs_path_equal
(g_ptr_array_index (vfs_file_is_local__vpath__captured, 0),
filename_vpath), TRUE);
mctest_assert_int_eq (vfs_path_equal
(mc_getlocalcopy__pathname_vpath__captured, filename_vpath), TRUE);
ck_assert_int_eq (vfs_path_equal
(mc_getlocalcopy__pathname_vpath__captured, filename_vpath), TRUE);
mctest_assert_str_eq (message_title__captured, _("Error"));
mctest_assert_str_eq (message_text__captured,
@ -186,28 +186,27 @@ START_TEST (the_file_is_remote)
mctest_assert_str_eq (do_execute__lc_shell__captured, "cmd_for_remote_file");
mctest_assert_str_eq (do_execute__command__captured, "/tmp/blabla-editme.txt");
mctest_assert_int_eq (vfs_file_is_local__vpath__captured->len, 1);
ck_assert_int_eq (vfs_file_is_local__vpath__captured->len, 1);
mctest_assert_int_eq (vfs_path_equal
(g_ptr_array_index (vfs_file_is_local__vpath__captured, 0),
filename_vpath), TRUE);
ck_assert_int_eq (vfs_path_equal
(g_ptr_array_index (vfs_file_is_local__vpath__captured, 0),
filename_vpath), TRUE);
mctest_assert_int_eq (vfs_path_equal
(mc_getlocalcopy__pathname_vpath__captured, filename_vpath), TRUE);
ck_assert_int_eq (vfs_path_equal
(mc_getlocalcopy__pathname_vpath__captured, filename_vpath), TRUE);
mctest_assert_int_eq (mc_stat__vpath__captured->len, 2);
ck_assert_int_eq (mc_stat__vpath__captured->len, 2);
mctest_assert_int_eq (vfs_path_equal
(g_ptr_array_index (mc_stat__vpath__captured, 0), local_vpath), TRUE);
mctest_assert_int_eq (vfs_path_equal
(g_ptr_array_index (mc_stat__vpath__captured, 0),
g_ptr_array_index (mc_stat__vpath__captured, 1)), TRUE);
ck_assert_int_eq (vfs_path_equal
(g_ptr_array_index (mc_stat__vpath__captured, 0), local_vpath), TRUE);
ck_assert_int_eq (vfs_path_equal
(g_ptr_array_index (mc_stat__vpath__captured, 0),
g_ptr_array_index (mc_stat__vpath__captured, 1)), TRUE);
mctest_assert_int_eq (vfs_path_equal
(mc_ungetlocalcopy__pathname_vpath__captured, filename_vpath), TRUE);
ck_assert_int_eq (vfs_path_equal
(mc_ungetlocalcopy__pathname_vpath__captured, filename_vpath), TRUE);
mctest_assert_int_eq (vfs_path_equal (mc_ungetlocalcopy__local_vpath__captured, local_vpath),
TRUE);
ck_assert_int_eq (vfs_path_equal (mc_ungetlocalcopy__local_vpath__captured, local_vpath), TRUE);
vfs_path_free (filename_vpath, TRUE);
vfs_path_free (local_vpath, TRUE);

View File

@ -147,7 +147,7 @@ START_PARAMETRIZED_TEST (test_empty_mean_home, test_empty_mean_home_ds)
/* then */
mctest_assert_str_eq (mc_config_get_home_dir__return_value,
vfs_path_as_str (do_cd__new_dir_vpath__captured));
mctest_assert_int_eq (do_cd__cd_type__captured, cd_parse_command);
ck_assert_int_eq (do_cd__cd_type__captured, cd_parse_command);
}
/* *INDENT-OFF* */
END_PARAMETRIZED_TEST

View File

@ -132,7 +132,7 @@ START_PARAMETRIZED_TEST (test_is_wildcarded, test_is_wildcarded_ds)
/* when */
actual_result = is_wildcarded (data->input_value);
/* then */
mctest_assert_int_eq (actual_result, data->expected_result);
ck_assert_int_eq (actual_result, data->expected_result);
}
/* *INDENT-OFF* */
END_PARAMETRIZED_TEST