Re: master d5f515e4a33 1/2: New image type canvas

Divya Ranjan Pattanaik <[email protected]>
Newsgroups gmane.emacs.devel
Message-ID <[email protected]>
Michael Albinus <[email protected]> writes:

>> Patch with the above skip attached.
>
> Could you pls provide a commit message? I would push it to master then.
>

Sure. Find the attached patch with commit message.

Regards,


-- 
Divya Ranjan Pattanaik,
Philosophy, Mathematics, Libre Software.

PGP Fingerprint: F0B3 1A69 8006 8FB8 096A  2F12 B245 10C6 108C 8D4A
0001-test-src-emacs-module-tests.el-skip-canvas-tests-if-.patch (text/x-patch, 2.9 KB)
From 459870506e8fb714291763f4f8eaa23b8589ff6e Mon Sep 17 00:00:00 2001
From: Divya Ranjan <[email protected]>
Date: Sat, 22 Aug 2026 14:00:40 +0000
Subject: [PATCH] * test/src/emacs-module-tests.el: skip canvas tests if the
 image type is not available

---
 test/src/emacs-module-tests.el | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/test/src/emacs-module-tests.el b/test/src/emacs-module-tests.el
index 5ee775d12f8..789d723b0d9 100644
--- a/test/src/emacs-module-tests.el
+++ b/test/src/emacs-module-tests.el
@@ -603,6 +603,7 @@ test-canvas-gen-file
     t))
 
 (ert-deftest mod-test-canvas/valid ()
+  (skip-unless (image-type-available-p 'canvas))
   (let* ((width 128) (height 215)
          (canvas `(image :type canvas :id test-canvas
                          :data-width ,width :data-height ,height))
@@ -614,6 +615,7 @@ mod-test-canvas/valid
       (should (not (eql hash-before hash-after))))))
 
 (ert-deftest mod-test-canvas/invalid ()
+  (skip-unless (image-type-available-p 'canvas))
   (should-error (mod-test-canvas-read nil nil nil))
   (should-error (mod-test-canvas-write nil nil nil))
   (should (mod-test-canvas-invalid nil))
@@ -622,6 +624,7 @@ mod-test-canvas/invalid
   (should-error (mod-test-canvas-write '(image :type canvas) 256 527)))
 
 (ert-deftest mod-test-canvas/vector ()
+  (skip-unless (image-type-available-p 'canvas))
   (let* ((width 327) (height 98)
          (canvas `(image :type canvas :id test-canvas
                          :data-width ,width :data-height ,height
@@ -639,6 +642,7 @@ mod-test-canvas/vector
     (should-error (mod-test-canvas-write canvas 187 210))))
 
 (ert-deftest mod-test-canvas/vector-reload ()
+  (skip-unless (image-type-available-p 'canvas))
   (let* ((width 198) (height 720)
          (test-vector (make-vector (* width height) #xFFFF0000))
          (canvas `(image :type canvas :id test-canvas
@@ -654,6 +658,7 @@ mod-test-canvas/vector-reload
       (should (not (eql hash-initial hash-mutated))))))
 
 (ert-deftest mod-test-canvas/unibyte ()
+  (skip-unless (image-type-available-p 'canvas))
   (let* ((width 458) (height 278)
          (pixel (unibyte-string #xFF #x80 #x40 #x80))
          (string-data (apply #'concat (make-list (* width height) pixel)))
@@ -675,6 +680,7 @@ mod-test-canvas/unibyte
     (should-error (mod-test-canvas-write canvas 378 453))))
 
 (ert-deftest mod-test-canvas/file ()
+  (skip-unless (image-type-available-p 'canvas))
   ;; Generate the canvas data file
   (test-canvas-gen-file 128 98 #x80800000)
   (let* ((width 128) (height 98)
@@ -696,6 +702,7 @@ mod-test-canvas/gc-stress
   "Allocate canvases in batches with GC between batches.
 Verifies that canvas pixel buffers are freed correctly and do not
 cause use-after-free crashes or GC assertion failures."
+  (skip-unless (image-type-available-p 'canvas))
   (dotimes (_ 10)
     (dotimes (x 20)
       (let* ((canvas `(image :type canvas :id test-canvas
-- 
2.54.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.