1 /* Copyright (C) 2009 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
5 * License as published by the Free Software Foundation; either
6 * version 2.1 of the License, or (at your option) any later version.
8 * This library is distributed in the hope that it will be useful,
9 * but 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 02110-1301 USA
18 /* Exercise `scm_take_locale_symbol ()', making sure it returns an interned
19 symbol. See https://savannah.gnu.org/bugs/index.php?25865 . */
32 do_test (void *result)
36 taken_sym = scm_take_locale_symbol (strdup ("some random symbol"));
37 sym = scm_from_locale_symbol ("some random symbol");
39 if (scm_is_true (scm_symbol_p (sym))
40 && scm_is_true (scm_symbol_p (taken_sym))
42 /* Relying solely on `scm_symbol_interned_p ()' is insufficient since
43 it doesn't reflect the actual state of the symbol hashtable, hence
44 the additional `scm_is_eq' test. */
45 && scm_is_true (scm_symbol_interned_p (sym))
46 && scm_is_true (scm_symbol_interned_p (taken_sym))
47 && scm_is_eq (taken_sym, sym))
48 * (int *) result = EXIT_SUCCESS;
50 * (int *) result = EXIT_FAILURE;
56 main (int argc, char *argv[])
60 scm_with_guile (do_test, &result);