| File tests/misc/chase_links.c changed (mode: 100644) (index f919e44f3..4c45bfe9c) |
| 13 |
13 |
#include "../../src/compat/fs_limits.h" |
#include "../../src/compat/fs_limits.h" |
| 14 |
14 |
#include "../../src/filelist.h" |
#include "../../src/filelist.h" |
| 15 |
15 |
#include "../../src/filtering.h" |
#include "../../src/filtering.h" |
| 16 |
|
#include "../../src/utils/dynarray.h" |
|
| 17 |
16 |
#include "../../src/utils/fs.h" |
#include "../../src/utils/fs.h" |
| 18 |
|
#include "../../src/utils/matcher.h" |
|
| 19 |
17 |
#include "../../src/utils/path.h" |
#include "../../src/utils/path.h" |
| 20 |
18 |
#include "../../src/utils/str.h" |
#include "../../src/utils/str.h" |
| 21 |
19 |
#include "../../src/cmd_core.h" |
#include "../../src/cmd_core.h" |
| 22 |
20 |
|
|
| 23 |
|
static void init_view(view_t *view); |
|
| 24 |
|
static void free_view(view_t *view); |
|
| 25 |
|
|
|
| 26 |
21 |
SETUP() |
SETUP() |
| 27 |
22 |
{ |
{ |
| 28 |
23 |
assert_success(chdir(SANDBOX_PATH)); |
assert_success(chdir(SANDBOX_PATH)); |
| |
| ... |
... |
SETUP() |
| 34 |
29 |
|
|
| 35 |
30 |
cfg.chase_links = 1; |
cfg.chase_links = 1; |
| 36 |
31 |
|
|
| 37 |
|
init_view(&lwin); |
|
| 38 |
|
init_view(&rwin); |
|
|
32 |
|
view_setup(&lwin); |
|
33 |
|
view_setup(&rwin); |
| 39 |
34 |
} |
} |
| 40 |
35 |
|
|
| 41 |
36 |
TEARDOWN() |
TEARDOWN() |
| |
| ... |
... |
TEARDOWN() |
| 44 |
39 |
|
|
| 45 |
40 |
cfg.chase_links = 0; |
cfg.chase_links = 0; |
| 46 |
41 |
|
|
| 47 |
|
free_view(&lwin); |
|
| 48 |
|
free_view(&rwin); |
|
| 49 |
|
} |
|
| 50 |
|
|
|
| 51 |
|
static void |
|
| 52 |
|
init_view(view_t *view) |
|
| 53 |
|
{ |
|
| 54 |
|
char *error; |
|
| 55 |
|
|
|
| 56 |
|
filter_init(&view->local_filter.filter, 1); |
|
| 57 |
|
assert_non_null(view->manual_filter = matcher_alloc("", 0, 0, "", &error)); |
|
| 58 |
|
filter_init(&view->auto_filter, 1); |
|
| 59 |
|
|
|
| 60 |
|
view->dir_entry = NULL; |
|
| 61 |
|
view->list_rows = 0; |
|
| 62 |
|
|
|
| 63 |
|
view->window_rows = 1; |
|
| 64 |
|
view->sort[0] = SK_NONE; |
|
| 65 |
|
ui_view_sort_list_ensure_well_formed(view, view->sort); |
|
| 66 |
|
} |
|
| 67 |
|
|
|
| 68 |
|
static void |
|
| 69 |
|
free_view(view_t *view) |
|
| 70 |
|
{ |
|
| 71 |
|
int i; |
|
| 72 |
|
|
|
| 73 |
|
for(i = 0; i < view->list_rows; ++i) |
|
| 74 |
|
{ |
|
| 75 |
|
free(view->dir_entry[i].name); |
|
| 76 |
|
} |
|
| 77 |
|
dynarray_free(view->dir_entry); |
|
| 78 |
|
|
|
| 79 |
|
filter_dispose(&view->local_filter.filter); |
|
| 80 |
|
matcher_free(view->manual_filter); |
|
| 81 |
|
view->manual_filter = NULL; |
|
| 82 |
|
filter_dispose(&view->auto_filter); |
|
|
42 |
|
view_teardown(&lwin); |
|
43 |
|
view_teardown(&rwin); |
| 83 |
44 |
} |
} |
| 84 |
45 |
|
|
| 85 |
46 |
TEST(link_is_not_resolved_by_default, IF(not_windows)) |
TEST(link_is_not_resolved_by_default, IF(not_windows)) |