xaizek / vifm (License: GPLv2+) (since 2018-12-07)
Vifm is a file manager with curses interface, which provides Vi[m]-like environment for managing objects within file systems, extended with some useful ideas from mutt.
Commit 31d4b6acf1b2989d0001df7b8fcfa8561f4eb10f

Extract create_file() to tests/misc/utils
Creates file at the path.
Author: xaizek
Author date (UTC): 2016-01-14 14:43
Committer name: xaizek
Committer date (UTC): 2016-01-14 14:43
Parent(s): 69008795b8e687369628b768eafb113508d8d787
Signing key:
Tree: 275784826eb06db1142269bb02643a51d561cc72
File Lines added Lines deleted
tests/misc/utils.c 12 0
tests/misc/utils.h 3 0
tests/misc/view_dir.c 2 12
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 : */
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/vifm

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/vifm

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master