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

git pushed a commit to branch master
in repository legacy-imlib2.

View the commit online.

commit 46d4f37ecf9a9514b41e44cc577b5306629647b3
Author: Kim Woelders <k...@woelders.dk>
AuthorDate: Sun Jul 2 20:11:55 2023 +0200

    test: Enable skipping loader flushing
---
 test/test.cpp      | 12 ++++++++++++
 test/test.h        |  2 ++
 test/test_load.cpp |  4 ++--
 test/test_save.cpp |  2 +-
 4 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/test/test.cpp b/test/test.cpp
index 86a0220..79c1f1b 100644
--- a/test/test.cpp
+++ b/test/test.cpp
@@ -98,6 +98,18 @@ image_get_crc32(Imlib_Image im)
     return crc;
 }
 
+void
+flush_loaders(void)
+{
+    static signed char do_flush = -1;   // Normally do flush
+
+    if (do_flush < 0)
+        do_flush = getenv("IMLIB2_TEST_NO_LOADER_FLUSH") == NULL;
+
+    if (do_flush)
+        imlib_flush_loaders();
+}
+
 /**INDENT-OFF**/
 extern "C" {
 #include "strutils.h"
diff --git a/test/test.h b/test/test.h
index 51878ca..c843fb1 100644
--- a/test/test.h
+++ b/test/test.h
@@ -15,6 +15,8 @@ void            pr_info(const char *fmt, ...);
 
 unsigned int    image_get_crc32(Imlib_Image im);
 
+void            flush_loaders(void);
+
 bool            file_skip(const char *file);
 
 #endif                          /* TEST_H */
diff --git a/test/test_load.cpp b/test/test_load.cpp
index fbefeb9..eab4873 100644
--- a/test/test_load.cpp
+++ b/test/test_load.cpp
@@ -135,7 +135,7 @@ test_load(void)
             EXPECT_TRUE(data);
             image_free(im);
         }
-        imlib_flush_loaders();
+        flush_loaders();
 
         D("Load '%s' (immediate)\n", fileo);
         im = imlib_load_image_with_errno_return(fileo, &err);
@@ -145,7 +145,7 @@ test_load(void)
             D("Error %d im=%p loading '%s'\n", err, im, fileo);
         if (im)
             image_free(im);
-        imlib_flush_loaders();
+        flush_loaders();
 
         if (strchr(pfxs[i], '.') == 0)
         {
diff --git a/test/test_save.cpp b/test/test_save.cpp
index 6254c80..5e3727f 100644
--- a/test/test_save.cpp
+++ b/test/test_save.cpp
@@ -227,7 +227,7 @@ test_save_2(const char *file, const char *fmt, bool load_imm, bool sok,
     Imlib_Image     im;
     unsigned int    crc;
 
-    imlib_flush_loaders();
+    flush_loaders();
 
     snprintf(filei, sizeof(filei), "%s/%s", IMG_SRC, file);
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to