Subject: Re: bug#57691: 29.0.50; image-tests failures

From: Stefan Kangas <[email-masked]>
Date: Fri, 9 Sep 2022 18:37:20 -0400

Eli Zaretskii <[email-masked]> writes:

> What does that test check? why does it want to see the delay?

It used to just check that no metadata was returned for these images.
Then Lars changed the GIF and WebP loading code to always add a `delay',
so I adapted the tests to that.

(More work is needed to make these tests check for more substantial
things.  See the TODO where I say that we could expand them to test
using files that actually do contain metadata.)

> The native APIs support animated GIFs better than with libgif, so
> artificially making changes of the delay for the single benefit of
> running this test is not the best idea, IMO.

Gotcha.  So it sounds like we should leave that alone, and adapt the
test to Windows instead.

Does the below workaround make sense?  That way, at least we test
something.

diff --git a/test/manual/image-tests.el b/test/manual/image-tests.el
index c66080cf02..4b1b122309 100644
--- a/test/manual/image-tests.el
+++ b/test/manual/image-tests.el
@@ -220,11 +220,13 @@ image-tests-image-mask-p/error-on-invalid-spec
 ;; TODO: These tests could be expanded with files that actually
 ;;       contain metadata.

+(defvar w32-use-native-image-API)
 (ert-deftest image-tests-image-metadata/gif ()
   (image-skip-unless 'gif)
-  (should (memq 'delay
-                (image-metadata
-                 (create-image (cdr (assq 'gif image-tests--images)))))))
+  (let ((w32-use-native-image-API nil))
+    (should (memq 'delay
+                  (image-metadata
+                   (create-image (cdr (assq 'gif image-tests--images))))))))

 (ert-deftest image-tests-image-metadata/jpeg ()
   (image-skip-unless 'jpeg)