This is an automated email from the git hooks/post-receive script.

guillem pushed a commit to branch main
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=92945bf3d772d7cfe28052204dfe68f60a39e9c8

commit 92945bf3d772d7cfe28052204dfe68f60a39e9c8
Author: Guillem Jover <guil...@debian.org>
AuthorDate: Sat Aug 26 14:01:37 2023 +0200

    test: Move test_data_file() to test.h
    
    This function is generally useful for tests so that they can use data
    files.
---
 lib/dpkg/t/t-meminfo.c | 13 -------------
 lib/dpkg/test.h        | 13 +++++++++++++
 2 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/lib/dpkg/t/t-meminfo.c b/lib/dpkg/t/t-meminfo.c
index b231081c6..0c3e63551 100644
--- a/lib/dpkg/t/t-meminfo.c
+++ b/lib/dpkg/t/t-meminfo.c
@@ -24,19 +24,6 @@
 #include <dpkg/test.h>
 #include <dpkg/meminfo.h>
 
-static char *
-test_data_file(const char *filename)
-{
-       char *pathname;
-       int rc;
-
-       rc = asprintf(&pathname, "%s/t/data/%s", test_get_srcdir(), filename);
-       if (rc < 0)
-               test_bail("cannot allocate data filename");
-
-       return pathname;
-}
-
 static void
 test_meminfo(void)
 {
diff --git a/lib/dpkg/test.h b/lib/dpkg/test.h
index 1e3dce9f4..7bc0af12c 100644
--- a/lib/dpkg/test.h
+++ b/lib/dpkg/test.h
@@ -83,6 +83,19 @@ test_get_envdir(const char *envvar)
 #define test_get_builddir() \
        test_get_envdir("builddir")
 
+static inline char *
+test_data_file(const char *filename)
+{
+       char *pathname;
+       int rc;
+
+       rc = asprintf(&pathname, "%s/t/data/%s", test_get_srcdir(), filename);
+       if (rc < 0)
+               test_bail("cannot allocate data filename");
+
+       return pathname;
+}
+
 static inline bool
 test_is_verbose(void)
 {

-- 
Dpkg.Org's dpkg

Reply via email to