aboutsummaryrefslogtreecommitdiffstats
path: root/test/src
diff options
context:
space:
mode:
authorPaul Eggert2017-09-25 11:16:05 -0700
committerPaul Eggert2017-09-25 11:16:05 -0700
commit0c06b93c1e467debd401eb0b3be4652fde14fa95 (patch)
tree9fac5e948a58a4526dcc5ce6160b48197ea03f7d /test/src
parentc4e6ff097c946b46e3a659982c61e25093bde1a7 (diff)
parent96aaeaaffac8a93d9c8126ba77ad217a3f323fce (diff)
downloademacs-0c06b93c1e467debd401eb0b3be4652fde14fa95.tar.gz
emacs-0c06b93c1e467debd401eb0b3be4652fde14fa95.zip
Merge from origin/emacs-26
96aaeaaffa ; * src/lcms.c: Minor stylistic changes in comments. c3df816585 Fix compilation warning in etags.c 5490ccc5eb Add lisp variable lcms-d65-xyz dee96f4a17 * lisp/emacs-lisp/cl-macs.el (cl-letf): Fix Edebug spec (b... 12e864eb30 Avoid MinGW64 compiler warnings in unexw32.c 625cee5316 Start emacs-26 release branch # Conflicts: # README # configure.ac # msdos/sed2v2.inp # nt/README.W32
Diffstat (limited to 'test/src')
-rw-r--r--test/src/lcms-tests.el19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/src/lcms-tests.el b/test/src/lcms-tests.el
index 74648e1979e..962902eb100 100644
--- a/test/src/lcms-tests.el
+++ b/test/src/lcms-tests.el
@@ -33,6 +33,9 @@
33(require 'ert) 33(require 'ert)
34(require 'color) 34(require 'color)
35 35
36(defconst lcms-colorspacious-d65 '(0.95047 1.0 1.08883)
37 "D65 white point from colorspacious.")
38
36(defun lcms-approx-p (a b &optional delta) 39(defun lcms-approx-p (a b &optional delta)
37 "Check if A and B are within relative error DELTA of one another. 40 "Check if A and B are within relative error DELTA of one another.
38B is considered the exact value." 41B is considered the exact value."
@@ -46,6 +49,22 @@ B is considered the exact value."
46 (lcms-approx-p a2 b2 delta) 49 (lcms-approx-p a2 b2 delta)
47 (lcms-approx-p a3 b3 delta)))) 50 (lcms-approx-p a3 b3 delta))))
48 51
52(ert-deftest lcms-cri-cam02-ucs ()
53 "Test use of `lcms-cam02-ucs'."
54 (should-error (lcms-cam02-ucs '(0 0 0) '(0 0 0) "error"))
55 (should-error (lcms-cam02-ucs '(0 0 0) 'error))
56 (should-not
57 (lcms-approx-p
58 (let ((lcms-d65-xyz '(0.44757 1.0 0.40745)))
59 (lcms-cam02-ucs '(0.5 0.5 0.5) '(0 0 0)))
60 (lcms-cam02-ucs '(0.5 0.5 0.5) '(0 0 0))))
61 (should (eql 0.0 (lcms-cam02-ucs '(0.5 0.5 0.5) '(0.5 0.5 0.5))))
62 (should
63 (lcms-approx-p (lcms-cam02-ucs lcms-colorspacious-d65
64 '(0 0 0)
65 lcms-colorspacious-d65)
66 100.0)))
67
49(ert-deftest lcms-whitepoint () 68(ert-deftest lcms-whitepoint ()
50 "Test use of `lcms-temp->white-point'." 69 "Test use of `lcms-temp->white-point'."
51 (skip-unless (featurep 'lcms2)) 70 (skip-unless (featurep 'lcms2))