[bknr-cvs] ksprotte changed trunk/projects/bos/

BKNR Commits bknr at bknr.net
Wed Jul 30 15:30:19 UTC 2008


Revision: 3700
Author: ksprotte
URL: http://bknr.net/trac/changeset/3700

checkpoint
U   trunk/projects/bos/m2/poi.lisp
U   trunk/projects/bos/test/poi.lisp

Modified: trunk/projects/bos/m2/poi.lisp
===================================================================
--- trunk/projects/bos/m2/poi.lisp	2008-07-30 14:34:52 UTC (rev 3699)
+++ trunk/projects/bos/m2/poi.lisp	2008-07-30 15:30:19 UTC (rev 3700)
@@ -197,3 +197,15 @@
 
 (defmethod convert-slot-value-while-restoring ((poi poi) (slot-name (eql 'panoramas)) value)
   (appendf (poi-media poi) (mapcar (lambda (obj) (change-class obj 'poi-panorama :poi poi)) value)))
+
+(defun pois-sanity-check ()
+  (labels ((poi-sanity-check (poi)
+             (dolist (medium (poi-media poi))
+               (unless (eq poi (poi-medium-poi medium))
+                 (warn "~s does not point to ~s" medium poi)))
+             (dolist (movie (poi-movies poi))
+               (unless (stringp (poi-movie-url movie))
+                 (warn "~s has a url of ~s" movie (poi-movie-url movie))))))
+    (mapc #'poi-sanity-check (class-instances 'poi))
+    (values)))
+

Modified: trunk/projects/bos/test/poi.lisp
===================================================================
--- trunk/projects/bos/test/poi.lisp	2008-07-30 14:34:52 UTC (rev 3699)
+++ trunk/projects/bos/test/poi.lisp	2008-07-30 15:30:19 UTC (rev 3700)
@@ -40,20 +40,20 @@
       (is (string= "a subtitle" (slot-string poi2 'subtitle "de")))
       (is (string= "a description" (slot-string poi2 'description "de"))))))
 
-(defun test-make-poi-javascript ()
+(defun finishes-make-poi-javascript ()
   (dolist (language '("de" "en" "da"))
     (finishes (make-poi-javascript language))))
 
 (test make-poi-javascript
   (with-fixture initial-bos-store ()
-    (test-make-poi-javascript)
+    (finishes-make-poi-javascript)
     (make-poi "turm" :area (list 50 60))
-    (test-make-poi-javascript)
+    (finishes-make-poi-javascript)
     (make-poi "brunnen" :language "de"
               :title "a title"
               :subtitle "a subtitle"
               :description "a description")
-    (test-make-poi-javascript)))
+    (finishes-make-poi-javascript)))
 
 (test make-poi-image
   (with-fixture initial-bos-store ()
@@ -71,4 +71,4 @@
       (is (= 120 (store-image-height (first (poi-media poi)))))
       (let ((medium (first (poi-media poi))))
         (is (eq poi (poi-medium-poi medium))))
-      (test-make-poi-javascript))))
+      (finishes-make-poi-javascript))))




More information about the Bknr-cvs mailing list