Skip to content

Commit

Permalink
WIP: tests
Browse files Browse the repository at this point in the history
Signed-off-by: Yury V. Zaytsev <[email protected]>
  • Loading branch information
zyv committed Aug 15, 2024
1 parent 34f9ce2 commit bb133dd
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 14 deletions.
2 changes: 1 addition & 1 deletion lib/mcconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ void mc_config_deinit_config_paths (void);

const char *mc_config_get_data_path (void);
const char *mc_config_get_cache_path (void);
const char *mc_config_get_home_dir (void);
const char *mc_config_get_home_dir (void) __attribute__((weak));
const char *mc_config_get_path (void);
char *mc_config_get_full_path (const char *config_name);
vfs_path_t *mc_config_get_full_vpath (const char *config_name);
Expand Down
2 changes: 1 addition & 1 deletion lib/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ void mc_pclose (mc_pipe_t * p, GError ** error);

GString *mc_pstream_get_string (mc_pipe_stream_t * ps);

void my_exit (int status);
void my_exit (int status) __attribute__((weak));
void save_stop_handler (void);

/* Tilde expansion */
Expand Down
2 changes: 1 addition & 1 deletion lib/vfs/interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ mc_closedir (DIR *dirp)
/* *INDENT-OFF* */

#define MC_STATOP(name) \
int mc_##name (const vfs_path_t *vpath, struct stat *buf) \
int mc_##name (const vfs_path_t *vpath, struct stat *buf) __attribute__((weak)) \
{ \
int result = -1; \
struct vfs_class *me; \
Expand Down
2 changes: 1 addition & 1 deletion lib/vfs/utilvfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ vfs_path_element_t *vfs_url_split (const char *path, int default_port, vfs_url_f
int vfs_split_text (char *p);

int vfs_mkstemps (vfs_path_t ** pname_vpath, const char *prefix, const char *basename);
void vfs_die (const char *msg);
void vfs_die (const char *msg) __attribute__((weak));
char *vfs_get_password (const char *msg);

char *vfs_get_local_username (void);
Expand Down
2 changes: 1 addition & 1 deletion lib/widget/wtools.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ WDialog *create_message (int flags, const char *title, const char *text, ...)
G_GNUC_PRINTF (3, 4);

/* Show message box, background safe */
void message (int flags, const char *title, const char *text, ...) G_GNUC_PRINTF (3, 4);
void message (int flags, const char *title, const char *text, ...) G_GNUC_PRINTF (3, 4) __attribute__((weak));
/* *INDENT-ON* */

gboolean mc_error_message (GError ** mcerror, int *code);
Expand Down
10 changes: 1 addition & 9 deletions m4.include/mc-tests.m4
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,7 @@ AC_DEFUN([mc_UNIT_TESTS],[
#include <signal.h>
])
# on cygwin, the linker does not accept the "-z" option
case $host_os in
cygwin*)
TESTS_LDFLAGS="-Wl,--allow-multiple-definition"
;;
*)
TESTS_LDFLAGS="-Wl,-z,muldefs"
;;
esac
# TODO: check weak attribute?
AC_SUBST(TESTS_LDFLAGS)
])
4 changes: 4 additions & 0 deletions tests/lib/utilunix__my_system-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ static sigset_t *sigemptyset_set__captured;
/* @ThenReturnValue */
static int sigemptyset__return_value = 0;

#ifdef sigemptyset
#undef sigemptyset
#endif

/* @Mock */
int
sigemptyset (sigset_t *set)
Expand Down

0 comments on commit bb133dd

Please sign in to comment.