1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 18:40:39 -08:00

Display librsvg error when loading bad SVG

* src/image.c (svg_load_image): Display the error message from librsvg
when parsing a bad SVG image file.
* test/manual/image-tests.el
(image-tests-load-image/svg-invalid): New test.
This commit is contained in:
Stefan Kangas 2022-09-09 02:32:08 +02:00
parent ef17ba8370
commit 816106b7e6
2 changed files with 18 additions and 7 deletions

View file

@ -78,6 +78,17 @@
(image-tests-make-load-image-test 'xbm)
(image-tests-make-load-image-test 'xpm)
(ert-deftest image-tests-load-image/svg-invalid ()
(with-temp-buffer
(pop-to-buffer (current-buffer))
(insert (propertize " "
'display '(image :data
"invalid foo bar"
:type svg)))
(redisplay))
(with-current-buffer "*Messages*"
(should (string-search "XML parse error" (buffer-string)))))
;;;; image-test-size