-Note from Russ Tyndall <russ@acceleration.net> 2013-01-30 :
+Note from Russ Tyndall <russ@acceleration.net> 2015-03-23 :
This is the current results of running the test suite against all the database
backends I have accessible, on SBCL / UBUNTU64bit. It would be great to
increasing the number of failing tests
:mysql
-1 out of 301 total tests failed: :FDDL/CACHE-TABLE-QUERIES/1.
+No tests failed.
+18 of 310 Tests skipped
:odbc MSSQL2000/5
-1 out of 298 total tests failed: :FDDL/CACHE-TABLE-QUERIES/1.
+No tests failed.
+22 of 306 Tests skipped:
:odbc postgres
-2 out of 311 total tests failed: :FDML/SELECT/36, :FDDL/CACHE-TABLE-QUERIES/1.
+*couldnt get them to run - foreign lib problems*
:postgres-socket :postgres-socket-3
-5 out of 300 total tests failed: :TIME/PG/OODML/USEC, :TIME/PG/OODML/NO-USEC,
- :TIME/PG/FDML/USEC, :FDML/SELECT/36, :FDDL/CACHE-TABLE-QUERIES/1.
+4 out of 308 total tests failed: :TIME/PG/OODML/USEC, :TIME/PG/OODML/NO-USEC,
+ :TIME/PG/FDML/USEC, :FDML/SELECT/36.
+20 of 308 Tests skipped:
:sqlite3
-1 out of 300 total tests failed: :FDDL/INDEX/3.
+1 out of 308 total tests failed: :FDDL/INDEX/3.
+20 of 308 Tests skipped:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun error-converting-value (val type &optional (database *default-database*))
(restart-case
- (error 'sql-value-conversion-error
- :expected-type type :value val :database database)
+ (error (make-condition
+ 'sql-value-conversion-error
+ :expected-type type :value val :database database))
(continue ()
:report "Continue using the unconverted value"
(values val t))
(number (not (zerop val))))))
((wall-time duration) (parse-timestring val))
(date (parse-datestring val))
- (t (call-next-method))))
+ (list (let ((*read-eval* nil))
+ (read-from-string val)))
+ (t (error-converting-value val type database))))
(t (typecase val
- (string (read-from-string val))
+ (string
+ (let ((*read-eval* nil))
+ (read-from-string val)))
(t (error-converting-value val type database))))))
;; ------------------------------------------------------------
(%do-tests test-forms db-type)
- (format *report-stream* "~&Tests skipped:")
+ (format *report-stream* "~&~D of ~D Tests skipped:"
+ (length skip-tests)
+ (length test-forms))
(if skip-tests
(let ((max-test-name (length (symbol-name (caar skip-tests)))))
(dolist (skipped (cdr skip-tests))
(clsql-sys:file-enable-sql-reader-syntax)
+(defmacro has-sql-value-conversion-error (() &body body)
+ `(let (*debugger-hook*)
+ (handler-case
+ (progn ,@body nil)
+ (clsql-sys::sql-value-conversion-error (c)
+ (declare (ignore c))
+ t))))
(setq *rt-oodml*
'(
:foo)
(deftest :oodml/read-symbol-value/4-keyword-error
- (handler-case
- (clsql-sys::read-sql-value
- (clsql-sys::database-output-sql-as-type 'keyword 'foo nil nil)
- 'keyword nil nil)
- (clsql-sys::sql-value-conversion-error (c) (declare (ignore c))
- :error))
- :error)
+ (has-sql-value-conversion-error ()
+ (clsql-sys::read-sql-value
+ (clsql-sys::database-output-sql-as-type 'keyword 'foo nil nil)
+ 'keyword nil nil))
+ T)
+
+(deftest :oodml/read-symbol-value/5-unknown-type-error-1
+ (has-sql-value-conversion-error ()
+ (clsql-sys::read-sql-value
+ (clsql-sys::database-output-sql-as-type 'bloop 'foo nil nil)
+ 'bloop nil nil))
+ t)
+
+(deftest :oodml/read-symbol-value/6-unknown-type-error-2
+ (has-sql-value-conversion-error ()
+ (clsql-sys::read-sql-value
+ (clsql-sys::database-output-sql-as-type 'bloop 'foo nil nil)
+ '(or integer float) nil nil))
+ t)
+
+(deftest :oodml/read-symbol-value/read-list
+ (clsql-sys::read-sql-value
+ (clsql-sys::database-output-sql-as-type
+ 'list '(("status" "new" "open")) nil nil)
+ 'list nil nil)
+ (("status" "new" "open")))
(deftest :oodml/select/1
(with-dataset *ds-employees*