added better debugging info when failing to load foreign library
[clsql.git] / tests / test-basic.lisp
index 5bdc0a3efbfeccbd156d01351e5b197a5bd286e7..24129e63adc189fc1044c554117134d9f70e8fb0 100644 (file)
@@ -7,9 +7,7 @@
 ;;;; Author:  Kevin M. Rosenberg
 ;;;; Created: Mar 2002
 ;;;;
 ;;;; Author:  Kevin M. Rosenberg
 ;;;; Created: Mar 2002
 ;;;;
-;;;; $Id$
-;;;;
-;;;; This file, part of CLSQL, is Copyright (c) 2002-2004 by Kevin M. Rosenberg
+;;;; This file, part of CLSQL, is Copyright (c) 2002-2010 by Kevin M. Rosenberg
 ;;;;
 ;;;; CLSQL users are granted the rights to distribute and use this software
 ;;;; as governed by the terms of the Lisp Lesser GNU Public License
 ;;;;
 ;;;; CLSQL users are granted the rights to distribute and use this software
 ;;;; as governed by the terms of the Lisp Lesser GNU Public License
                     results)
              (destructuring-bind (int bigint) row
                (push (list (integerp int)
                     results)
              (destructuring-bind (int bigint) row
                (push (list (integerp int)
-                           (if (and (eq :odbc *test-database-type*)
-                                    (eq :postgresql *test-database-underlying-type*))
-                               ;; ODBC/Postgresql may return returns bigints as strings or integer
-                               ;; depending upon the platform
-                               t
-                               (integerp bigint)))
+                            (integerp bigint))
                      results)))))
       ((t t) (t t) (t t) (t t) (t t) (t t) (t t) (t t) (t t) (t t) (t t)))
 
                      results)))))
       ((t t) (t t) (t t) (t t) (t t) (t t) (t t) (t t) (t t) (t t) (t t)))
 
            ))
       nil)
     (deftest :basic/bigtext/2
            ))
       nil)
     (deftest :basic/bigtext/2
-       (dotimes (n 10)
-         (with-dataset *ds-bigtext*
-           (let* ((len (random 7500))
-                  (str (make-string len :initial-element #\a))
-                  (cmd (format nil "INSERT INTO testbigtext (a) VALUES ('~a')" str)))
-             (execute-command cmd)
-             (let ((a (first (query "SELECT a from testbigtext"
-                                    :flatp t :field-names nil))))
-               (assert (string= str a) (str a)
-                       "mismatch on a. inserted: ~a returned: ~a" len (length a)))
-             )))
-      nil)
+     (flet ((random-char ()
+              (let ((alphabet "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")
+                    (idx (random 52)))
+                (elt alphabet idx))))
+       (dotimes (n 10)
+         (with-dataset *ds-bigtext*
+           (let* ((len (random 7500))
+                  (str (coerce (make-array len
+                                           :initial-contents (loop repeat len collect (random-char)))
+                               'string))
+                  (cmd (format nil "INSERT INTO testbigtext (a) VALUES ('~a')" str)))
+             (execute-command cmd)
+             (let ((a (first (query "SELECT a from testbigtext"
+                                    :flatp t :field-names nil))))
+               (assert (string= str a) (str a)
+                       "mismatch on randomized bigtext(~a) inserted: ~s returned: ~s" len str a))
+             ))))
+     nil)
     ))
 
 
     ))