diff options
author | Mark H Weaver <mhw@netris.org> | 2014-04-25 02:06:01 -0400 |
---|---|---|
committer | Mark H Weaver <mhw@netris.org> | 2014-04-25 02:06:01 -0400 |
commit | 475772ea57c97d0fa0f9ed9303db137d9798ddd3 (patch) | |
tree | 99a9ba2ea0b044552016d41c5c9197bbac66d97f /test-suite/standalone | |
parent | 0e92ef40d047696eb3334405b2dd32f51ca55006 (diff) | |
parent | e0da53b4fe4abee2cdcd97fe46eeefcaab1da631 (diff) | |
download | guile-475772ea57c97d0fa0f9ed9303db137d9798ddd3.tar.gz |
Merge branch 'stable-2.0'v2.1.0
Conflicts:
GUILE-VERSION
NEWS
guile-readline/ice-9/readline.scm
libguile/async.c
libguile/backtrace.c
libguile/deprecated.h
libguile/gc-malloc.c
libguile/gdbint.c
libguile/init.c
libguile/ioext.c
libguile/mallocs.c
libguile/print.c
libguile/rw.c
libguile/scmsigs.c
libguile/script.c
libguile/simpos.c
libguile/snarf.h
libguile/strports.c
libguile/threads.c
libguile/vm-i-scheme.c
libguile/vm-i-system.c
module/srfi/srfi-18.scm
test-suite/Makefile.am
test-suite/standalone/test-num2integral.c
Diffstat (limited to 'test-suite/standalone')
-rw-r--r-- | test-suite/standalone/Makefile.am | 9 | ||||
-rw-r--r-- | test-suite/standalone/test-loose-ends.c | 4 | ||||
-rw-r--r-- | test-suite/standalone/test-num2integral.c | 4 | ||||
-rw-r--r-- | test-suite/standalone/test-round.c | 4 | ||||
-rw-r--r-- | test-suite/standalone/test-scm-c-bind-keyword-arguments.c | 4 | ||||
-rw-r--r-- | test-suite/standalone/test-scm-c-read.c | 4 | ||||
-rw-r--r-- | test-suite/standalone/test-scm-values.c | 4 | ||||
-rw-r--r-- | test-suite/standalone/test-smob-mark.c | 4 | ||||
-rw-r--r-- | test-suite/standalone/test-srfi-4.c | 90 |
9 files changed, 119 insertions, 8 deletions
diff --git a/test-suite/standalone/Makefile.am b/test-suite/standalone/Makefile.am index d2f430050..fa77925d9 100644 --- a/test-suite/standalone/Makefile.am +++ b/test-suite/standalone/Makefile.am @@ -139,7 +139,7 @@ TESTS += test-list # test-unwind test_unwind_SOURCES = test-unwind.c test_unwind_CFLAGS = ${test_cflags} -test_unwind_LDADD = $(LIBGUILE_LDADD) +test_unwind_LDADD = $(LIBGUILE_LDADD) $(top_builddir)/lib/libgnu.la check_PROGRAMS += test-unwind TESTS += test-unwind @@ -211,6 +211,13 @@ test_scm_c_bind_keyword_arguments_LDADD = $(LIBGUILE_LDADD) check_PROGRAMS += test-scm-c-bind-keyword-arguments TESTS += test-scm-c-bind-keyword-arguments +# test-srfi-4 +test_srfi_4_SOURCES = test-srfi-4.c +test_srfi_4_CFLAGS = ${test_cflags} +test_srfi_4_LDADD = $(LIBGUILE_LDADD) +check_PROGRAMS += test-srfi-4 +TESTS += test-srfi-4 + if HAVE_SHARED_LIBRARIES # test-extensions diff --git a/test-suite/standalone/test-loose-ends.c b/test-suite/standalone/test-loose-ends.c index b4ea5b94a..40b358b99 100644 --- a/test-suite/standalone/test-loose-ends.c +++ b/test-suite/standalone/test-loose-ends.c @@ -3,7 +3,7 @@ * Test items of the Guile C API that aren't covered by any other tests. */ -/* Copyright (C) 2009, 2012 Free Software Foundation, Inc. +/* Copyright (C) 2009, 2012, 2014 Free Software Foundation, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -25,6 +25,8 @@ # include <config.h> #endif +#undef NDEBUG + #include <libguile.h> #include <stdio.h> diff --git a/test-suite/standalone/test-num2integral.c b/test-suite/standalone/test-num2integral.c index c8dc3a7e4..f5cd87938 100644 --- a/test-suite/standalone/test-num2integral.c +++ b/test-suite/standalone/test-num2integral.c @@ -1,5 +1,5 @@ /* Copyright (C) 1999, 2000, 2001, 2003, 2004, 2006, 2008, 2010, 2011 - * 2012 Free Software Foundation, Inc. + * 2012, 2014 Free Software Foundation, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -21,6 +21,8 @@ # include <config.h> #endif +#undef NDEBUG + #include <libguile.h> #include <stdio.h> diff --git a/test-suite/standalone/test-round.c b/test-suite/standalone/test-round.c index 150c8816e..2cd6fd54e 100644 --- a/test-suite/standalone/test-round.c +++ b/test-suite/standalone/test-round.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2004, 2006, 2008, 2009, 2011 Free Software Foundation, Inc. +/* Copyright (C) 2004, 2006, 2008, 2009, 2011, 2014 Free Software Foundation, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -20,6 +20,8 @@ # include <config.h> #endif +#undef NDEBUG + #include <assert.h> #include <math.h> #include <stdio.h> diff --git a/test-suite/standalone/test-scm-c-bind-keyword-arguments.c b/test-suite/standalone/test-scm-c-bind-keyword-arguments.c index ad0722ce8..f4cd53d84 100644 --- a/test-suite/standalone/test-scm-c-bind-keyword-arguments.c +++ b/test-suite/standalone/test-scm-c-bind-keyword-arguments.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2013 Free Software Foundation, Inc. +/* Copyright (C) 2013, 2014 Free Software Foundation, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -20,6 +20,8 @@ # include <config.h> #endif +#undef NDEBUG + #include <libguile.h> #include <assert.h> diff --git a/test-suite/standalone/test-scm-c-read.c b/test-suite/standalone/test-scm-c-read.c index 4111cd0f5..5f11e7565 100644 --- a/test-suite/standalone/test-scm-c-read.c +++ b/test-suite/standalone/test-scm-c-read.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2008 Free Software Foundation, Inc. +/* Copyright (C) 2008, 2014 Free Software Foundation, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -23,6 +23,8 @@ # include <config.h> #endif +#undef NDEBUG + #include <libguile.h> #include <assert.h> diff --git a/test-suite/standalone/test-scm-values.c b/test-suite/standalone/test-scm-values.c index ece62dab6..06f57bedd 100644 --- a/test-suite/standalone/test-scm-values.c +++ b/test-suite/standalone/test-scm-values.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2012 Free Software Foundation, Inc. +/* Copyright (C) 2012, 2014 Free Software Foundation, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -20,6 +20,8 @@ # include <config.h> #endif +#undef NDEBUG + #include <assert.h> #include <libguile.h> #include <stdlib.h> diff --git a/test-suite/standalone/test-smob-mark.c b/test-suite/standalone/test-smob-mark.c index d9db9a651..86566af76 100644 --- a/test-suite/standalone/test-smob-mark.c +++ b/test-suite/standalone/test-smob-mark.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2013 Free Software Foundation, Inc. +/* Copyright (C) 2013, 2014 Free Software Foundation, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -20,6 +20,8 @@ #include <config.h> #endif +#undef NDEBUG + #include <assert.h> #include <libguile.h> #include <stdio.h> diff --git a/test-suite/standalone/test-srfi-4.c b/test-suite/standalone/test-srfi-4.c new file mode 100644 index 000000000..b49e666cc --- /dev/null +++ b/test-suite/standalone/test-srfi-4.c @@ -0,0 +1,90 @@ +/* Copyright (C) 2014 Free Software Foundation, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 3 of + * the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301 USA + */ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +/* Make sure the assertions are tested. */ +#undef NDEBUG + +#include <libguile.h> + +#include <stdio.h> +#include <assert.h> + +static void +test_writable_elements () +{ + SCM elts = scm_list_4 (scm_from_int (1), scm_from_int (2), + scm_from_int (3), scm_from_int (4)); + + { + SCM v = scm_u32vector (elts); + size_t len; + ssize_t inc; + scm_t_array_handle h; + scm_t_uint32 *elts = scm_u32vector_writable_elements (v, &h, &len, &inc); + assert (len == 4); + assert (inc == 1); + assert (elts[0] == 1); + assert (elts[3] == 4); + scm_array_handle_release (&h); + } + + { + SCM v = scm_f32vector (elts); + size_t len; + ssize_t inc; + scm_t_array_handle h; + float *elts = scm_f32vector_writable_elements (v, &h, &len, &inc); + assert (len == 4); + assert (inc == 1); + assert (elts[0] == 1.0); + assert (elts[3] == 4.0); + scm_array_handle_release (&h); + } + + { + SCM v = scm_c32vector (elts); + size_t len; + ssize_t inc; + scm_t_array_handle h; + float *elts = scm_c32vector_writable_elements (v, &h, &len, &inc); + assert (len == 4); + assert (inc == 1); + assert (elts[0] == 1.0); + assert (elts[1] == 0.0); + assert (elts[6] == 4.0); + assert (elts[7] == 0.0); + scm_array_handle_release (&h); + } +} + +static void +tests (void *data, int argc, char **argv) +{ + test_writable_elements (); +} + +int +main (int argc, char *argv[]) +{ + scm_boot_guile (argc, argv, tests, NULL); + return 0; +} |