r9019: odbc updates
[clsql.git] / tests / test-basic.lisp
index 76647208630ce8df46523a1e39bf022b57a81bcd..e57ee2875a64a2519debe5956784a2983ffb0a11 100644 (file)
@@ -53,7 +53,7 @@
     (test-table-row (list int float bigint str) nil type))
   (do-query ((int float bigint str) "select * from test_clsql" :result-types :auto)
     (test-table-row (list int float bigint str) :auto type))
-  (drop-test-table db))
+  #+ignore (drop-test-table db))
 
 
 (defun %test-basic-untyped (db type)
@@ -84,7 +84,7 @@
     (clsql:execute-command 
      "DROP TABLE test_clsql" :database db))
   (clsql:execute-command 
-   "CREATE TABLE test_clsql (t_int integer, t_float float, t_bigint BIGINT, t_str CHAR(30))" 
+   "CREATE TABLE test_clsql (t_int integer, t_float double, t_bigint BIGINT, t_str CHAR(30))" 
    :database db)
   (dotimes (i 11)
     (let* ((test-int (- i 5))
       ((eq types :auto)
        (test (and (integerp int)
                  (typep float 'double-float)
-                 (or (eq db-type :aodbc) ;; aodbc doesn't handle bigint conversions
+                 (or (eq db-type :aodbc)  ;; aodbc considers bigints as strings
                      (integerp bigint)) 
                  (stringp str))
             t
              t
              :fail-info 
              (format nil "Incorrect field type for row ~S (types nil)" row))
-       (setq int (parse-integer int))
+       (when (stringp int)
+         (setq int (parse-integer int)))
        (setq bigint (parse-integer bigint))
-       (setq float (parse-double float)))
+       (when (stringp float)
+         (setq float (parse-double float))))
        ((listp types)
        (error "NYI")
        )
     (unless (eq db-type :sqlite)               ; SQLite is typeless.
       (test (transform-float-1 int)
            float
-           :test #'eql
+           :test #'double-float-equal
            :fail-info 
            (format nil "Wrong float value ~A for int ~A (row ~S)" float int row)))
     (test float