Subject: bug#36403: 27.0.50; Trivial image.c bugs

From: Eli Zaretskii <[email-masked]>
Date: Fri, 26 Jul 2019 09:56:46 +0300

> From: Pip Cet <[email-masked]>
> Date: Mon, 22 Jul 2019 02:55:50 +0000
> Cc: [email-masked]
> 
> On Fri, Jun 28, 2019 at 7:53 PM Eli Zaretskii <[email-masked]> wrote:
> > > Attached patch has tests and fixes.
> >
> > Thanks.  Let's wait for a few days to let others comment.
> 
> Rebased patch attached.

Thanks.

Now that I applied this and looked into the results and the code, I
have a few questions/comments.  Sorry I didn't see this earlier.

In your bug report, you say, among other things:

> (insert-image `(image :dummy :type :type xbm :height 1 :width 1 :data
> ,(bool-vector t)))
> 
> produces an error. It should arguably behave the same as
> 
> (insert-image `(image :dummy :dummy :type xbm :height 1 :width 1 :data
> ,(bool-vector t)))

Can you explain why these two are equivalent?

> (equal_lists): Introduce.
> (search_image_cache): Use `equal_lists'.

I don't think I understand why we need this new function.  Can you explain?

Finally, 2 of the tests fail for me:

  $ make src/image-tests.log
    ELC      src/image-tests.elc
    GEN      src/image-tests.log
  Running 4 tests (2019-07-26 09:49:33+0300, selector `(not (tag :unstable))')
  Test image-test-:type-property-value backtrace:
    signal(error ("Window system frame should be used"))
    apply(signal (error ("Window system frame should be used")))
    (setq value-13 (apply fn-11 args-12))
    (unwind-protect (setq value-13 (apply fn-11 args-12)) (setq form-des
    (if (unwind-protect (setq value-13 (apply fn-11 args-12)) (setq form
    (let (form-description-15) (if (unwind-protect (setq value-13 (apply
    (let ((value-13 'ert-form-evaluation-aborted-14)) (let (form-descrip
    (let* ((fn-11 #'equal) (args-12 (condition-case err (let ((signal-ho
    (lambda nil (let* ((fn-11 #'equal) (args-12 (condition-case err (let
    ert--run-test-internal(#s(ert--test-execution-info :test #s(ert-test
    ert-run-test(#s(ert-test :name image-test-:type-property-value :docu
    ert-run-or-rerun-test(#s(ert--stats :selector (not (tag :unstable))
    ert-run-tests((not (tag :unstable)) #f(compiled-function (event-type
    ert-run-tests-batch((not (tag :unstable)))
    ert-run-tests-batch-and-exit((not (tag :unstable)))
    eval((ert-run-tests-batch-and-exit '(not (tag :unstable))) t)
    command-line-1((#("-L" 0 2 (charset cp862)) #(";." 0 2 (charset cp86
    command-line()
    normal-top-level()
  Test image-test-:type-property-value condition:
      (error "Window system frame should be used")
     FAILED  1/4  image-test-:type-property-value (0.000000 sec)
     passed  2/4  image-test-circular-plist (0.000000 sec)
  Test image-test-circular-specs backtrace:
    image-size((image :type xbm :width 1 :height 1 :data #&1"\1" :ignore
    (equal (image-size spec1 t) (cons 1 1))
    (and (equal (image-size spec1 t) (cons 1 1)) (equal (image-size spec
    (let* ((circ1 (cons :dummy nil)) (circ2 (cons :dummy nil)) (spec1 (l
    (setq value-16 (let* ((circ1 (cons :dummy nil)) (circ2 (cons :dummy
    (unwind-protect (setq value-16 (let* ((circ1 (cons :dummy nil)) (cir
    (if (unwind-protect (setq value-16 (let* ((circ1 (cons :dummy nil))
    (let (form-description-17) (if (unwind-protect (setq value-16 (let*
    (let ((value-16 (gensym "ert-form-evaluation-aborted-"))) (let (form
    (lambda nil (let ((value-16 (gensym "ert-form-evaluation-aborted-"))
    ert--run-test-internal(#s(ert--test-execution-info :test #s(ert-test
    ert-run-test(#s(ert-test :name image-test-circular-specs :documentat
    ert-run-or-rerun-test(#s(ert--stats :selector (not (tag :unstable))
    ert-run-tests((not (tag :unstable)) #f(compiled-function (event-type
    ert-run-tests-batch((not (tag :unstable)))
    ert-run-tests-batch-and-exit((not (tag :unstable)))
    eval((ert-run-tests-batch-and-exit '(not (tag :unstable))) t)
    command-line-1((#("-L" 0 2 (charset cp862)) #(";." 0 2 (charset cp86
    command-line()
    normal-top-level()
  Test image-test-circular-specs condition:
      (error "Window system frame should be used")
     FAILED  3/4  image-test-circular-specs (0.000000 sec)
     passed  4/4  image-test-duplicate-keywords (0.000000 sec)

  Ran 4 tests, 2 results as expected, 2 unexpected (2019-07-26 09:49:35+0300, 1.906250 sec)

  2 unexpected results:
     FAILED  image-test-:type-property-value
     FAILED  image-test-circular-specs