r8827: correct ignore-errors
[clsql.git] / usql-tests / test-init.lisp
index 67ad1e98bacb7266ff458854670c974a2c53ca30..33349084864afe13b0fa4027e650c1d4c941d678 100644 (file)
@@ -13,7 +13,7 @@
 ;;;;
 ;;;; ======================================================================
 
-(in-package :clsql-usql-tests)
+(in-package #:clsql-usql-tests)
 
 (defvar *test-database-type* nil)
 (defvar *test-database-server* "")
@@ -29,7 +29,7 @@
            :initarg :height)
    (married :db-kind :base :accessor married :type boolean :nulls-ok t
             :initarg :married)
-   (birthday :nulls-ok t :type wall-time :initarg :birthday)
+   (birthday :nulls-ok t :type clsql-base:wall-time :initarg :birthday)
    (hobby :db-kind :virtual :initarg :hobby :initform nil)))
   
 (def-view-class employee (person)
                                        :groupid 1
                                        :married t 
                                        :height (1+ (random 1.00))
-                                       :birthday (usql:get-time)
+                                       :birthday (clsql-base:get-time)
                                        :first-name "Vladamir"
                                        :last-name "Lenin"
                                        :email "lenin@soviet.org"))
                                :groupid 1
                               :height (1+ (random 1.00))
                                :married t 
-                               :birthday (usql:get-time)
+                               :birthday (clsql-base:get-time)
                                :first-name "Josef"
                               :last-name "Stalin"
                               :email "stalin@soviet.org"))
                                :groupid 1
                               :height (1+ (random 1.00))
                                :married t 
-                               :birthday (usql:get-time)
+                               :birthday (clsql-base:get-time)
                                :first-name "Leon"
                               :last-name "Trotsky"
                               :email "trotsky@soviet.org"))
                                :groupid 1
                               :height (1+ (random 1.00))
                                :married nil
-                               :birthday (usql:get-time)
+                               :birthday (clsql-base:get-time)
                                :first-name "Nikita"
                               :last-name "Kruschev"
                               :email "kruschev@soviet.org"))
                                :groupid 1
                                :married nil
                               :height (1+ (random 1.00))
-                               :birthday (usql:get-time)
+                               :birthday (clsql-base:get-time)
                                :first-name "Leonid"
                               :last-name "Brezhnev"
                               :email "brezhnev@soviet.org"))
                                :groupid 1
                                :married nil
                               :height (1+ (random 1.00))
-                               :birthday (usql:get-time)
+                               :birthday (clsql-base:get-time)
                                :first-name "Yuri"
                               :last-name "Andropov"
                               :email "andropov@soviet.org"))
                                  :groupid 1
                                  :height (1+ (random 1.00))
                                  :married nil
-                                 :birthday (usql:get-time)
+                                 :birthday (clsql-base:get-time)
                                  :first-name "Konstantin"
                                  :last-name "Chernenko"
                                  :email "chernenko@soviet.org"))
                                  :groupid 1
                                  :height (1+ (random 1.00))
                                  :married nil
-                                 :birthday (usql:get-time)
+                                 :birthday (clsql-base:get-time)
                                  :first-name "Mikhail"
                                  :last-name "Gorbachev"
                                  :email "gorbachev@soviet.org"))
                                  :groupid 1 
                                  :married nil
                                  :height (1+ (random 1.00))
-                                 :birthday (usql:get-time)
+                                 :birthday (clsql-base:get-time)
                                  :first-name "Boris"
                                  :last-name "Yeltsin"
                                  :email "yeltsin@soviet.org"))
                                   :groupid 1
                                   :married nil
                                   :height (1+ (random 1.00))
-                                  :birthday (usql:get-time)
+                                  :birthday (clsql-base:get-time)
                                   :first-name "Vladamir"
                                   :last-name "Putin"
                                   :email "putin@soviet.org"))
                 :make-default t
                 :if-exists :old))
 
+(defmacro with-ignore-errors (&rest forms)
+  `(progn
+     ,@(mapcar
+       (lambda (x) (list 'ignore-errors x))
+       forms)))
+
 (defun test-initialise-database ()
     ;; Delete the instance records
-  (ignore-errors 
+  (with-ignore-errors 
     (usql:delete-instance-records company1)
     (usql:delete-instance-records employee1)
     (usql:delete-instance-records employee2)