1 #ifndef VIFM_TESTS__UTILS_H__ 2 #define VIFM_TESTS__UTILS_H__ 3 4 #include <stddef.h> /* size_t */ 5 6 struct view_t; 7 8 /* Initializes view with safe defaults. */ 9 void view_setup(struct view_t *view); 10 11 /* Frees resources of the view. */ 12 void view_teardown(struct view_t *view); 13 14 /* Creates empty file at specified path. */ 15 void create_empty_file(const char path[]); 16 17 /* Creates empty directory at specified path. */ 18 void create_empty_dir(const char path[]); 19 20 /* Waits termination of all background tasks. */ 21 void wait_for_bg(void); 22 23 /* Writes absolute path to the sandbox into the buffer. */ 24 void set_to_sandbox_path(char buf[], size_t buf_len); 25 26 /* Either puts base/sub or cwd/base/sub into the buf. */ 27 void make_abs_path(char buf[], size_t buf_len, const char base[], 28 const char sub[], const char cwd[]); 29 30 /* Whether running on non-Windows. Returns non-zero if so, otherwise zero is 31 * returned. */ 32 int not_windows(void); 33 34 #endif /* VIFM_TESTS__UTILS_H__ */ 35 36 /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ 37 /* vim: set cinoptions+=t0 : */ 38