X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=tests.lisp;h=73e009b8588b1bd877064ed80fda33ad84e850e8;hb=5e38a707983711121425bcb9f5f6a88baf832bfc;hp=605e28860f3182a12f7d2438fd1f11c1a6333722;hpb=4860883d5bf05e9e7c83d4f16a001e4edd1d1cb2;p=cl-photo.git diff --git a/tests.lisp b/tests.lisp index 605e288..73e009b 100644 --- a/tests.lisp +++ b/tests.lisp @@ -21,7 +21,7 @@ (defun verify-results (alist blist) (every #'identity (mapcar - (lambda (a b) (numbers-within-percentage a b 0.001)) + (lambda (a b) (numbers-within-percentage a b 0.01)) alist blist))) (defmacro def-numeric-test (name test &rest values) @@ -42,4 +42,47 @@ (def-numeric-test :aov.1 (aov 50 36 24) 39.5977 26.9915 46.7930) -(def-numeric-test \ No newline at end of file +(def-numeric-test + :fov.1 (fov 50 24 16 :magnification 1 :units :mm) + 24 16 28.8444 1 100 100) + +(def-numeric-test + :fov.2 (fov 50 24 16 :magnification 1 :units :feet) + 0.07874 0.052494 0.094634 1 0.328084 100) + +(def-numeric-test + :fov.3 (fov 50 24 16 :image-distance 100 :units :mm) + 24 16 28.8444 1 100 100) + +(def-numeric-test + :fov.4 (fov 50 24 16 :image-distance 100 :units :feet) + 0.07874 0.052494 0.094634 1 0.328084 100) + +(def-numeric-test + :fov.5 (fov 50 24 16 :object-distance 100 :units :mm) + 24 16 28.8444 1 100 100) + +(def-numeric-test + :fov.6 (fov 50 24 16 :object-distance (cl-photo::mm->feet 100) :units :feet) + 0.07874 0.052494 0.094634 1 0.328084 100) + +(def-numeric-test + :mag.1 (magnification :focal-length 50 :image-distance 100 :units :mm) 1) + +(def-numeric-test + :mag.2 (magnification :focal-length 50 :image-distance 100 :units :feet) 1) + +(def-numeric-test + :mag.3 (magnification :focal-length 50 :object-distance 100 :units :mm) 1) + +(def-numeric-test + :mag.4 (magnification :focal-length 50 :object-distance (cl-photo::mm->feet 100) + :units :feet) 1) + +(def-numeric-test + :mag.5 (magnification :image-distance 100 :object-distance 100 :units :mm) 1) + +(def-numeric-test + :mag.6 (magnification :image-distance 100 :object-distance (cl-photo::mm->feet 100) + :units :feet) 1) +