r1682: More tests in XPTest
authorKevin M. Rosenberg <kevin@rosenberg.net>
Wed, 27 Mar 2002 11:13:27 +0000 (11:13 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Wed, 27 Mar 2002 11:13:27 +0000 (11:13 +0000)
VERSION
interfaces/postgresql-socket/postgresql-socket-api.cl
test-suite/xptest-clsql.cl

diff --git a/VERSION b/VERSION
index e45365073dfaed847256274364b8305c180e89b8..44d8132363e181afc7e1d3d9dec4c3e3d476a0c8 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1,2 +1,3 @@
-0.5.3
+0.6.0-pre
+
 
index 0be635e1aea8b9b63f387f212b7ad3f601b78860..0c64353403fe7912a1378fc567c1d80a20dd91a9 100644 (file)
@@ -9,7 +9,7 @@
 ;;;;                
 ;;;; Date Started:  Feb 2002
 ;;;;
-;;;; $Id: postgresql-socket-api.cl,v 1.10 2002/03/27 10:48:12 kevin Exp $
+;;;; $Id: postgresql-socket-api.cl,v 1.11 2002/03/27 11:13:27 kevin Exp $
 ;;;;
 ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
 ;;;; and Copyright (c) 1999-2001 by Pierre R. Mai
@@ -644,27 +644,28 @@ connection, if it is still open."
        (unless before-decimal
         (error "Unexpected value"))))
     
-    (dotimes (i length)
-      (setq char (read-byte socket))
-;;      (format t "~&len:~D, i:~D, char:~D, minusp:~A, decimalp:~A" length i char minusp decimalp)
-      (let ((weight (ascii-digit char)))
-       (cond 
-         ((and weight (not decimalp)) ;; before decimal point
-          (setq before-decimal (+ weight (* 10 before-decimal))))
-         ((and weight decimalp) ;; after decimal point
-          (setq after-decimal (+ weight (* 10 after-decimal)))
-          (incf decimal-count))
-         ((and (= char +char-code-period+))
-          (setq decimalp t))
-         ((or (= char +char-code-lower-e+)           ;; E is for exponent
-              (= char +char-code-upper-e+))
-          (setq exponent (read-integer-from-socket socket (- length i 1)))
-          (setq exponent (or exponent 0))
-          (setq i length))
+    (block loop
+      (dotimes (i length)
+       (setq char (read-byte socket))
+       ;;      (format t "~&len:~D, i:~D, char:~D, minusp:~A, decimalp:~A" length i char minusp decimalp)
+       (let ((weight (ascii-digit char)))
+         (cond 
+          ((and weight (not decimalp)) ;; before decimal point
+           (setq before-decimal (+ weight (* 10 before-decimal))))
+          ((and weight decimalp) ;; after decimal point
+           (setq after-decimal (+ weight (* 10 after-decimal)))
+           (incf decimal-count))
+          ((and (= char +char-code-period+))
+           (setq decimalp t))
+          ((or (= char +char-code-lower-e+)          ;; E is for exponent
+               (= char +char-code-upper-e+))
+           (setq exponent (read-integer-from-socket socket (- length i 1)))
+           (setq exponent (or exponent 0))
+           (return-from loop))
          (t 
           (break "Unexpected value"))
          )
-       ))
+       )))
     (setq result (* (+ (coerce before-decimal 'double-float)
                       (* after-decimal 
                          (expt 10 (- decimal-count))))
index 998607a7000ae82dfdadf2af2b159f53a65674b1..6d082274fd024e97022b197ec0a0d6f643e1ff1d 100644 (file)
@@ -7,7 +7,7 @@
 ;;;; Programmer:    Kevin M. Rosenberg
 ;;;; Date Started:  Mar 2002
 ;;;;
-;;;; $Id: xptest-clsql.cl,v 1.5 2002/03/27 10:56:02 kevin Exp $
+;;;; $Id: xptest-clsql.cl,v 1.6 2002/03/27 11:13:27 kevin Exp $
 ;;;;
 ;;;; The XPTest package can be downloaded from
 ;;;; http://alpha.onshored.com/lisp-software/
             (loop for row across (map-query 'vector #'list "select * from test_clsql" 
                                             :database db :types nil)
                   do (test-table-row row nil))
+            (loop for row in (map-query 'list #'list "select * from test_clsql" 
+                                        :database db :types nil)
+                  do (test-table-row row nil))
+            (loop for row in (map-query 'list #'list "select * from test_clsql" 
+                                        :database db :types :auto)
+                  do (test-table-row row :auto))
+            (when (map-query nil #'list "select * from test_clsql" 
+                                        :database db :types :auto)
+              (failure "Expected NIL result from map-query nil"))
+            (do-query ((int float str) "select * from test_clsql")
+              (test-table-row (list int float str) nil))
+            (do-query ((int float str) "select * from test_clsql" :types :auto)
+              (test-table-row (list int float str) :auto))
             (drop-test-table db)
             )
        (disconnect :database db)))))