X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=tests%2Ftest-basic.lisp;h=35b39213e22d4c2d8111c0c93340f31688c07dcb;hb=6684280691d01cc6d761f24288f9ea80d77bca29;hp=ba55fba6e008991044db75a168967a4c3b81efcb;hpb=fd11963eb2f46ffac6da2b18fab3d7ff2a4390cf;p=clsql.git diff --git a/tests/test-basic.lisp b/tests/test-basic.lisp index ba55fba..35b3921 100644 --- a/tests/test-basic.lisp +++ b/tests/test-basic.lisp @@ -47,26 +47,28 @@ (typep float 'double-float) (if (and (eq :odbc *test-database-type*) (eq :postgresql *test-database-underlying-type*)) - ;; ODBC/Postgresql returns bigints as strings - (stringp bigint) + ;; ODBC/Postgresql may return returns bigints as strings or integer + ;; depending upon the platform + t (integerp bigint)) (stringp str)) results)))) ((t t t t) (t t t t) (t t t t) (t t t t) (t t t t) (t t t t) (t t t t) (t t t t) (t t t t) (t t t t) (t t t t))) - (deftest :BASIC/TYPE/2 (let ((results '())) (dolist (row (query "select * from TYPE_TABLE" :result-types :auto) results) (destructuring-bind (int float bigint str) row - (push (list (double-float-equal - (transform-float-1 int) - float) - (double-float-equal - (parse-double str) - float)) - results)))) + (setq results + (cons (list (double-float-equal + (transform-float-1 int) + float) + (double-float-equal + (parse-double str) + float)) + results)))) + results) ((t t) (t t) (t t) (t t) (t t) (t t) (t t) (t t) (t t) (t t) (t t))) ))) @@ -95,6 +97,7 @@ (dolist (row (query "select * from TYPE_TABLE" :result-types nil) results) (destructuring-bind (int float bigint str) row + (declare (ignore bigint)) (push (list (double-float-equal (transform-float-1 (parse-integer int)) (parse-double float)) @@ -108,7 +111,7 @@ (let ((results '()) (rows (map-query 'vector #'list "select * from TYPE_TABLE" :result-types nil))) - (declare (array rows)) + (declare (type (simple-array list (*)) rows)) (dotimes (i (length rows) results) (push (list @@ -161,26 +164,31 @@ (deftest :BASIC/DO/1 (let ((results '())) (do-query ((int float bigint str) "select * from TYPE_TABLE" :result-types nil) - (push (list (double-float-equal - (transform-float-1 (parse-integer int)) - (parse-double float)) - (double-float-equal - (parse-double str) - (parse-double float))) - results)) + (declare (ignore bigint)) + (let ((int-number (parse-integer int))) + (setq results + (cons (list (double-float-equal (transform-float-1 + int-number) + (parse-double float)) + (double-float-equal (parse-double str) + (parse-double float))) + results)))) results) ((t t) (t t) (t t) (t t) (t t) (t t) (t t) (t t) (t t) (t t) (t t))) - + (deftest :BASIC/DO/2 (let ((results '())) (do-query ((int float bigint str) "select * from TYPE_TABLE" :result-types :auto) - (push (list (double-float-equal - (transform-float-1 int) - float) - (double-float-equal - (parse-double str) - float)) - results)) + (declare (ignore bigint)) + (setq results + (cons + (list (double-float-equal + (transform-float-1 int) + float) + (double-float-equal + (parse-double str) + float)) + results))) results) ((t t) (t t) (t t) (t t) (t t) (t t) (t t) (t t) (t t) (t t) (t t))) ))