summaryrefslogtreecommitdiff
path: root/test-suite/standalone/test-srfi-1.c
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2010-09-12 23:18:54 +0200
committerAndy Wingo <wingo@pobox.com>2010-09-12 23:29:11 +0200
commit37710f7e8f63f784de0343c1948e8afbbc10e395 (patch)
tree8d96cda7a538c82c3f981454392d799aafa5c1eb /test-suite/standalone/test-srfi-1.c
parent4453f887ed6004126a73673f76853b30263209aa (diff)
downloadguile-37710f7e8f63f784de0343c1948e8afbbc10e395.tar.gz
move srfi-1 and srfi-60 C impl to libguile, without public C api
* libguile/srfi-1.c: * libguile/srfi-1.h: * libguile/srfi-60.c: * libguile/srfi-60.h: * libguile/ChangeLog-srfi: Move here, from the srfi/ dir. The C API is internal. Add API to register the extensions, called by init.c. * libguile/init.c: Verily, register srfi extensions. * libguile/Makefile.am: Add srfi files. * module/srfi/srfi-1.scm: * module/srfi/srfi-60.scm: Update load-extension invocation. * Makefile.am: * configure.ac: Remove srfi/ dir. * test-suite/standalone/Makefile.am: * test-suite/standalone/test-srfi-1.c: Remove srfi-1 C test, we don't support this API any more.
Diffstat (limited to 'test-suite/standalone/test-srfi-1.c')
-rw-r--r--test-suite/standalone/test-srfi-1.c86
1 files changed, 0 insertions, 86 deletions
diff --git a/test-suite/standalone/test-srfi-1.c b/test-suite/standalone/test-srfi-1.c
deleted file mode 100644
index 995c20e95..000000000
--- a/test-suite/standalone/test-srfi-1.c
+++ /dev/null
@@ -1,86 +0,0 @@
-/* Copyright (C) 2010 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
- */
-
-/* Exercise the compatibility layer of `libguile-srfi-srfi-1'. */
-
-#ifndef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <libguile.h>
-#include <srfi/srfi-1.h>
-
-#include <stdlib.h>
-
-static void
-failure (const char *proc, SCM result)
-{
- scm_simple_format (scm_current_error_port (),
- scm_from_locale_string ("`~S' failed: ~S~%"),
- scm_list_2 (scm_from_locale_symbol (proc), result));
-}
-
-static void *
-tests (void *data)
-{
- SCM times, negative_p, lst, result;
-
- scm_init_srfi_1 ();
-
- times = SCM_VARIABLE_REF (scm_c_lookup ("*"));
- lst = scm_list_3 (scm_from_int (1), scm_from_int (2), scm_from_int (3));
-
- /* (fold * 1 '(1 2 3) '(1 2 3)) */
- result = scm_srfi1_fold (times, scm_from_int (1), lst, scm_list_1 (lst));
-
- if (scm_to_int (result) == 36)
- {
- negative_p = SCM_VARIABLE_REF (scm_c_lookup ("negative?"));
- result = scm_srfi1_break (negative_p,
- scm_list_3 (scm_from_int (1),
- scm_from_int (2),
- scm_from_int (-1)));
-
- if (SCM_VALUESP (result))
- /* There's no API to access the values, so assume this is OK. */
- * (int *) data = EXIT_SUCCESS;
- else
- {
- failure ("break", result);
- * (int *) data = EXIT_FAILURE;
- }
- }
- else
- {
- failure ("fold", result);
- * (int *) data = EXIT_FAILURE;
- }
-
- return data;
-}
-
-
-int
-main (int argc, char *argv[])
-{
- int ret;
-
- scm_with_guile (tests, &ret);
-
- return ret;
-}