[elephant-cvs] CVS elephant/tests

ieslick ieslick at common-lisp.net
Sat Feb 25 20:53:57 UTC 2006


Update of /project/elephant/cvsroot/elephant/tests
In directory clnet:/tmp/cvs-serv26146/tests

Modified Files:
	testindexing.lisp 
Log Message:
Fixed indexing bugs and SQL backend secondary index abstraction

--- /project/elephant/cvsroot/elephant/tests/testindexing.lisp	2006/02/23 14:41:13	1.12
+++ /project/elephant/cvsroot/elephant/tests/testindexing.lisp	2006/02/25 20:53:57	1.13
@@ -151,10 +151,33 @@
       )
   t t t)
 
-(deftest indexing-reconnect-db
+(deftest indexing-wipe-index
     (progn 
-      (format t "connect store: ~A  ~A~%" *store-controller* (elephant::controller-spec *store-controller*))
+      (when (find-class 'idx-five-del nil)
+	(disable-class-indexing 'idx-five :errorp nil)
+	(setf (find-class 'idx-five) nil))
+
+      (defclass idx-five-del ()
+	((slot1 :initarg :slot1 :initform 1 :accessor slot1 :index t))
+	(:metaclass persistent-metaclass))
+
+      (with-transaction (:store-controller *store-controller*)
+	(make-instance 'idx-five-del))
+      
+      (let ((r1 (get-instances-by-value 'idx-five-del 'slot1 1)))
 
+	(defclass idx-five-del ()
+	  ((slot1 :initarg :slot1 :initform 1 :accessor slot1))
+	  (:metaclass persistent-metaclass))
+
+	(values 
+	 (eq (length r1) 1)
+	 (signals-error (get-instances-by-value 'idx-five-del 'slot1 1))
+	 (null (get-value 'idx-five-del (elephant::controller-class-root *store-controller*))))))
+  t t t)
+
+(deftest indexing-reconnect-db
+    (progn 
       (when (find-class 'idx-five nil)
 	(disable-class-indexing 'idx-five :errorp nil)
 	(setf (find-class 'idx-five) nil))
@@ -166,8 +189,6 @@
 	(:metaclass persistent-metaclass))
 
       (let ((*default-indexed-class-synch-policy* :db))
-
-      (format t "connect store: ~A  ~A~%" *store-controller* (elephant::controller-spec *store-controller*))
 	(with-transaction (:store-controller *store-controller*)
 	  (make-instance 'idx-five))
 	
@@ -281,13 +302,13 @@
 	 (and (not (slot-exists-p o1 'slot4))
 	      (not (slot-exists-p o1 'slot5))
 	      (signals-error (get-instances-by-value 'idx-eight 'slot4 4)))
-	 (and (eq (slot6 o1) 14)
-	      (eq (length (get-instances-by-value 'idx-eight 'slot6 14)) 2))
+	 (eq (slot6 o1) 14)
+	 (eq (length (get-instances-by-value 'idx-eight 'slot6 14)) 2))
 	 (and ;;(slot-exists-p o1 'slot7)
 	      (not (slot-boundp o1 'slot7)))
 	 (and ;;(slot-exists-p o2 'slot7)
 	      (not (slot-boundp o2 'slot7))))))
-  t t t t t t t)
+  t t t t t t t t)
 
 ;; create 500 objects, write each object's slots 
 




More information about the Elephant-cvs mailing list