提交 3bfe72e3 编写于 作者: A Andrea Bolognani

tests: Stop mocking canonicalize_file_name()

We're using virFileCanonicalizePath() everywhere now, so
mocking this function has become entirely pointless.
Signed-off-by: NAndrea Bolognani <abologna@redhat.com>
Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
上级 42673931
...@@ -39,7 +39,6 @@ static int (*real_lstat)(const char *path, struct stat *sb); ...@@ -39,7 +39,6 @@ static int (*real_lstat)(const char *path, struct stat *sb);
static int (*real___lxstat)(int ver, const char *path, struct stat *sb); static int (*real___lxstat)(int ver, const char *path, struct stat *sb);
static int (*real_stat)(const char *path, struct stat *sb); static int (*real_stat)(const char *path, struct stat *sb);
static int (*real___xstat)(int ver, const char *path, struct stat *sb); static int (*real___xstat)(int ver, const char *path, struct stat *sb);
static char *(*real_canonicalize_file_name)(const char *path);
static int (*real_open)(const char *path, int flags, ...); static int (*real_open)(const char *path, int flags, ...);
static int (*real_close)(int fd); static int (*real_close)(int fd);
static DIR * (*real_opendir)(const char *name); static DIR * (*real_opendir)(const char *name);
...@@ -811,7 +810,6 @@ init_syms(void) ...@@ -811,7 +810,6 @@ init_syms(void)
VIR_MOCK_REAL_INIT(access); VIR_MOCK_REAL_INIT(access);
VIR_MOCK_REAL_INIT_ALT(lstat, __lxstat); VIR_MOCK_REAL_INIT_ALT(lstat, __lxstat);
VIR_MOCK_REAL_INIT_ALT(stat, __xstat); VIR_MOCK_REAL_INIT_ALT(stat, __xstat);
VIR_MOCK_REAL_INIT(canonicalize_file_name);
VIR_MOCK_REAL_INIT(open); VIR_MOCK_REAL_INIT(open);
VIR_MOCK_REAL_INIT(close); VIR_MOCK_REAL_INIT(close);
VIR_MOCK_REAL_INIT(opendir); VIR_MOCK_REAL_INIT(opendir);
...@@ -969,25 +967,6 @@ stat(const char *path, struct stat *sb) ...@@ -969,25 +967,6 @@ stat(const char *path, struct stat *sb)
return ret; return ret;
} }
char *
canonicalize_file_name(const char *path)
{
char *ret;
init_syms();
if (STRPREFIX(path, SYSFS_PCI_PREFIX)) {
char *newpath;
if (getrealpath(&newpath, path) < 0)
return NULL;
ret = real_canonicalize_file_name(newpath);
VIR_FREE(newpath);
} else {
ret = real_canonicalize_file_name(path);
}
return ret;
}
int int
open(const char *path, int flags, ...) open(const char *path, int flags, ...)
{ {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册