[PATCH v2 4/8] tests: Stop mocking canonicalize_file_name()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Since we've dropped all usages from the library, mocking it has
become entirely pointless.

Signed-off-by: Andrea Bolognani <abologna@xxxxxxxxxx>
---
 tests/virpcimock.c | 21 ---------------------
 1 file changed, 21 deletions(-)

diff --git a/tests/virpcimock.c b/tests/virpcimock.c
index 9a5e6b4cec..001b320683 100644
--- a/tests/virpcimock.c
+++ b/tests/virpcimock.c
@@ -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_stat)(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_close)(int fd);
 static DIR * (*real_opendir)(const char *name);
@@ -811,7 +810,6 @@ init_syms(void)
     VIR_MOCK_REAL_INIT(access);
     VIR_MOCK_REAL_INIT_ALT(lstat, __lxstat);
     VIR_MOCK_REAL_INIT_ALT(stat, __xstat);
-    VIR_MOCK_REAL_INIT(canonicalize_file_name);
     VIR_MOCK_REAL_INIT(open);
     VIR_MOCK_REAL_INIT(close);
     VIR_MOCK_REAL_INIT(opendir);
@@ -982,25 +980,6 @@ stat(const char *path, struct stat *sb)
     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
 open(const char *path, int flags, ...)
 {
-- 
2.14.3

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux