1 /* Copyright (C) 2012 Free Software Foundation, Inc.
3 * This library is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU Lesser General Public License
5 * as published by the Free Software Foundation; either version 3 of
6 * the License, or (at your option) any later version.
8 * This library is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Lesser General Public License for more details.
13 * You should have received a copy of the GNU Lesser General Public
14 * License along with this library; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
29 test_scm_c_value_ref_on_multiple_values ()
31 SCM values
= scm_values (scm_list_3 (scm_from_latin1_string ("foo"),
32 scm_from_latin1_string ("bar"),
33 scm_from_latin1_string ("baz")));
35 char *foo
= scm_to_latin1_string (scm_c_value_ref (values
, 0));
36 char *bar
= scm_to_latin1_string (scm_c_value_ref (values
, 1));
37 char *baz
= scm_to_latin1_string (scm_c_value_ref (values
, 2));
39 assert (strcmp (foo
, "foo") == 0);
40 assert (strcmp (bar
, "bar") == 0);
41 assert (strcmp (baz
, "baz") == 0);
49 test_scm_c_value_ref_on_a_single_value ()
51 SCM value
= scm_from_latin1_string ("foo");
52 char *foo
= scm_to_latin1_string (scm_c_value_ref (value
, 0));
53 assert (strcmp (foo
, "foo") == 0);
58 tests (void *data
, int argc
, char **argv
)
60 test_scm_c_value_ref_on_multiple_values ();
61 test_scm_c_value_ref_on_a_single_value ();
65 main (int argc
, char *argv
[])
67 scm_boot_guile (argc
, argv
, tests
, NULL
);