| File tests/misc/utils.c changed (mode: 100644) (index 12ffd6ee8..009da6375) |
| 1 |
1 |
#include "utils.h" |
#include "utils.h" |
| 2 |
2 |
|
|
| 3 |
3 |
#include <stddef.h> /* NULL */ |
#include <stddef.h> /* NULL */ |
|
4 |
|
#include <stdio.h> /* fclose() fopen() */ |
| 4 |
5 |
#include <string.h> /* memset() strcpy() */ |
#include <string.h> /* memset() strcpy() */ |
| 5 |
6 |
|
|
| 6 |
7 |
#include "../../src/cfg/config.h" |
#include "../../src/cfg/config.h" |
| |
| ... |
... |
view_teardown(FileView *view) |
| 95 |
96 |
filter_dispose(&view->manual_filter); |
filter_dispose(&view->manual_filter); |
| 96 |
97 |
} |
} |
| 97 |
98 |
|
|
|
99 |
|
void |
|
100 |
|
create_file(const char path[]) |
|
101 |
|
{ |
|
102 |
|
FILE *const f = fopen(path, "w"); |
|
103 |
|
assert_non_null(f); |
|
104 |
|
if(f != NULL) |
|
105 |
|
{ |
|
106 |
|
fclose(f); |
|
107 |
|
} |
|
108 |
|
} |
|
109 |
|
|
| 98 |
110 |
/* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ |
/* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ |
| 99 |
111 |
/* vim: set cinoptions+=t0 filetype=c : */ |
/* vim: set cinoptions+=t0 filetype=c : */ |
| File tests/misc/utils.h changed (mode: 100644) (index 07e8737d5..d6a439b06) |
| ... |
... |
void view_setup(FileView *view); |
| 15 |
15 |
/* Frees resources of the view. */ |
/* Frees resources of the view. */ |
| 16 |
16 |
void view_teardown(FileView *view); |
void view_teardown(FileView *view); |
| 17 |
17 |
|
|
|
18 |
|
/* Creates file at the path. */ |
|
19 |
|
void create_file(const char path[]); |
|
20 |
|
|
| 18 |
21 |
#endif /* VIFM_TESTS__UTILS_H__ */ |
#endif /* VIFM_TESTS__UTILS_H__ */ |
| 19 |
22 |
|
|
| 20 |
23 |
/* 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/view_dir.c changed (mode: 100644) (index 79410608a..44a020b1b) |
| 2 |
2 |
|
|
| 3 |
3 |
#include <unistd.h> /* rmdir() */ |
#include <unistd.h> /* rmdir() */ |
| 4 |
4 |
|
|
| 5 |
|
#include <stdio.h> /* fclose() fopen() remove() */ |
|
|
5 |
|
#include <stdio.h> /* remove() */ |
| 6 |
6 |
|
|
| 7 |
7 |
#include "../../src/compat/os.h" |
#include "../../src/compat/os.h" |
| 8 |
8 |
#include "../../src/ui/quickview.h" |
#include "../../src/ui/quickview.h" |
| 9 |
9 |
#include "../../src/utils/string_array.h" |
#include "../../src/utils/string_array.h" |
| 10 |
10 |
|
|
| 11 |
|
static void create_file(const char file[]); |
|
|
11 |
|
#include "utils.h" |
| 12 |
12 |
|
|
| 13 |
13 |
SETUP() |
SETUP() |
| 14 |
14 |
{ |
{ |
| |
| ... |
... |
TEST(multiple_non_empty_dirs_have_correct_prefixes_plus_sorting) |
| 182 |
182 |
assert_success(rmdir("dir")); |
assert_success(rmdir("dir")); |
| 183 |
183 |
} |
} |
| 184 |
184 |
|
|
| 185 |
|
static void |
|
| 186 |
|
create_file(const char file[]) |
|
| 187 |
|
{ |
|
| 188 |
|
FILE *const f = fopen(file, "w"); |
|
| 189 |
|
if(f != NULL) |
|
| 190 |
|
{ |
|
| 191 |
|
fclose(f); |
|
| 192 |
|
} |
|
| 193 |
|
} |
|
| 194 |
|
|
|
| 195 |
185 |
/* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ |
/* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ |
| 196 |
186 |
/* vim: set cinoptions+=t0 filetype=c : */ |
/* vim: set cinoptions+=t0 filetype=c : */ |