| File src/utils/utils_nix.c changed (mode: 100644) (index 3ac157519..e540b4bc2) |
| ... |
... |
get_perm_string(char buf[], int len, mode_t mode) |
| 464 |
464 |
int |
int |
| 465 |
465 |
refers_to_slower_fs(const char from[], const char to[]) |
refers_to_slower_fs(const char from[], const char to[]) |
| 466 |
466 |
{ |
{ |
|
467 |
|
/* At least some tests don't need to know anything about this being |
|
468 |
|
* configurable and yet this code gets run from tests. Bail out if the value |
|
469 |
|
* isn't set, this is a well-defined behaviour anyway. */ |
|
470 |
|
if(is_null_or_empty(cfg.slow_fs_list)) |
|
471 |
|
{ |
|
472 |
|
return 0; |
|
473 |
|
} |
|
474 |
|
|
| 467 |
475 |
const int i = find_path_prefix_index(to, cfg.slow_fs_list); |
const int i = find_path_prefix_index(to, cfg.slow_fs_list); |
| 468 |
476 |
/* When destination is not on slow file system, no performance penalties are |
/* When destination is not on slow file system, no performance penalties are |
| 469 |
477 |
* expected. */ |
* expected. */ |
| |
| ... |
... |
refers_to_slower_fs(const char from[], const char to[]) |
| 479 |
487 |
int |
int |
| 480 |
488 |
is_on_slow_fs(const char full_path[], const char slowfs_specs[]) |
is_on_slow_fs(const char full_path[], const char slowfs_specs[]) |
| 481 |
489 |
{ |
{ |
|
490 |
|
/* Empty list optimization and bail out for some tests. */ |
|
491 |
|
if(is_null_or_empty(slowfs_specs)) |
|
492 |
|
{ |
|
493 |
|
return 0; |
|
494 |
|
} |
|
495 |
|
|
| 482 |
496 |
char fs_name[PATH_MAX + 1]; |
char fs_name[PATH_MAX + 1]; |
| 483 |
497 |
get_mount_point_traverser_state state = { |
get_mount_point_traverser_state state = { |
| 484 |
498 |
.type = MI_FS_TYPE, |
.type = MI_FS_TYPE, |
| |
| ... |
... |
is_on_slow_fs(const char full_path[], const char slowfs_specs[]) |
| 488 |
502 |
.curr_len = 0UL, |
.curr_len = 0UL, |
| 489 |
503 |
}; |
}; |
| 490 |
504 |
|
|
| 491 |
|
/* Empty list optimization. */ |
|
| 492 |
|
if(slowfs_specs[0] == '\0') |
|
| 493 |
|
{ |
|
| 494 |
|
return 0; |
|
| 495 |
|
} |
|
| 496 |
|
|
|
| 497 |
505 |
/* If slowfs equals "*" then all file systems are considered slow. On cygwin |
/* If slowfs equals "*" then all file systems are considered slow. On cygwin |
| 498 |
506 |
* obtaining list of mounts from /etc/mtab, which is linked to /proc/mounts, |
* obtaining list of mounts from /etc/mtab, which is linked to /proc/mounts, |
| 499 |
507 |
* is very slow in presence of network drives. */ |
* is very slow in presence of network drives. */ |
| File tests/commands/completion.c changed (mode: 100644) (index eb06c4dc3..39d7f04c6) |
| ... |
... |
SETUP() |
| 80 |
80 |
static int option_changed; |
static int option_changed; |
| 81 |
81 |
optval_t def = { .str_val = "/tmp" }; |
optval_t def = { .str_val = "/tmp" }; |
| 82 |
82 |
|
|
| 83 |
|
cfg.slow_fs_list = strdup(""); |
|
| 84 |
|
|
|
| 85 |
83 |
init_builtin_functions(); |
init_builtin_functions(); |
| 86 |
84 |
|
|
| 87 |
85 |
stats.line = wcsdup(L"set "); |
stats.line = wcsdup(L"set "); |
| |
| ... |
... |
TEARDOWN() |
| 121 |
119 |
|
|
| 122 |
120 |
restore_cwd(saved_cwd); |
restore_cwd(saved_cwd); |
| 123 |
121 |
|
|
| 124 |
|
update_string(&cfg.slow_fs_list, NULL); |
|
| 125 |
|
|
|
| 126 |
122 |
free(stats.line); |
free(stats.line); |
| 127 |
123 |
vle_opts_reset(); |
vle_opts_reset(); |
| 128 |
124 |
|
|
| File tests/commands/sync.c changed (mode: 100644) (index 399e70a88..9254a99d7) |
| 11 |
11 |
|
|
| 12 |
12 |
#include "../../src/compat/fs_limits.h" |
#include "../../src/compat/fs_limits.h" |
| 13 |
13 |
#include "../../src/compat/os.h" |
#include "../../src/compat/os.h" |
| 14 |
|
#include "../../src/cfg/config.h" |
|
| 15 |
14 |
#include "../../src/ui/column_view.h" |
#include "../../src/ui/column_view.h" |
| 16 |
15 |
#include "../../src/utils/fs.h" |
#include "../../src/utils/fs.h" |
| 17 |
16 |
#include "../../src/utils/path.h" |
#include "../../src/utils/path.h" |
| |
| ... |
... |
SETUP() |
| 31 |
30 |
|
|
| 32 |
31 |
cmds_init(); |
cmds_init(); |
| 33 |
32 |
|
|
| 34 |
|
cfg.slow_fs_list = strdup(""); |
|
| 35 |
|
|
|
| 36 |
33 |
view_setup(&lwin); |
view_setup(&lwin); |
| 37 |
34 |
view_setup(&rwin); |
view_setup(&rwin); |
| 38 |
35 |
|
|
| |
| ... |
... |
TEARDOWN() |
| 48 |
45 |
|
|
| 49 |
46 |
vle_cmds_reset(); |
vle_cmds_reset(); |
| 50 |
47 |
|
|
| 51 |
|
free(cfg.slow_fs_list); |
|
| 52 |
|
cfg.slow_fs_list = NULL; |
|
| 53 |
|
|
|
| 54 |
48 |
view_teardown(&lwin); |
view_teardown(&lwin); |
| 55 |
49 |
view_teardown(&rwin); |
view_teardown(&rwin); |
| 56 |
50 |
} |
} |
| File tests/fileops/suite.c changed (mode: 100644) (index b3ff0ab85..7685ec6a0) |
| ... |
... |
SETUP() |
| 36 |
36 |
init_undo_list_for_tests(&exec_func, &undo_levels); |
init_undo_list_for_tests(&exec_func, &undo_levels); |
| 37 |
37 |
|
|
| 38 |
38 |
cfg.use_system_calls = 1; |
cfg.use_system_calls = 1; |
| 39 |
|
cfg.slow_fs_list = strdup(""); |
|
| 40 |
39 |
cfg.delete_prg = strdup(""); |
cfg.delete_prg = strdup(""); |
| 41 |
40 |
|
|
| 42 |
41 |
#ifndef _WIN32 |
#ifndef _WIN32 |
| |
| ... |
... |
SETUP() |
| 58 |
57 |
|
|
| 59 |
58 |
TEARDOWN() |
TEARDOWN() |
| 60 |
59 |
{ |
{ |
| 61 |
|
free(cfg.slow_fs_list); |
|
| 62 |
60 |
free(cfg.delete_prg); |
free(cfg.delete_prg); |
| 63 |
61 |
free(cfg.shell); |
free(cfg.shell); |
| 64 |
62 |
free(cfg.shell_cmd_flag); |
free(cfg.shell_cmd_flag); |
| File tests/ior/suite.c changed (mode: 100644) (index 2ef32e68b..f78a2e5cf) |
| ... |
... |
SETUP() |
| 11 |
11 |
{ |
{ |
| 12 |
12 |
cfg.shell = strdup("/bin/bash"); |
cfg.shell = strdup("/bin/bash"); |
| 13 |
13 |
cfg.shell_cmd_flag = strdup("-c"); |
cfg.shell_cmd_flag = strdup("-c"); |
| 14 |
|
cfg.slow_fs_list = strdup(""); |
|
| 15 |
14 |
} |
} |
| 16 |
15 |
|
|
| 17 |
16 |
TEARDOWN() |
TEARDOWN() |
| 18 |
17 |
{ |
{ |
| 19 |
18 |
free(cfg.shell_cmd_flag); |
free(cfg.shell_cmd_flag); |
| 20 |
19 |
free(cfg.shell); |
free(cfg.shell); |
| 21 |
|
free(cfg.slow_fs_list); |
|
| 22 |
20 |
} |
} |
| 23 |
21 |
|
|
| 24 |
22 |
/* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ |
/* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ |
| File tests/misc/filtering.c changed (mode: 100644) (index d767f9adb..a653d6d6e) |
| ... |
... |
SETUP_ONCE() |
| 40 |
40 |
SETUP() |
SETUP() |
| 41 |
41 |
{ |
{ |
| 42 |
42 |
update_string(&cfg.fuse_home, "no"); |
update_string(&cfg.fuse_home, "no"); |
| 43 |
|
update_string(&cfg.slow_fs_list, ""); |
|
| 44 |
43 |
|
|
| 45 |
44 |
cfg.filter_inverted_by_default = 1; |
cfg.filter_inverted_by_default = 1; |
| 46 |
45 |
|
|
| |
| ... |
... |
SETUP() |
| 74 |
73 |
|
|
| 75 |
74 |
TEARDOWN() |
TEARDOWN() |
| 76 |
75 |
{ |
{ |
| 77 |
|
update_string(&cfg.slow_fs_list, NULL); |
|
| 78 |
76 |
update_string(&cfg.fuse_home, NULL); |
update_string(&cfg.fuse_home, NULL); |
| 79 |
77 |
|
|
| 80 |
78 |
view_teardown(&lwin); |
view_teardown(&lwin); |
| File tests/misc/flist_custom.c changed (mode: 100644) (index 0cea89be6..ab1aa67fd) |
| ... |
... |
SETUP_ONCE() |
| 52 |
52 |
SETUP() |
SETUP() |
| 53 |
53 |
{ |
{ |
| 54 |
54 |
update_string(&cfg.fuse_home, "no"); |
update_string(&cfg.fuse_home, "no"); |
| 55 |
|
update_string(&cfg.slow_fs_list, ""); |
|
| 56 |
55 |
|
|
| 57 |
56 |
/* So that nothing is written into directory history. */ |
/* So that nothing is written into directory history. */ |
| 58 |
57 |
rwin.list_rows = 0; |
rwin.list_rows = 0; |
| |
| ... |
... |
SETUP() |
| 69 |
68 |
|
|
| 70 |
69 |
TEARDOWN() |
TEARDOWN() |
| 71 |
70 |
{ |
{ |
| 72 |
|
update_string(&cfg.slow_fs_list, NULL); |
|
| 73 |
71 |
update_string(&cfg.fuse_home, NULL); |
update_string(&cfg.fuse_home, NULL); |
| 74 |
72 |
|
|
| 75 |
73 |
view_teardown(&lwin); |
view_teardown(&lwin); |
| File tests/misc/flist_hist.c changed (mode: 100644) (index 5dea3749e..9f54c0371) |
| 27 |
27 |
|
|
| 28 |
28 |
SETUP() |
SETUP() |
| 29 |
29 |
{ |
{ |
| 30 |
|
update_string(&cfg.slow_fs_list, ""); |
|
| 31 |
|
|
|
| 32 |
30 |
view_setup(&lwin); |
view_setup(&lwin); |
| 33 |
31 |
strcpy(lwin.curr_dir, "/lwin"); |
strcpy(lwin.curr_dir, "/lwin"); |
| 34 |
32 |
append_view_entry(&lwin, "lfile0"); |
append_view_entry(&lwin, "lfile0"); |
| |
| ... |
... |
SETUP() |
| 42 |
40 |
|
|
| 43 |
41 |
TEARDOWN() |
TEARDOWN() |
| 44 |
42 |
{ |
{ |
| 45 |
|
update_string(&cfg.slow_fs_list, NULL); |
|
| 46 |
|
|
|
| 47 |
43 |
cfg_resize_histories(0); |
cfg_resize_histories(0); |
| 48 |
44 |
|
|
| 49 |
45 |
view_teardown(&lwin); |
view_teardown(&lwin); |
| File tests/misc/flist_reload.c changed (mode: 100644) (index 01feddba0..42606e565) |
| ... |
... |
SETUP() |
| 21 |
21 |
|
|
| 22 |
22 |
assert_success(chdir(SANDBOX_PATH)); |
assert_success(chdir(SANDBOX_PATH)); |
| 23 |
23 |
|
|
| 24 |
|
update_string(&cfg.slow_fs_list, ""); |
|
| 25 |
|
|
|
| 26 |
24 |
assert_true(get_cwd(cwd, sizeof(cwd)) == cwd); |
assert_true(get_cwd(cwd, sizeof(cwd)) == cwd); |
| 27 |
25 |
|
|
| 28 |
26 |
view_setup(view); |
view_setup(view); |
| |
| ... |
... |
TEARDOWN() |
| 44 |
42 |
(void)rmdir("1"); |
(void)rmdir("1"); |
| 45 |
43 |
(void)rmdir("2"); |
(void)rmdir("2"); |
| 46 |
44 |
(void)rmdir("3"); |
(void)rmdir("3"); |
| 47 |
|
|
|
| 48 |
|
update_string(&cfg.slow_fs_list, NULL); |
|
| 49 |
45 |
} |
} |
| 50 |
46 |
|
|
| 51 |
47 |
TEST(exact_match_is_preferred) |
TEST(exact_match_is_preferred) |
| File tests/misc/fuse.c changed (mode: 100644) (index 4cb093585..85027cf2a) |
| ... |
... |
SETUP() |
| 50 |
50 |
|
|
| 51 |
51 |
replace_string(&cfg.fuse_home, fuse_home); |
replace_string(&cfg.fuse_home, fuse_home); |
| 52 |
52 |
replace_string(&cfg.shell, "/bin/sh"); |
replace_string(&cfg.shell, "/bin/sh"); |
| 53 |
|
replace_string(&cfg.slow_fs_list, ""); |
|
| 54 |
53 |
curr_stats.fuse_umount_cmd = "true"; |
curr_stats.fuse_umount_cmd = "true"; |
| 55 |
54 |
|
|
| 56 |
55 |
saved_cwd = save_cwd(); |
saved_cwd = save_cwd(); |
| |
| ... |
... |
TEARDOWN() |
| 66 |
65 |
|
|
| 67 |
66 |
update_string(&cfg.fuse_home, NULL); |
update_string(&cfg.fuse_home, NULL); |
| 68 |
67 |
update_string(&cfg.shell, NULL); |
update_string(&cfg.shell, NULL); |
| 69 |
|
update_string(&cfg.slow_fs_list, NULL); |
|
| 70 |
68 |
curr_stats.fuse_umount_cmd = NULL; |
curr_stats.fuse_umount_cmd = NULL; |
| 71 |
69 |
|
|
| 72 |
70 |
restore_cwd(saved_cwd); |
restore_cwd(saved_cwd); |
| File tests/misc/integration.c changed (mode: 100644) (index 0d36d264b..192696f26) |
| ... |
... |
static int bad_editor_call(const char type[], const char title[], |
| 32 |
32 |
SETUP() |
SETUP() |
| 33 |
33 |
{ |
{ |
| 34 |
34 |
update_string(&cfg.shell, ""); |
update_string(&cfg.shell, ""); |
| 35 |
|
update_string(&cfg.slow_fs_list, ""); |
|
| 36 |
35 |
assert_success(stats_init(&cfg)); |
assert_success(stats_init(&cfg)); |
| 37 |
36 |
} |
} |
| 38 |
37 |
|
|
| 39 |
38 |
TEARDOWN() |
TEARDOWN() |
| 40 |
39 |
{ |
{ |
| 41 |
40 |
update_string(&cfg.shell, NULL); |
update_string(&cfg.shell, NULL); |
| 42 |
|
update_string(&cfg.slow_fs_list, NULL); |
|
| 43 |
41 |
} |
} |
| 44 |
42 |
|
|
| 45 |
43 |
/* Because of fmemopen(). */ |
/* Because of fmemopen(). */ |
| File tests/misc/marks.c changed (mode: 100644) (index accd1a538..eac69da7b) |
| 5 |
5 |
|
|
| 6 |
6 |
#include <test-utils.h> |
#include <test-utils.h> |
| 7 |
7 |
|
|
| 8 |
|
#include "../../src/cfg/config.h" |
|
| 9 |
8 |
#include "../../src/compat/os.h" |
#include "../../src/compat/os.h" |
| 10 |
9 |
#include "../../src/ui/ui.h" |
#include "../../src/ui/ui.h" |
| 11 |
10 |
#include "../../src/marks.h" |
#include "../../src/marks.h" |
| |
| ... |
... |
static int calls; |
| 23 |
22 |
|
|
| 24 |
23 |
SETUP() |
SETUP() |
| 25 |
24 |
{ |
{ |
| 26 |
|
cfg.slow_fs_list = strdup(""); |
|
| 27 |
25 |
lwin.list_pos = 0; |
lwin.list_pos = 0; |
| 28 |
26 |
lwin.column_count = 1; |
lwin.column_count = 1; |
| 29 |
27 |
rwin.list_pos = 0; |
rwin.list_pos = 0; |
| |
| ... |
... |
SETUP() |
| 34 |
32 |
|
|
| 35 |
33 |
TEARDOWN() |
TEARDOWN() |
| 36 |
34 |
{ |
{ |
| 37 |
|
free(cfg.slow_fs_list); |
|
| 38 |
|
cfg.slow_fs_list = NULL; |
|
| 39 |
|
|
|
| 40 |
35 |
marks_clear_all(); |
marks_clear_all(); |
| 41 |
36 |
} |
} |
| 42 |
37 |
|
|
| File tests/misc/running.c changed (mode: 100644) (index 7dca74b18..675ef5802) |
| ... |
... |
SETUP() |
| 47 |
47 |
#endif |
#endif |
| 48 |
48 |
|
|
| 49 |
49 |
update_string(&cfg.vi_command, "echo"); |
update_string(&cfg.vi_command, "echo"); |
| 50 |
|
update_string(&cfg.slow_fs_list, ""); |
|
| 51 |
50 |
update_string(&cfg.fuse_home, ""); |
update_string(&cfg.fuse_home, ""); |
| 52 |
51 |
|
|
| 53 |
52 |
stats_update_shell_type(cfg.shell); |
stats_update_shell_type(cfg.shell); |
| |
| ... |
... |
TEARDOWN() |
| 76 |
75 |
|
|
| 77 |
76 |
ft_reset(0); |
ft_reset(0); |
| 78 |
77 |
update_string(&cfg.vi_command, NULL); |
update_string(&cfg.vi_command, NULL); |
| 79 |
|
update_string(&cfg.slow_fs_list, NULL); |
|
| 80 |
78 |
update_string(&cfg.fuse_home, NULL); |
update_string(&cfg.fuse_home, NULL); |
| 81 |
79 |
} |
} |
| 82 |
80 |
|
|
| File tests/misc/sort.c changed (mode: 100644) (index c01612cda..ac6f9115e) |
| ... |
... |
TEST(symlink_to_dir, IF(not_windows)) |
| 70 |
70 |
lwin.dir_entry[2].origin = lwin.curr_dir; |
lwin.dir_entry[2].origin = lwin.curr_dir; |
| 71 |
71 |
lwin.dir_entry[2].dir_link = 1; |
lwin.dir_entry[2].dir_link = 1; |
| 72 |
72 |
|
|
| 73 |
|
cfg.slow_fs_list = strdup(""); |
|
| 74 |
|
|
|
| 75 |
73 |
sort_view(&lwin); |
sort_view(&lwin); |
| 76 |
74 |
|
|
| 77 |
|
free(cfg.slow_fs_list); |
|
| 78 |
|
cfg.slow_fs_list = NULL; |
|
| 79 |
|
|
|
| 80 |
75 |
assert_string_equal("self", lwin.dir_entry[0].name); |
assert_string_equal("self", lwin.dir_entry[0].name); |
| 81 |
76 |
|
|
| 82 |
77 |
assert_int_equal(0, unlink("self")); |
assert_int_equal(0, unlink("self")); |