X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=tests%2Fpointers.lisp;fp=tests%2Fpointers.lisp;h=0000000000000000000000000000000000000000;hb=38083fa0ada6710a73df1efee5121624b8c4f8dc;hp=cebb359fd1fa677583858f528c72d5a1363c8c41;hpb=09464c82191ef241c749756bbad5ffaadd8f6e5f;p=uffi.git diff --git a/tests/pointers.lisp b/tests/pointers.lisp deleted file mode 100644 index cebb359..0000000 --- a/tests/pointers.lisp +++ /dev/null @@ -1,70 +0,0 @@ -;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10 -*- -;;;; ************************************************************************* -;;;; FILE IDENTIFICATION -;;;; -;;;; Name: pointers.lisp -;;;; Purpose: Test file for UFFI pointers -;;;; Programmer: Kevin M. Rosenberg -;;;; Date Started: Aug 2003 -;;;; -;;;; $Id$ -;;;; -;;;; This file, part of UFFI, is Copyright (c) 2003 by Kevin M. Rosenberg -;;;; -;;;; ************************************************************************* - -(in-package #:uffi-tests) - -(deftest :chptr.1 - (let ((native-string "test string")) - (uffi:with-foreign-string (fs native-string) - (ensure-char-character - (deref-pointer fs :char)))) - #\t) - -(deftest :chptr.2 - (let ((native-string "test string")) - (uffi:with-foreign-string (fs native-string) - (ensure-char-character - (deref-pointer fs :unsigned-char)))) - #\t) - -(deftest :chptr.3 - (let ((native-string "test string")) - (uffi:with-foreign-string (fs native-string) - (ensure-char-integer - (deref-pointer fs :unsigned-char)))) - 116) - -(deftest :chptr.4 - (let ((native-string "test string")) - (uffi:with-foreign-string (fs native-string) - (integerp - (ensure-char-integer - (deref-pointer fs :unsigned-char))))) - t) - -(deftest :chptr.5 - (let ((fs (uffi:allocate-foreign-object :unsigned-char 128))) - (setf (uffi:deref-array fs '(:array :unsigned-char) 0) - (uffi:ensure-char-storable #\a)) - (setf (uffi:deref-array fs '(:array :unsigned-char) 1) - (uffi:ensure-char-storable (code-char 0))) - (uffi:convert-from-foreign-string fs)) - "a") - -;; This produces an array which needs fli:foreign-aref to access -;; rather than fli:dereference - -#-lispworks -(deftest :chptr.6 - (uffi:with-foreign-object (fs '(:array :unsigned-char 128)) - (setf (uffi:deref-array fs '(:array :unsigned-char) 0) - (uffi:ensure-char-storable #\a)) - (setf (uffi:deref-array fs '(:array :unsigned-char) 1) - (uffi:ensure-char-storable (code-char 0))) - (uffi:convert-from-foreign-string fs)) - "a") - - -