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 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
19 /* Exercise `scm_take_locale_symbol ()', making sure it returns an interned
20 symbol. See https://savannah.gnu.org/bugs/index.php?25865 . */
33 do_test (void *result
)
37 taken_sym
= scm_take_locale_symbol (strdup ("some random symbol"));
38 sym
= scm_from_locale_symbol ("some random symbol");
40 if (scm_is_true (scm_symbol_p (sym
))
41 && scm_is_true (scm_symbol_p (taken_sym
))
43 /* Relying solely on `scm_symbol_interned_p ()' is insufficient since
44 it doesn't reflect the actual state of the symbol hashtable, hence
45 the additional `scm_is_eq' test. */
46 && scm_is_true (scm_symbol_interned_p (sym
))
47 && scm_is_true (scm_symbol_interned_p (taken_sym
))
48 && scm_is_eq (taken_sym
, sym
))
49 * (int *) result
= EXIT_SUCCESS
;
51 * (int *) result
= EXIT_FAILURE
;
57 main (int argc
, char *argv
[])
61 scm_with_guile (do_test
, &result
);