Fasttrack: make credentials handling more robust
[phoros.git] / test.lisp
blob003b94a6580f79629c4aabb14176b2a9ebc678f9
1 (defpackage phoros-test
2 (:use :common-lisp
3 :phoros
4 #+sbcl :sb-rt
5 #-sbcl :rt))
7 (in-package phoros)
9 (do-symbols (s) (import (list s) :phoros-test))
11 (in-package :phoros-test)
13 (defun round-numbers (decimal-digits numbers)
14 (let ((format-string (format nil "~~{~~,~DF~~#^ ~~}" decimal-digits)))
15 (format nil format-string numbers)))
17 (deftest cs2cs/1
18 (round-numbers
19 8 (proj:cs2cs (list (proj:degrees-to-radians -112.5d0)
20 (proj:degrees-to-radians +45.25919444444d0)
21 100d0)
22 :source-cs "+proj=latlong +datum=NAD83"
23 :destination-cs "+proj=utm +zone=10 +datum=NAD27"))
24 "1323852.82619611 5065462.32041128 99.99994720")
26 (deftest geographic-to-utm/1
27 (round-numbers
28 8 (geographic-to-utm 31 13d0 50d0 200d0))
29 "1216025.31786614 5586720.84493467 200.00000000")
31 (deftest geographic-to-utm/2
32 (round-numbers
33 8 (geographic-to-utm 32 13d0 50d0 200d0))
34 "786627.95104280 5546300.84739345 200.00000000")
36 (deftest geographic-to-utm/3
37 (round-numbers
38 8 (geographic-to-utm 32 13 50 200))
39 "786627.95104280 5546300.84739345 200.00000000")
41 (deftest assert-utm-zone/1
42 (assert-utm-zone
43 9.427261747452828 3 9.28838684 53.19274138 68.969 519267.427 5893750.59 68.969)
44 nil)
46 (deftest assert-utm-zone/2
47 (handler-case
48 (assert-utm-zone
49 9.427261747452828 3 9.28838684 53.19274138 68.969 519267.627 5893750.59 68.969)
50 (simple-error () "expected error"))
51 "expected error")
53 (deftest find-keyword/1
54 (img:find-keyword "testsuite/cottbus_0696/einzelbilder/cott001_CCDFRONT_0.pictures"
55 "Some-Junk=" 1103 500)
56 nil)
58 (deftest find-keyword/2
59 (img:find-keyword "testsuite/cottbus_0696/einzelbilder/cott001_CCDFRONT_0.pictures"
60 "timeTrigger=" 1103 500)
61 1177)
63 (deftest find-keyword-value/1
64 (img:find-keyword-value "testsuite/cottbus_0696/einzelbilder/cott001_CCDFRONT_0.pictures"
65 "height=" 1103 500)
66 1040)