Subject: 30.1; Test failure in image-type-from-file-name

From: Ulrich Müller <[email-masked]>
Date: Fri, 21 Feb 2025 09:08:55 +0100

In the 30.1-rc1 release candidate:

Running 20 tests (2025-02-21 09:01:22+0100, selector ‘(not (or (tag :expensive-test) (tag :unstable) (tag :nativecomp)))’)
  skipped   1/20  image--compute-map-and-original-map (0.000128 sec)
   passed   2/20  image--set-property (0.000062 sec)
  skipped   3/20  image-create-image-with-map (0.000067 sec)
   passed   4/20  image-find-image (0.004656 sec)
Use +, -, r for further adjustments
Use +, -, r for further adjustments
Use +, -, r for further adjustments
Use +, -, r for further adjustments
Use +, -, r for further adjustments
Use +, -, r for further adjustments
Use +, -, r for further adjustments
   passed   5/20  image-rotate (0.001020 sec)
  skipped   6/20  image-supported-file-p/built-in (0.000077 sec)
   passed   7/20  image-supported-file-p/optional (0.000045 sec)
   passed   8/20  image-supported-file-p/unsupported-returns-nil (0.000055 sec)
   passed   9/20  image-transform-map (0.000099 sec)
   passed  10/20  image-type-from-file-header-test/gif (0.000509 sec)
   passed  11/20  image-type-from-file-header-test/jpeg (0.000384 sec)
   passed  12/20  image-type-from-file-header-test/pbm (0.000365 sec)
   passed  13/20  image-type-from-file-header-test/png (0.000392 sec)
   passed  14/20  image-type-from-file-header-test/svg (0.000667 sec)
   passed  15/20  image-type-from-file-header-test/tiff (0.000523 sec)
   passed  16/20  image-type-from-file-header-test/webp (0.000356 sec)
   passed  17/20  image-type-from-file-header-test/xbm (0.000344 sec)
   passed  18/20  image-type-from-file-header-test/xpm (0.000301 sec)
