From baabff1a8dbf4813072d87f6977cd488c376fe56 Mon Sep 17 00:00:00 2001 From: "Kevin M. Rosenberg" Date: Sun, 10 Mar 2002 04:15:33 +0000 Subject: [PATCH] r1524: *** empty log message *** --- Makefile | 4 ++-- doc/uffi.pdf | Bin 63972 -> 63972 bytes examples/compress.cl | 10 +++++++++- examples/getenv.cl | 9 ++++++++- examples/gethostname.cl | 3 ++- examples/getshells.cl | 5 +++-- examples/gettime.cl | 5 +++-- examples/strtol.cl | 12 +++++++++++- examples/test-all-examples.cl | 18 ++++++++++++++++++ tests/compress.cl | 10 +++++++++- tests/getenv.cl | 9 ++++++++- tests/gethostname.cl | 3 ++- tests/getshells.cl | 5 +++-- tests/gettime.cl | 5 +++-- tests/strtol.cl | 12 +++++++++++- tests/test-all-examples.cl | 18 ++++++++++++++++++ 16 files changed, 110 insertions(+), 18 deletions(-) create mode 100644 examples/test-all-examples.cl create mode 100644 tests/test-all-examples.cl diff --git a/Makefile b/Makefile index aff1142..49a4354 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ # Programer: Kevin M. Rosenberg, M.D. # Date Started: Mar 2002 # -# CVS Id: $Id: Makefile,v 1.5 2002/03/10 00:11:47 kevin Exp $ +# CVS Id: $Id: Makefile,v 1.6 2002/03/10 04:15:33 kevin Exp $ # # Copyright (c) 2002 by Kevin M. Rosenberg # @@ -41,7 +41,7 @@ realclean: clean docs: @(cd doc; make dist-doc) -VERSION=0.1.3 +VERSION=0.1.4-pre DISTDIR=uffi-${VERSION} DIST_TARBALL=${DISTDIR}.tar.gz DIST_ZIP=${DISTDIR}.zip diff --git a/doc/uffi.pdf b/doc/uffi.pdf index 943df2df1c211d307322ea02115a44a1a29ebff9..f100f7076d05ee9d91ee0251097203ca48bcaee3 100644 GIT binary patch delta 18 acmaFznfb|Q<_%_-navF>Hd|g^tp)&E)d-*f delta 18 acmaFznfb|Q<_%_-nN1AMHd|g^tp)&ExCop8 diff --git a/examples/compress.cl b/examples/compress.cl index 7787b69..1ef513d 100644 --- a/examples/compress.cl +++ b/examples/compress.cl @@ -9,7 +9,7 @@ ;;;; ;;;; Copyright (c) 2002 Kevin M. Rosenberg ;;;; -;;;; $Id: compress.cl,v 1.2 2002/03/09 21:19:31 kevin Exp $ +;;;; $Id: compress.cl,v 1.3 2002/03/10 04:15:33 kevin Exp $ ;;;; ;;;; This file is part of UFFI. ;;;; @@ -64,3 +64,11 @@ (uffi:free-foreign-object dest))))))) +#+test-uffi +(progn + (flet ((print-results (str) + (multiple-value-bind (compressed len) (compress str) + (format t "~&(compress ~S) => ~S,~D" str compressed len)))) + (print-results "") + (print-results "test") + (print-results "test2"))) diff --git a/examples/getenv.cl b/examples/getenv.cl index 335a70f..347a22f 100644 --- a/examples/getenv.cl +++ b/examples/getenv.cl @@ -9,7 +9,7 @@ ;;;; ;;;; Copyright (c) 2002 Kevin M. Rosenberg ;;;; -;;;; $Id: getenv.cl,v 1.2 2002/03/09 21:19:31 kevin Exp $ +;;;; $Id: getenv.cl,v 1.3 2002/03/10 04:15:33 kevin Exp $ ;;;; ;;;; This file is part of UFFI. ;;;; @@ -44,3 +44,10 @@ (format t "~&Environment value for USER key: ~A" (getenv "USER")) (format t "~&Environment value for _FOO_ key: ~A" (getenv "_FOO_")) +#+test-uffi +(progn + (flet ((print-results (str) + (format t "~&(getenv ~S) => ~S" str (getenv str)))) + (print-results "USER") + (print-results "_FOO_"))) + diff --git a/examples/gethostname.cl b/examples/gethostname.cl index 0b3ceda..fbb3539 100644 --- a/examples/gethostname.cl +++ b/examples/gethostname.cl @@ -9,7 +9,7 @@ ;;;; ;;;; Copyright (c) 2002 Kevin M. Rosenberg ;;;; -;;;; $Id: gethostname.cl,v 1.2 2002/03/09 21:19:31 kevin Exp $ +;;;; $Id: gethostname.cl,v 1.3 2002/03/10 04:15:33 kevin Exp $ ;;;; ;;;; This file is part of UFFI. ;;;; @@ -47,5 +47,6 @@ (error "gethostname() failed.")) (uffi:free-foreign-object name)))) +#+test-uffi (format t "~&Hostname: ~A" (gethostname)) diff --git a/examples/getshells.cl b/examples/getshells.cl index 58e1020..50040ec 100644 --- a/examples/getshells.cl +++ b/examples/getshells.cl @@ -9,7 +9,7 @@ ;;;; ;;;; Copyright (c) 2002 Kevin M. Rosenberg ;;;; -;;;; $Id: getshells.cl,v 1.2 2002/03/09 21:19:31 kevin Exp $ +;;;; $Id: getshells.cl,v 1.3 2002/03/10 04:15:33 kevin Exp $ ;;;; ;;;; This file is part of UFFI. ;;;; @@ -52,6 +52,7 @@ (push shell shells)) (endusershell) (nreverse shells))) - + +#+test-uffi (format t "~&Shells: ~S" (getshells)) diff --git a/examples/gettime.cl b/examples/gettime.cl index ea71edc..be0bdee 100644 --- a/examples/gettime.cl +++ b/examples/gettime.cl @@ -9,7 +9,7 @@ ;;;; ;;;; Copyright (c) 2002 Kevin M. Rosenberg ;;;; -;;;; $Id: gettime.cl,v 1.2 2002/03/09 21:19:31 kevin Exp $ +;;;; $Id: gettime.cl,v 1.3 2002/03/10 04:15:33 kevin Exp $ ;;;; ;;;; This file is part of UFFI. ;;;; @@ -66,7 +66,8 @@ (uffi:free-foreign-object time) time-string) )) - + +#+test-uffi (format t "~&~A" (gettime)) diff --git a/examples/strtol.cl b/examples/strtol.cl index 3655dd0..d813f13 100644 --- a/examples/strtol.cl +++ b/examples/strtol.cl @@ -9,7 +9,7 @@ ;;;; ;;;; Copyright (c) 2002 Kevin M. Rosenberg ;;;; -;;;; $Id: strtol.cl,v 1.2 2002/03/09 21:19:31 kevin Exp $ +;;;; $Id: strtol.cl,v 1.3 2002/03/10 04:15:33 kevin Exp $ ;;;; ;;;; This file is part of UFFI. ;;;; @@ -63,3 +63,13 @@ of first non-valid character" (t (values value chars-parsed))))) + +#+test-uffi +(progn + (flet ((print-results (str) + (multiple-value-bind (result flag) (strtol str) + (format t "~&(strtol ~S) => ~S,~S" str result flag)))) + (print-results "55") + (print-results "55.3") + (print-results "a"))) + diff --git a/examples/test-all-examples.cl b/examples/test-all-examples.cl new file mode 100644 index 0000000..a2a62de --- /dev/null +++ b/examples/test-all-examples.cl @@ -0,0 +1,18 @@ +(mk:load-system :uffi) + +(pushnew :test-uffi cl:*features*) + +(flet ((load-test (name) + (load (make-pathname :name name :type "cl" :defaults *load-truename*)))) + + (load-test "getenv") + (load-test "gethostname") + (load-test "getshells") + (load-test "gettime") + (load-test "strtol") + (load-test "compress")) + +(setq cl:*features* (remove :test-uffi cl:*features*)) + + + diff --git a/tests/compress.cl b/tests/compress.cl index 7787b69..1ef513d 100644 --- a/tests/compress.cl +++ b/tests/compress.cl @@ -9,7 +9,7 @@ ;;;; ;;;; Copyright (c) 2002 Kevin M. Rosenberg ;;;; -;;;; $Id: compress.cl,v 1.2 2002/03/09 21:19:31 kevin Exp $ +;;;; $Id: compress.cl,v 1.3 2002/03/10 04:15:33 kevin Exp $ ;;;; ;;;; This file is part of UFFI. ;;;; @@ -64,3 +64,11 @@ (uffi:free-foreign-object dest))))))) +#+test-uffi +(progn + (flet ((print-results (str) + (multiple-value-bind (compressed len) (compress str) + (format t "~&(compress ~S) => ~S,~D" str compressed len)))) + (print-results "") + (print-results "test") + (print-results "test2"))) diff --git a/tests/getenv.cl b/tests/getenv.cl index 335a70f..347a22f 100644 --- a/tests/getenv.cl +++ b/tests/getenv.cl @@ -9,7 +9,7 @@ ;;;; ;;;; Copyright (c) 2002 Kevin M. Rosenberg ;;;; -;;;; $Id: getenv.cl,v 1.2 2002/03/09 21:19:31 kevin Exp $ +;;;; $Id: getenv.cl,v 1.3 2002/03/10 04:15:33 kevin Exp $ ;;;; ;;;; This file is part of UFFI. ;;;; @@ -44,3 +44,10 @@ (format t "~&Environment value for USER key: ~A" (getenv "USER")) (format t "~&Environment value for _FOO_ key: ~A" (getenv "_FOO_")) +#+test-uffi +(progn + (flet ((print-results (str) + (format t "~&(getenv ~S) => ~S" str (getenv str)))) + (print-results "USER") + (print-results "_FOO_"))) + diff --git a/tests/gethostname.cl b/tests/gethostname.cl index 0b3ceda..fbb3539 100644 --- a/tests/gethostname.cl +++ b/tests/gethostname.cl @@ -9,7 +9,7 @@ ;;;; ;;;; Copyright (c) 2002 Kevin M. Rosenberg ;;;; -;;;; $Id: gethostname.cl,v 1.2 2002/03/09 21:19:31 kevin Exp $ +;;;; $Id: gethostname.cl,v 1.3 2002/03/10 04:15:33 kevin Exp $ ;;;; ;;;; This file is part of UFFI. ;;;; @@ -47,5 +47,6 @@ (error "gethostname() failed.")) (uffi:free-foreign-object name)))) +#+test-uffi (format t "~&Hostname: ~A" (gethostname)) diff --git a/tests/getshells.cl b/tests/getshells.cl index 58e1020..50040ec 100644 --- a/tests/getshells.cl +++ b/tests/getshells.cl @@ -9,7 +9,7 @@ ;;;; ;;;; Copyright (c) 2002 Kevin M. Rosenberg ;;;; -;;;; $Id: getshells.cl,v 1.2 2002/03/09 21:19:31 kevin Exp $ +;;;; $Id: getshells.cl,v 1.3 2002/03/10 04:15:33 kevin Exp $ ;;;; ;;;; This file is part of UFFI. ;;;; @@ -52,6 +52,7 @@ (push shell shells)) (endusershell) (nreverse shells))) - + +#+test-uffi (format t "~&Shells: ~S" (getshells)) diff --git a/tests/gettime.cl b/tests/gettime.cl index ea71edc..be0bdee 100644 --- a/tests/gettime.cl +++ b/tests/gettime.cl @@ -9,7 +9,7 @@ ;;;; ;;;; Copyright (c) 2002 Kevin M. Rosenberg ;;;; -;;;; $Id: gettime.cl,v 1.2 2002/03/09 21:19:31 kevin Exp $ +;;;; $Id: gettime.cl,v 1.3 2002/03/10 04:15:33 kevin Exp $ ;;;; ;;;; This file is part of UFFI. ;;;; @@ -66,7 +66,8 @@ (uffi:free-foreign-object time) time-string) )) - + +#+test-uffi (format t "~&~A" (gettime)) diff --git a/tests/strtol.cl b/tests/strtol.cl index 3655dd0..d813f13 100644 --- a/tests/strtol.cl +++ b/tests/strtol.cl @@ -9,7 +9,7 @@ ;;;; ;;;; Copyright (c) 2002 Kevin M. Rosenberg ;;;; -;;;; $Id: strtol.cl,v 1.2 2002/03/09 21:19:31 kevin Exp $ +;;;; $Id: strtol.cl,v 1.3 2002/03/10 04:15:33 kevin Exp $ ;;;; ;;;; This file is part of UFFI. ;;;; @@ -63,3 +63,13 @@ of first non-valid character" (t (values value chars-parsed))))) + +#+test-uffi +(progn + (flet ((print-results (str) + (multiple-value-bind (result flag) (strtol str) + (format t "~&(strtol ~S) => ~S,~S" str result flag)))) + (print-results "55") + (print-results "55.3") + (print-results "a"))) + diff --git a/tests/test-all-examples.cl b/tests/test-all-examples.cl new file mode 100644 index 0000000..a2a62de --- /dev/null +++ b/tests/test-all-examples.cl @@ -0,0 +1,18 @@ +(mk:load-system :uffi) + +(pushnew :test-uffi cl:*features*) + +(flet ((load-test (name) + (load (make-pathname :name name :type "cl" :defaults *load-truename*)))) + + (load-test "getenv") + (load-test "gethostname") + (load-test "getshells") + (load-test "gettime") + (load-test "strtol") + (load-test "compress")) + +(setq cl:*features* (remove :test-uffi cl:*features*)) + + + -- 2.34.1