TEARDOWN() { free(cfg.slow_fs_list); free(cfg.delete_prg); reset_undo_list(); }
static void test_disbalance(void) { static int undo_levels = 10; init_undo_list(&execute_fail, &undo_levels); reset_undo_list(); cmd_group_begin("msg0"); assert_int_equal(0, add_operation(OP_COPY, NULL, NULL, "do_msg0", "undo_msg0")); cmd_group_end(); cmd_group_begin("msg1"); assert_int_equal(0, add_operation(OP_MOVE, NULL, NULL, "do_msg1", "undo_msg1")); cmd_group_end(); assert_int_equal(0, undo_group()); assert_int_equal(-3, undo_group()); assert_int_equal(-1, undo_group()); assert_int_equal(-4, redo_group()); assert_int_equal(0, redo_group()); assert_int_equal(-1, redo_group()); }
static void test_cmd_1undo_1redo(void) { static int undo_levels = 10; reset_undo_list(); init_undo_list(&exec_dummy, &undo_levels); cmd_group_begin("msg0"); assert_int_equal(0, add_operation(OP_MOVE, NULL, NULL, "do_msg0", "undo_msg0")); cmd_group_end(); assert_int_equal(0, undo_group()); assert_int_equal(0, redo_group()); }
static void teardown(void) { reset_undo_list(); }
TEARDOWN() { free(cfg.slow_fs_list); reset_undo_list(); }
void vifm_restart(void) { FileView *tmp_view; curr_stats.restart_in_progress = 1; /* All user mappings in all modes. */ vle_keys_user_clear(); /* User defined commands. */ execute_cmd("comclear"); /* Autocommands. */ vle_aucmd_remove(NULL, NULL); /* Directory histories. */ ui_view_clear_history(&lwin); ui_view_clear_history(&rwin); /* All kinds of history. */ (void)hist_reset(&cfg.search_hist, cfg.history_len); (void)hist_reset(&cfg.cmd_hist, cfg.history_len); (void)hist_reset(&cfg.prompt_hist, cfg.history_len); (void)hist_reset(&cfg.filter_hist, cfg.history_len); cfg.history_len = 0; /* Session status. Must be reset _before_ options, because options take some * of values from status. */ (void)reset_status(&cfg); /* Options of current pane. */ reset_options_to_default(); /* Options of other pane. */ tmp_view = curr_view; curr_view = other_view; load_view_options(other_view); reset_options_to_default(); curr_view = tmp_view; /* File types and viewers. */ ft_reset(curr_stats.exec_env_type == EET_EMULATOR_WITH_X); /* Undo list. */ reset_undo_list(); /* Directory stack. */ dir_stack_clear(); /* Registers. */ regs_reset(); /* Clear all marks and bookmarks. */ clear_all_marks(); bmarks_clear(); /* Reset variables. */ clear_envvars(); init_variables(); /* This update is needed as clear_variables() will reset $PATH. */ update_path_env(1); reset_views(); read_info_file(1); flist_hist_save(&lwin, NULL, NULL, -1); flist_hist_save(&rwin, NULL, NULL, -1); /* Color schemes. */ if(stroscmp(curr_stats.color_scheme, DEF_CS_NAME) != 0 && cs_exists(curr_stats.color_scheme)) { if(cs_load_primary(curr_stats.color_scheme) != 0) { cs_load_defaults(); } } else { cs_load_defaults(); } cs_load_pairs(); cfg_load(); exec_startup_commands(&vifm_args); curr_stats.restart_in_progress = 0; /* Trigger auto-commands for initial directories. */ vle_aucmd_execute("DirEnter", lwin.curr_dir, &lwin); vle_aucmd_execute("DirEnter", rwin.curr_dir, &rwin); update_screen(UT_REDRAW); }