1 ;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10 -*-
2 ;;;; *************************************************************************
3 ;;;; FILE IDENTIFICATION
5 ;;;; Name: cl-photo-tests.lisp
6 ;;;; Purpose: Cl-Photo tests file
7 ;;;; Programmer: Kevin M. Rosenberg
8 ;;;; Date Started: Apr 2003
12 ;;;; This file is Copyright (c) 2000-2003 by Kevin M. Rosenberg
13 ;;;; *************************************************************************
15 (defpackage #:cl-photo-tests
16 (:use #:cl-photo #:cl #:rtest #:kmrcl))
17 (in-package #:cl-photo-tests)
21 (defun verify-results (alist blist)
24 (lambda (a b) (numbers-within-percentage a b 0.001))
27 (defmacro def-numeric-test (name test &rest values)
29 (let ((results (multiple-value-list ,test)))
30 (verify-results results ',values))
34 :gl.1 (gaussian-lens :focal-length 50 :object-distance 100) 100)
37 :gl.2 (gaussian-lens :focal-length 50 :image-distance 200) 66.66667)
40 :gl.3 (gaussian-lens :object-distance 100 :image-distance 100) 50)
43 :aov.1 (aov 50 36 24) 39.5977 26.9915 46.7930)