Commit | Line | Data |
---|---|---|
2948fc75 KR |
1 | /* test-list.c - exercise libguile/list.c functions */ |
2 | ||
93003b16 | 3 | /* Copyright (C) 2006, 2008, 2009, 2010 Free Software Foundation, Inc. |
2948fc75 KR |
4 | * |
5 | * This library is free software; you can redistribute it and/or | |
53befeb7 NJ |
6 | * modify it under the terms of the GNU Lesser General Public License |
7 | * as published by the Free Software Foundation; either version 3 of | |
8 | * the License, or (at your option) any later version. | |
2948fc75 | 9 | * |
53befeb7 NJ |
10 | * This library is distributed in the hope that it will be useful, but |
11 | * WITHOUT ANY WARRANTY; without even the implied warranty of | |
2948fc75 KR |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | * Lesser General Public License for more details. | |
14 | * | |
15 | * You should have received a copy of the GNU Lesser General Public | |
16 | * License along with this library; if not, write to the Free Software | |
53befeb7 NJ |
17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
18 | * 02110-1301 USA | |
2948fc75 KR |
19 | */ |
20 | ||
3394818c LC |
21 | #ifndef HAVE_CONFIG_H |
22 | # include <config.h> | |
23 | #endif | |
24 | ||
5995c6d8 | 25 | #include <libguile.h> |
2948fc75 | 26 | |
93003b16 | 27 | #include <stdlib.h> |
2948fc75 | 28 | #include <stdio.h> |
2948fc75 KR |
29 | #include <string.h> |
30 | ||
31 | /* pretty trivial, but ensure this entrypoint exists, since it was | |
32 | documented in Guile 1.6 and earlier */ | |
33 | static void | |
34 | test_scm_list (void) | |
35 | { | |
36 | { | |
37 | if (! scm_is_eq (SCM_EOL, scm_list (SCM_EOL))) | |
38 | { | |
39 | fprintf (stderr, "fail: scm_list SCM_EOL\n"); | |
93003b16 | 40 | exit (EXIT_FAILURE); |
2948fc75 KR |
41 | } |
42 | } | |
43 | ||
44 | { | |
45 | SCM lst = scm_list_2 (scm_from_int (1), scm_from_int (2)); | |
46 | if (! scm_is_true (scm_equal_p (lst, scm_list (lst)))) | |
47 | { | |
48 | fprintf (stderr, "fail: scm_list '(1 2)\n"); | |
93003b16 | 49 | exit (EXIT_FAILURE); |
2948fc75 KR |
50 | } |
51 | } | |
52 | } | |
53 | ||
8ab3d8a0 KR |
54 | static void |
55 | tests (void *data, int argc, char **argv) | |
2948fc75 | 56 | { |
2948fc75 | 57 | test_scm_list (); |
8ab3d8a0 KR |
58 | } |
59 | ||
60 | int | |
61 | main (int argc, char *argv[]) | |
62 | { | |
63 | scm_boot_guile (argc, argv, tests, NULL); | |
2948fc75 KR |
64 | return 0; |
65 | } |