X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=tests%2Fuffi-c-test-lib.lisp;h=4e87608f0bb39d675bd5c60a209e3694a667b1bc;hb=7004c2691d5695471c7bce9d62b82a1914cf05a2;hp=928b073ecabd948dc00b501424698c9126c5f064;hpb=65e2a75247b894d1f562102ef1df77c7060b5048;p=uffi.git diff --git a/tests/uffi-c-test-lib.lisp b/tests/uffi-c-test-lib.lisp index 928b073..4e87608 100644 --- a/tests/uffi-c-test-lib.lisp +++ b/tests/uffi-c-test-lib.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Mar 2002 ;;;; -;;;; $Id: uffi-c-test-lib.lisp,v 1.3 2003/08/13 18:53:42 kevin Exp $ +;;;; $Id$ ;;;; ;;;; This file, part of UFFI, is Copyright (c) 2002-2003 by Kevin M. Rosenberg ;;;; @@ -19,6 +19,7 @@ (uffi:def-function ("cs_to_upper" cs-to-upper) ((input (* :unsigned-char))) :returning :void + :module "uffi-c-test" ) (defun string-to-upper (str) @@ -29,16 +30,33 @@ (uffi:def-function ("cs_count_upper" cs-count-upper) ((input :cstring)) :returning :int - ) + :module "uffi-c-test") (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) + :returning :void + :module "uffi-c-test") + +(uffi:def-function ("return_long_negative_one" return-long-negative-one) + () + :returning :long + :module "uffi-c-test") + +(uffi:def-function ("return_int_negative_one" return-int-negative-one) + () + :returning :int + :module "uffi-c-test") + +(uffi:def-function ("return_short_negative_one" return-short-negative-one) + () + :returning :short + :module "uffi-c-test") + (uffi:def-constant +double-vec-length+ 10) (defun test-half-double-vector () @@ -75,4 +93,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.6 (return-long-negative-one) -1) +(deftest c-test.7 (return-int-negative-one) -1) +(deftest c-test.8 (return-short-negative-one) -1)