Test image-type-from-file-name backtrace:
  signal(ert-test-failed (((should (eq (image-type-from-file-name "foo.png") 'png)) :form (eq imagemagick png) :value nil)))
  ert-fail(((should (eq (image-type-from-file-name "foo.png") 'png)) :form (eq imagemagick png) :value nil))
  #f(compiled-function () #<bytecode -0x1f8a069b36a7f962>)()
  #f(compiled-function () #<bytecode -0xb605d7d75e2ab7c>)()
  handler-bind-1(#f(compiled-function () #<bytecode -0xb605d7d75e2ab7c>) (error quit) #f(compiled-function (err) #<bytecode -0x15981b21f9896b41>))
  ert--run-test-internal(#s(ert--test-execution-info :test #s(ert-test :name image-type-from-file-name :documentation nil :body #f(compiled-function () #<bytecode -0x1f8a069b36a7f962>) :most-recent-result #s(ert-test-failed :messages "" :should-forms ((... :form ... :value t) (... :form ... :value nil)) :duration 9.7964e-05 :condition (ert-test-failed (... :form ... :value nil)) :backtrace (#s(backtrace-frame :evald t :fun signal :args ... :flags nil :locals nil :buffer nil :pos nil) #s(backtrace-frame :evald t :fun ert-fail :args ... :flags nil :locals nil :buffer nil :pos nil) #s(backtrace-frame :evald t :fun #f(compiled-function () #<bytecode -0x1f8a069b36a7f962>) :args nil :flags nil :locals nil :buffer nil :pos nil) #s(backtrace-frame :evald t :fun #f(compiled-function () #<bytecode -0xb605d7d75e2ab7c>) :args nil :flags nil :locals nil :buffer nil :pos nil) #s(backtrace-frame :evald t :fun handler-bind-1 :args ... :flags nil :locals nil :buffer nil :pos nil) #s(backtrace-frame :evald t :fun ert--run-test-internal :args #0 :flags nil :locals ... :buffer nil :pos nil) #s(backtrace-frame :evald t :fun ert-run-test :args ... :flags nil :locals ... :buffer nil :pos nil) #s(backtrace-frame :evald t :fun ert-run-or-rerun-test :args ... :flags nil :locals ... :buffer nil :pos nil) #s(backtrace-frame :evald t :fun ert-run-tests :args ... :flags nil :locals ... :buffer nil :pos nil) #s(backtrace-frame :evald t :fun ert-run-tests-batch :args ... :flags nil :locals nil :buffer nil :pos nil) #s(backtrace-frame :evald t :fun ert-run-tests-batch-and-exit :args ... :flags nil :locals nil :buffer nil :pos nil) #s(backtrace-frame :evald t :fun eval :args ... :flags nil :locals nil :buffer nil :pos nil) #s(backtrace-frame :evald t :fun command-line-1 :args ... :flags nil :locals ... :buffer nil :pos nil) #s(backtrace-frame :evald t :fun command-line :args nil :flags nil :locals nil :buffer nil :pos nil) #s(backtrace-frame :evald t :fun normal-top-level :args nil :flags nil :locals nil :buffer nil :pos nil)) :infos nil) :expected-result-type :passed :tags nil :file-name "/tmp/portage/app-editors/emacs-30.1_rc1/work/emacs-30.1/test/lisp/image-tests.el") :result #s(ert-test-failed :messages "" :should-forms (((should ...) :form (eq jpeg jpeg) :value t) ((should ...) :form (eq imagemagick png) :value nil)) :duration 9.7964e-05 :condition (ert-test-failed ((should ...) :form (eq imagemagick png) :value nil)) :backtrace (#s(backtrace-frame :evald t :fun signal :args (ert-test-failed ...) :flags nil :locals nil :buffer nil :pos nil) #s(backtrace-frame :evald t :fun ert-fail :args (...) :flags nil :locals nil :buffer nil :pos nil) #s(backtrace-frame :evald t :fun #f(compiled-function () #<bytecode -0x1f8a069b36a7f962>) :args nil :flags nil :locals nil :buffer nil :pos nil) #s(backtrace-frame :evald t :fun #f(compiled-function () #<bytecode -0xb605d7d75e2ab7c>) :args nil :flags nil :locals nil :buffer nil :pos nil) #s(backtrace-frame :evald t :fun handler-bind-1 :args (#f(compiled-function () #<bytecode -0xb605d7d75e2ab7c>) ... #f(compiled-function (err) #<bytecode -0x15981b21f9896b41>)) :flags nil :locals nil :buffer nil :pos nil) #s(backtrace-frame :evald t :fun ert--run-test-internal :args #0 :flags nil :locals (... ...) :buffer nil :pos nil) #s(backtrace-frame :evald t :fun ert-run-test :args (...) :flags nil :locals (... ... ...) :buffer nil :pos nil) #s(backtrace-frame :evald t :fun ert-run-or-rerun-test :args (... ... #f(compiled-function (event-type &rest event-args) #<bytecode -0x1c8e915c69123548>)) :flags nil :locals (...) :buffer nil :pos nil) #s(backtrace-frame :evald t :fun ert-run-tests :args (... #f(compiled-function (event-type &rest event-args) #<bytecode -0x1c8e915c69123548>) nil) :flags nil :locals (...) :buffer nil :pos nil) #s(backtrace-frame :evald t :fun ert-run-tests-batch :args (...) :flags nil :locals nil :buffer nil :pos nil) #s(backtrace-frame :evald t :fun ert-run-tests-batch-and-exit :args (...) :flags nil :locals nil :buffer nil :pos nil) #s(backtrace-frame :evald t :fun eval :args (... t) :flags nil :locals nil :buffer nil :pos nil) #s(backtrace-frame :evald t :fun command-line-1 :args (...) :flags nil :locals (... ...) :buffer nil :pos nil) #s(backtrace-frame :evald t :fun command-line :args nil :flags nil :locals nil :buffer nil :pos nil) #s(backtrace-frame :evald t :fun normal-top-level :args nil :flags nil :locals nil :buffer nil :pos nil)) :infos nil) :exit-continuation #f(compiled-function () #<bytecode 0x8d05c561024bc3>) :ert-debug-on-error nil))
  ert-run-test(#s(ert-test :name image-type-from-file-name :documentation nil :body #f(compiled-function () #<bytecode -0x1f8a069b36a7f962>) :most-recent-result #s(ert-test-failed :messages "" :should-forms (((should (eq (image-type-from-file-name "foo.jpg") 'jpeg)) :form (eq jpeg jpeg) :value t) ((should (eq (image-type-from-file-name "foo.png") 'png)) :form (eq imagemagick png) :value nil)) :duration 9.7964e-05 :condition (ert-test-failed ((should (eq (image-type-from-file-name "foo.png") 'png)) :form (eq imagemagick png) :value nil)) :backtrace (#s(backtrace-frame :evald t :fun signal :args (ert-test-failed ((... :form ... :value nil))) :flags nil :locals nil :buffer nil :pos nil) #s(backtrace-frame :evald t :fun ert-fail :args (((should ...) :form (eq imagemagick png) :value nil)) :flags nil :locals nil :buffer nil :pos nil) #s(backtrace-frame :evald t :fun #f(compiled-function () #<bytecode -0x1f8a069b36a7f962>) :args nil :flags nil :locals nil :buffer nil :pos nil) #s(backtrace-frame :evald t :fun #f(compiled-function () #<bytecode -0xb605d7d75e2ab7c>) :args nil :flags nil :locals nil :buffer nil :pos nil) #s(backtrace-frame :evald t :fun handler-bind-1 :args (#f(compiled-function () #<bytecode -0xb605d7d75e2ab7c>) (error quit) #f(compiled-function (err) #<bytecode -0x15981b21f9896b41>)) :flags nil :locals nil :buffer nil :pos nil) #s(backtrace-frame :evald t :fun ert--run-test-internal :args (#s(ert--test-execution-info :test #1 :result #2 :exit-continuation #f(compiled-function () #<bytecode 0x8d05c561024bc3>) :ert-debug-on-error nil)) :flags nil :locals ((ert--infos) (lexical-binding . t)) :buffer nil :pos nil) #s(backtrace-frame :evald t :fun ert-run-test :args #0 :flags nil :locals ((ert--running-tests #1) (message-log-max . t) (ert--should-execution-observer . #f(compiled-function (form-description) #<bytecode -0x1ddeb65f144f4091>))) :buffer nil :pos nil) #s(backtrace-frame :evald t :fun ert-run-or-rerun-test :args (#s(ert--stats :selector (not ...) :tests [... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... #1 ...] :test-map #<hash-table eql 20/20 0x10e5a8564d92 ...> :test-results [... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... #2 nil] :test-start-times [... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... nil] :test-end-times [... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... nil] :passed-expected 15 :passed-unexpected 0 :failed-expected 0 :failed-unexpected 1 :skipped 3 :start-time (26552 13010 6000 81000) :end-time nil :aborted-p nil :current-test #1 :next-redisplay 0.0) #1 #f(compiled-function (event-type &rest event-args) #<bytecode -0x1c8e915c69123548>)) :flags nil :locals ((ert--current-run-stats . #s(ert--stats :selector ... :tests ... :test-map #<hash-table eql 20/20 0x10e5a8564d92 ...> :test-results ... :test-start-times ... :test-end-times ... :passed-expected 15 :passed-unexpected 0 :failed-expected 0 :failed-unexpected 1 :skipped 3 :start-time ... :end-time nil :aborted-p nil :current-test #1 :next-redisplay 0.0))) :buffer nil :pos nil) #s(backtrace-frame :evald t :fun ert-run-tests :args ((not (or ... ... ...)) #f(compiled-function (event-type &rest event-args) #<bytecode -0x1c8e915c69123548>) nil) :flags nil :locals ((ert--current-run-stats . #s(ert--stats :selector ... :tests ... :test-map #<hash-table eql 20/20 0x10e5a8564d92 ...> :test-results ... :test-start-times ... :test-end-times ... :passed-expected 15 :passed-unexpected 0 :failed-expected 0 :failed-unexpected 1 :skipped 3 :start-time ... :end-time nil :aborted-p nil :current-test #1 :next-redisplay 0.0))) :buffer nil :pos nil) #s(backtrace-frame :evald t :fun ert-run-tests-batch :args ((not (or ... ... ...))) :flags nil :locals nil :buffer nil :pos nil) #s(backtrace-frame :evald t :fun ert-run-tests-batch-and-exit :args ((not (or ... ... ...))) :flags nil :locals nil :buffer nil :pos nil) #s(backtrace-frame :evald t :fun eval :args ((ert-run-tests-batch-and-exit '...) t) :flags nil :locals nil :buffer nil :pos nil) #s(backtrace-frame :evald t :fun command-line-1 :args (("-L" ":." "-l" "ert" "--eval" "(setq treesit-extra-load-path '(\"/tmp/portage/app-editors/emacs-30.1_rc1/homedir/.emacs.d/tree-sitter\"))" "--eval" "(setq ert-batch-backtrace-right-margin nil)" "-l" "lisp/image-tests" "--eval" "(ert-run-tests-batch-and-exit (quote (not (or (tag :expensive-test) (tag :unstable) (tag :nativecomp)))))")) :flags nil :locals ((command-line-args-left) (argi . "-eval")) :buffer nil :pos nil) #s(backtrace-frame :evald t :fun command-line :args nil :flags nil :locals nil :buffer nil :pos nil) #s(backtrace-frame :evald t :fun normal-top-level :args nil :flags nil :locals nil :buffer nil :pos nil)) :infos nil) :expected-result-type :passed :tags nil :file-name "/tmp/portage/app-editors/emacs-30.1_rc1/work/emacs-30.1/test/lisp/image-tests.el"))
  ert-run-or-rerun-test(#s(ert--stats :selector ... :tests ... :test-map #<hash-table eql 20/20 0x10e5a8564d92 ...> :test-results ... :test-start-times ... :test-end-times ... :passed-expected 15 :passed-unexpected 0 :failed-expected 0 :failed-unexpected 1 :skipped 3 :start-time ... :end-time nil :aborted-p nil ...) #s(ert-test :name image-type-from-file-name :documentation nil :body #f(compiled-function () #<bytecode -0x1f8a069b36a7f962>) :most-recent-result ... :expected-result-type :passed :tags nil :file-name "/tmp/portage/app-editors/emacs-30.1_rc1/work/emacs-30.1/test/lisp/image-tests.el") #f(compiled-function (event-type &rest event-args) #<bytecode -0x1c8e915c69123548>))
  ert-run-tests((not (or (tag :expensive-test) (tag :unstable) (tag :nativecomp))) #f(compiled-function (event-type &rest event-args) #<bytecode -0x1c8e915c69123548>) nil)
  ert-run-tests-batch((not (or (tag :expensive-test) (tag :unstable) (tag :nativecomp))))
  ert-run-tests-batch-and-exit((not (or (tag :expensive-test) (tag :unstable) (tag :nativecomp))))
  eval((ert-run-tests-batch-and-exit '(not (or (tag :expensive-test) (tag :unstable) (tag :nativecomp)))) t)
  command-line-1(("-L" ":." "-l" "ert" "--eval" "(setq treesit-extra-load-path '(\"/tmp/portage/app-editors/emacs-30.1_rc1/homedir/.emacs.d/tree-sitter\"))" "--eval" "(setq ert-batch-backtrace-right-margin nil)" "-l" "lisp/image-tests" "--eval" "(ert-run-tests-batch-and-exit (quote (not (or (tag :expensive-test) (tag :unstable) (tag :nativecomp)))))"))
  command-line()
  normal-top-level()

Test image-type-from-file-name condition:
    (ert-test-failed
     ((should (eq (image-type-from-file-name "foo.png") 'png)) :form
      (eq imagemagick png) :value nil))
   FAILED  19/20  image-type-from-file-name (0.000098 sec) at lisp/image-tests.el:90
   passed  20/20  image-type/from-filename (0.004731 sec)

Ran 20 tests, 16 results as expected, 1 unexpected, 3 skipped (2025-02-21 09:01:22+0100, 0.137995 sec)

1 unexpected results:
   FAILED  image-type-from-file-name  ((should (eq (image-type-from-file-name "foo.png") 'png)) :form (eq imagemagick png) :value nil)

3 skipped results:
  SKIPPED  image--compute-map-and-original-map  ((skip-unless (display-images-p)) :form (display-images-p) :value nil)
  SKIPPED  image-create-image-with-map  ((skip-unless (display-images-p)) :form (display-images-p) :value nil)
  SKIPPED  image-supported-file-p/built-in  ((skip-unless (display-images-p)) :form (display-images-p) :value nil)

In GNU Emacs 30.1 (build 1, x86_64-pc-linux-gnu, X toolkit) of
 2025-02-21 built on urania
Windowing system distributor 'The X.Org Foundation', version 11.0.12101015
System Description: Gentoo Linux

Configured using:
 'configure --prefix=/usr --build=x86_64-pc-linux-gnu
 --host=x86_64-pc-linux-gnu --mandir=/usr/share/man
 --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc
 --localstatedir=/var/lib --datarootdir=/usr/share
 --disable-silent-rules --docdir=/usr/share/doc/emacs-30.1_rc1
 --htmldir=/usr/share/doc/emacs-30.1_rc1/html --libdir=/usr/lib64
 --program-suffix=-emacs-30 --includedir=/usr/include/emacs-30
 --infodir=/usr/share/info/emacs-30 --localstatedir=/var
 --enable-locallisppath=/etc/emacs:/usr/share/emacs/site-lisp
 --without-compress-install --without-hesiod --without-pop
 --with-file-notification=inotify --with-pdumper --enable-acl
 --disable-xattr --with-dbus --with-modules --with-gameuser=:gamestat
 --with-libgmp --with-gpm --without-native-compilation
 --without-kerberos --without-kerberos5 --with-lcms2 --with-xml2
 --without-mailutils --without-selinux --without-sqlite3
 --without-gnutls --without-libsystemd --without-threads
 --without-tree-sitter --without-wide-int --with-sound=alsa
 --without-zlib --with-x --without-pgtk --without-ns --without-gconf
 --with-gsettings --without-toolkit-scroll-bars --without-xpm
 --without-xft --without-cairo --without-libotf --without-m17n-flt
 --with-x-toolkit=lucid --without-xaw3d --with-gif --with-jpeg
 --without-png --without-rsvg --without-tiff --without-webp
 --with-imagemagick --with-dumping=pdumper 'CFLAGS=-march=native -ggdb
 -O2 -pipe -fno-fast-math -ffp-contract=off' CPPFLAGS= 'LDFLAGS=-Wl,-O1
 -Wl,--as-needed -Wl,-z,pack-relative-relocs''

Configured features:
ACL DBUS GIF GLIB GMP GPM GSETTINGS IMAGEMAGICK JPEG LCMS2 LIBXML2
MODULES NOTIFY INOTIFY PDUMPER SECCOMP SOUND X11 XDBE XIM XINPUT2 LUCID

Important settings:
  value of $LC_CTYPE: en_GB.UTF-8
  value of $LC_TIME: en_GB.UTF-8
  value of $LANG: POSIX
  locale-coding-system: utf-8-unix