projects
/
uffi.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
r10106: Automated commit for Debian build of uffi upstream-version-1.4.28
[uffi.git]
/
tests
/
uffi-c-test-lib.lisp
diff --git
a/tests/uffi-c-test-lib.lisp
b/tests/uffi-c-test-lib.lisp
index eb07ef613a511912c5e4ced0616d68c2f23a28bb..95b411e53a05aec48be467d9bc3b4dd56132d1ad 100644
(file)
--- a/
tests/uffi-c-test-lib.lisp
+++ b/
tests/uffi-c-test-lib.lisp
@@
-2,21
+2,18
@@
;;;; *************************************************************************
;;;; FILE IDENTIFICATION
;;;;
;;;; *************************************************************************
;;;; FILE IDENTIFICATION
;;;;
-;;;; Name:
c-test-fns.cl
+;;;; Name:
uffi-c-test-lib.lisp
;;;; Purpose: UFFI Example file for zlib compression
;;;; Programmer: Kevin M. Rosenberg
;;;; Date Started: Mar 2002
;;;;
;;;; Purpose: UFFI Example file for zlib compression
;;;; Programmer: Kevin M. Rosenberg
;;;; Date Started: Mar 2002
;;;;
-;;;; $Id
: uffi-c-test-lib.lisp,v 1.2 2003/05/02 02:50:12 kevin Exp
$
+;;;; $Id$
;;;;
;;;;
-;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg
+;;;; This file, part of UFFI, is Copyright (c) 2002
-2003
by Kevin M. Rosenberg
;;;;
;;;;
-;;;; UFFI users are granted the rights to distribute and use this software
-;;;; as governed by the terms of the Lisp Lesser GNU Public License
-;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL.
;;;; *************************************************************************
;;;; *************************************************************************
-(in-package :uffi-tests)
+(in-package
#
:uffi-tests)
(uffi:def-function ("cs_to_upper" cs-to-upper)
(uffi:def-function ("cs_to_upper" cs-to-upper)
@@
-31,18
+28,29
@@
(uffi:def-function ("cs_count_upper" cs-count-upper)
((input :cstring))
(uffi:def-function ("cs_count_upper" cs-count-upper)
((input :cstring))
- :returning :int
- )
+ :returning :int)
(defun string-count-upper (str)
(uffi:with-cstring (str-cstring str)
(defun string-count-upper (str)
(uffi:with-cstring (str-cstring str)
- (cs-count-upper str-cstring)))
+ (cs-count-upper str-cstring)))
(uffi:def-function ("half_double_vector" half-double-vector)
((size :int)
(vec (* :double)))
:returning :void)
(uffi:def-function ("half_double_vector" half-double-vector)
((size :int)
(vec (* :double)))
:returning :void)
+(uffi:def-function ("return_long_negative_one" return-long-negative-one)
+ ()
+ :returning :long)
+
+(uffi:def-function ("return_int_negative_one" return-int-negative-one)
+ ()
+ :returning :int)
+
+(uffi:def-function ("return_short_negative_one" return-short-negative-one)
+ ()
+ :returning :short)
+
(uffi:def-constant +double-vec-length+ 10)
(defun test-half-double-vector ()
(let ((vec (uffi:allocate-foreign-object :double +double-vec-length+))
(uffi:def-constant +double-vec-length+ 10)
(defun test-half-double-vector ()
(let ((vec (uffi:allocate-foreign-object :double +double-vec-length+))
@@
-78,4
+86,7
@@
(deftest c-test.4 (string-count-upper nil) -1)
(deftest c-test.5 (test-half-double-vector)
(0.0d0 0.5d0 1.0d0 1.5d0 2.0d0 2.5d0 3.0d0 3.5d0 4.0d0 4.5d0))
(deftest c-test.4 (string-count-upper nil) -1)
(deftest c-test.5 (test-half-double-vector)
(0.0d0 0.5d0 1.0d0 1.5d0 2.0d0 2.5d0 3.0d0 3.5d0 4.0d0 4.5d0))
+(deftest c-test.6 (return-long-negative-one) -1)
+(deftest c-test.7 (return-int-negative-one) -1)
+(deftest c-test.8 (return-short-negative-one) -1)