[elephant-cvs] CVS update: elephant/tests/elephant-tests.lisp elephant/tests/testcollections.lisp elephant/tests/testmigration.lisp

Robert L. Read rread at common-lisp.net
Wed Nov 23 03:42:23 UTC 2005


Update of /project/elephant/cvsroot/elephant/tests
In directory common-lisp.net:/tmp/cvs-serv32717/tests

Modified Files:
      Tag: SQL-BACK-END
	elephant-tests.lisp testcollections.lisp testmigration.lisp 
Log Message:
Dan Knapp's patch applied, and other changes in preparation for 0.3 release.

Date: Wed Nov 23 04:42:21 2005
Author: rread

Index: elephant/tests/elephant-tests.lisp
diff -u elephant/tests/elephant-tests.lisp:1.5.2.1 elephant/tests/elephant-tests.lisp:1.5.2.2
--- elephant/tests/elephant-tests.lisp:1.5.2.1	Tue Oct 18 22:41:32 2005
+++ elephant/tests/elephant-tests.lisp	Wed Nov 23 04:42:19 2005
@@ -100,7 +100,22 @@
     (asdf:component-pathname (asdf:find-system 'elephant-tests)))))
 
 (defvar *testpg-path*
-'("localhost.localdomain" "test" "postgres" ""))
+'(:postgresql "localhost.localdomain" "test" "postgres" ""))
+
+(defvar *testsqlite3-path*
+;; This is of the form '(filename &optional init-function),
+;; and using :memory: as a file name will get you an completely in-memory system...
+;; '(":memory:")
+ '(:sqlite3 "sqlite3-test.db")
+)
+
+(defvar *test-path-primary*
+  *testpg-path*
+)
+(defvar *test-path-secondary*
+  *testdb-path*  
+)
+
 
 (defun do-all-tests()
   (progn


Index: elephant/tests/testcollections.lisp
diff -u elephant/tests/testcollections.lisp:1.3.2.1 elephant/tests/testcollections.lisp:1.3.2.2
--- elephant/tests/testcollections.lisp:1.3.2.1	Tue Oct 18 22:41:32 2005
+++ elephant/tests/testcollections.lisp	Wed Nov 23 04:42:20 2005
@@ -9,10 +9,7 @@
 	  (unwind-protect 
 	       (let ((x (gensym)))
 		 (add-to-root "x" x)
-		 (let ((sc1 (open-store 
-			     (if (typep *store-controller* 'sql-store-controller)
-				 *testpg-path*
-				 *testdb-path*))))
+		 (let ((sc1 (open-store *test-path-primary*)))
 		   (setf rv (equal (format nil "~A" x)
 				   (format nil "~A" (get-from-root "x"))))))
 	    (progn
@@ -74,6 +71,10 @@
 
 (defvar first-key (first keys))
 
+
+;; For some unkown reason, this fails on my server unless
+;; I put the variable "first-key" here rather than use the string
+;; "key-1".  I need to understand this, but don't at present....
 (deftest remove-kv
      (finishes 
        (with-transaction (:store-controller *store-controller*) (remove-kv "key-1" bt)))


Index: elephant/tests/testmigration.lisp
diff -u elephant/tests/testmigration.lisp:1.1.2.1 elephant/tests/testmigration.lisp:1.1.2.2
--- elephant/tests/testmigration.lisp:1.1.2.1	Tue Oct 18 22:35:54 2005
+++ elephant/tests/testmigration.lisp	Wed Nov 23 04:42:20 2005
@@ -23,8 +23,8 @@
 	  (rv nil))
 	  (unwind-protect 
 	       (let (
-		     (sc1 (open-store-bdb *testdb-path*))
-		     (sc2 (open-store-sql *testpg-path*)))
+		     (sc1 (open-store *test-path-primary*))
+		     (sc2 (open-store *test-path-secondary*)))
 		 (add-to-root "x" "y" :store-controller sc1)
 		 (copy-from-key "x" sc1 sc2)
 		 (setf rv (equal (get-from-root "x" :store-controller sc1)
@@ -43,8 +43,8 @@
 	  (rv nil))
       (unwind-protect 
 	   (let
-	       ((sc1 (open-store-bdb *testdb-path*))
-		(sc2 (open-store-sql *testpg-path*)))
+	       ((sc1 (open-store *test-path-primary*))
+		(sc2 (open-store *test-path-secondary*)))
 	     (let ((ibt (build-btree sc1)))
 	       (loop for i from 0 to 10
 		  do
@@ -63,8 +63,8 @@
 	  (*auto-commit* t)
 	  (rv nil))
       (unwind-protect 
-	   (let ((sc1 (open-store-bdb *testdb-path*))
-		 (sc2 (open-store-sql *testpg-path*))
+	   (let ((sc1 (open-store *test-path-primary*))
+		 (sc2 (open-store *test-path-secondary*))
 		 )
 	     (let* ((ibt (build-indexed-btree sc1)))
 	       (let (
@@ -104,8 +104,8 @@
 	    (rv nil))
 	(unwind-protect 
 	     (let* (
-		   (sc1 (open-store-bdb *testdb-path*))
-		   (sc2 (open-store-sql *testpg-path*))
+		   (sc1 (open-store *test-path-primary*))
+		   (sc2 (open-store *test-path-secondary*))
 		   )
 	       (let* ((ibt (build-indexed-btree sc1)))
 		 (let (
@@ -131,8 +131,8 @@
 	    (*auto-commit* t))
 	(unwind-protect 
 	     (let ((osc (if (subtypep (type-of *store-controller*) 'sql-store-controller)
-			   (open-store-bdb *testdb-path*)
-			   (open-store-sql *testpg-path*)
+			   (open-store *test-path-primary*)
+			   (open-store *test-path-secondary*)
 			   )))
 ;; really need to test the an error is thrown when attempting to migrate
 ;; non-persistent object!




More information about the Elephant-cvs mailing list