1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-12 00:30:20 +02:00
Commit graph

919 commits

Author SHA1 Message Date
Neil Jerram
53a79cd060 Fix implementation of %fast-slot-ref and %fast-slot-set!
* libguile/goops.c (scm_sys_fast_slot_ref, scm_sys_fast_slot_set_x):
  Correct incantation for getting the number of slots of the specified
  instance.

* libguile/goops.h (SCM_NUMBER_OF_SLOTS): Removed (because wrong).

* test-suite/standalone/test-fast-slot-ref.in: New standalone test.

* configure.in: Generate test-suite/standalone/test-fast-slot-ref.

* test-suite/standalone/Makefile.am (check_SCRIPTS): Add
  test-fast-slot-ref.
2009-01-04 22:41:51 +00:00
Neil Jerram
1ea97c4264 Several new hash table tests, written by Gregory Marton.
* test-suite/tests/hash.test ("make-hash-table, hash-table?",
  "hash-set and hash-ref", "auto-resizing hashx", "hashx"): New tests.

* AUTHORS, THANKS: Add Gregory Marton as a contributor.
2008-12-07 16:27:44 +00:00
Ludovic Courtès
deee086c8d Fix sloppy bound checking in `string-{ref,set!}' with the empty string.
* libguile/strings.c (scm_string_ref): Add proper range checking for the
  empty string.
  (scm_string_set_x): Likewise.
  Reported by Bill Schottstaedt <bil@ccrma.Stanford.EDU>.

* test-suite/tests/strings.test ("string-ref"): New test prefix.
  ("string-set!")["empty string", "empty string and non-zero index",
  "out of range", "negative index", "regular string"]: New tests.

* NEWS: Update.
2008-12-02 19:42:39 +01:00
Ludovic Courtès
2ae217f418 Run the handler of SRFI-34's `with-exception-handler' in the right dyn. env.
* srfi/srfi-34.scm (with-exception-handler): Use `with-throw-handler'
  instead of `lazy-catch'.

* test-suite/tests/srfi-34.test ("SRFI 34")["`with-exception-handler'
  invokes HANDLER in THUNK's dynamic env."]: New test.

* test-suite/tests/srfi-39.test: Use `(srfi srfi-34)'.
  ("SRFI-39")["SRFI-34"]: New test.

* NEWS: Update.
2008-11-24 09:41:53 +01:00
Ludovic Courtès
f36b070b65 Fix comments in `test-scm-c-read.c'.
* test-suite/standalone/test-scm-c-read.c (make_port): Fix comments.
2008-11-24 09:41:50 +01:00
Ludovic Courtès
86b9e1d9c9 Add C unit test for `scm_c_read ()' and the port API.
* test-suite/standalone/Makefile.am (check_PROGRAMS, TESTS): Add
  `test-scm-c-read'.
  (test_scm_c_read_SOURCES, test_scm_c_read_CFLAGS,
  test_scm_c_read_LDADD): New.
2008-11-23 22:44:41 +00:00
Ludovic Courtès
cd1a1e47b5 Update the thread stack base when `scm_with_guile' is invoked multiple times.
* NEWS: Update.

* libguile/threads.c (scm_i_init_thread_for_guile): When the thread is
  already guilified, update `t->base' so that it corresponds to the new
  stack base.  Bug report and patch by Linas Vepstas <linasvepstas@gmail.com>.

* test-suite/standalone/Makefile.am (test_scm_with_guile_CFLAGS,
  test_scm_with_guile_LDADD): New.
  (check_PROGRAMS, TESTS): Add `test-scm-with-guile'.
2008-11-14 00:35:32 +01:00
Ludovic Courtès
b578508acd Augment `.gitignore'. 2008-11-13 23:33:42 +01:00
Neil Jerram
05675184ee Avoid Stack overflow' errors when running make check'
For explanation, see comments and text in the new file
libguile/measure-hwm.scm.

* .gitignore: Add libguile/stack-limit-calibration.scm.

* check-guile.in: Load libguile/stack-limit-calibration.scm.

* configure.in: Add AC_CONFIG_FILES to generate test-use-srfi from
  test-use-srfi.in.

* libguile/Makefile.am (TESTS, TESTS_ENVIRONMENT,
  stack-limit-calibration.scm): New targets, so that `make check'
  calibrates the stack limit before running the Guile test suite.

* libguile/measure-hwm.scm: New file, calibrates stack limit for `make
  check'.

* libguile/stackchk.c (scm_sys_get_stack_size): New primitive.

* libguile/stackchk.h (scm_sys_get_stack_size): New primitive
  (declaration).

* test-suite/standalone/test-use-srfi: Renamed test-use-srfi.in, so
  that ./configure can fill in variables in it.

* test-suite/standalone/test-use-srfi.in: Load
  libguile/stack-limit-calibration.scm.
2008-10-17 22:02:17 +01:00
Ludovic Courtès
89fc8adea3 Add test case to make sure `read' returns mutable strings.
* test-suite/tests/reader.test ("reading")["returned strings are
  mutable"]: New test, as reported by szgyg <szgyg@ludens.elte.hu>.
2008-10-09 23:24:07 +02:00
Ludovic Courtès
4b600701b9 Revert "Make literal strings (i.e., returned by `read') read-only."
This reverts commit be5c4a82ab.

The rationale is that `read' must return mutable strings, as reported
by szgyg <szgyg@ludens.elte.hu>.
2008-10-09 23:23:27 +02:00
Ludovic Courtès
097158c936 Enclose `regexp.test' in a module.
* test-suite/tests/regexp.test: Add `define-module' clause.
2008-09-25 21:37:21 +02:00
Ludovic Courtès
afb28ce860 Fix handling of the FLAGS argument in `fold-matches'.
* ice-9/regex.scm (fold-matches): If FLAGS is non-null, use
  `(car flags)', not `flags'.

* test-suite/tests/regexp.test ("fold-matches"): New test prefix.

* NEWS: Update.
2008-09-25 21:37:18 +02:00
Ludovic Courtès
be5c4a82ab Make literal strings (i.e., returned by `read') read-only.
* libguile/read.c (scm_read_string): Use `scm_i_make_read_only_string ()' to
  return a read-only string, as mandated by R5RS.  Reported by Bill
  Schottstaedt <bil@ccrma.Stanford.EDU>.

* libguile/strings.c (scm_i_make_read_only_string): New function.
  (scm_i_shared_substring_read_only): Special-case the empty string
  so that the read-only and read-write empty strings are `eq?'.  This
  optimization is relied on by the `substring/shared' `empty string'
  test case in `srfi-13.test'.

* libguile/strings.h (scm_i_make_read_only_string): New declaration.

* test-suite/tests/strings.test ("string-set!")["literal string"]: New test.

* NEWS: Update.
2008-09-23 18:39:18 +02:00
Ludovic Courtès
40de0323e7 Make `symbol->string' return a read-only string.
* libguile/strings.c (scm_i_symbol_substring): Return a read-only string
  since R5RS requires `symbol->string' to return a read-only string.
  Reported by Bill Schottstaedt <bil@ccrma.Stanford.EDU>.

* test-suite/tests/symbols.test: Add `define-module' clause.
  (exception:immutable-string): Adjust to current exception.
  ("symbol->string")["result is an immutable string"]: Use
  `pass-if-exception' instead of `expect-fail-exception'.

* NEWS: Update.
2008-09-23 18:39:10 +02:00
Neil Jerram
0bf4fe19a6 Fix for incorrect (gcd -2) => -2; should give 2.
(reported by Bill Schottstaedt)

* libguile/numbers.c (scm_gcd): When only one arg given, use scm_abs
  to ensure that result is non-negative.

* test-suite/tests/numbers.test ("gcd"): New test, (gcd -2).
2008-09-22 21:18:01 +01:00
Ludovic Courtès
972b5d7045 Include <config.h> in standalone tests.
* test-suite/standalone/Makefile.am (test_cflags): Add `-I$(top_builddir)' so
  that <config.h> can be found.
  (snarfcppopts): Likewise.

* test-suite/standalone/*.c: Include <config.h>.
2008-09-13 20:12:10 +02:00
Ludovic Courtès
8073f24ccd Add `ChangeLog-2008' files to the distribution. 2008-09-12 21:46:32 +02:00
Ludovic Courtès
e9d9445b50 Rename ChangeLog' files to ChangeLog-2008'. 2008-09-12 21:42:26 +02:00
Ludovic Courtès
365db7e640 Remove `.cvsignore' files. 2008-09-11 21:48:53 +02:00
Ludovic Courtès
cfabe1e2e4 Revert "Add `SCM_INTERNAL' macro, use it."
This reverts commit f0c64044d3.
2008-09-04 20:26:55 +02:00
Ludovic Courtès
f4833b3906 Add test case for the GOOPS `class-redefinition' memory corruption. 2008-08-20 00:46:57 +02:00
Ludovic Courtès
10a529b027 Use `-q' when running standalone tests. 2008-07-06 23:58:15 +02:00
Ludovic Courtès
90e97a7b4b Support systems whose <inttypes.h> doesn't define `PRIiMAX'. 2008-06-02 21:51:16 +02:00
Ludovic Courtès
f0c64044d3 Add `SCM_INTERNAL' macro, use it. 2008-05-31 23:16:41 +02:00
Ludovic Courtès
5338352e56 Fix type-checking of SRFI-1 `partition'. 2008-04-28 18:03:41 +02:00
Ludovic Courtès
e16733a84a Only run `test-with-guile-module' when pthread support is built. 2008-04-26 21:55:29 +02:00
Ludovic Courtès
23978ff30a Make (srfi srfi-35)' visible through cond-expand'. 2008-04-26 21:25:51 +02:00
Ludovic Courtès
efbc70de56 Add `(srfi srfi-88)'. 2008-04-26 21:25:32 +02:00
Ludovic Courtès
75946eddfc Add support for SRFI-88-like postfix keyword read syntax. 2008-04-15 20:00:32 +02:00
Ludovic Courtès
b337315785 Test the interaction of GOOPS objects with `struct-{ref,set!}'. 2008-04-13 20:41:39 +02:00
Ludovic Courtès
5e8130efc3 Fix "#include" directives in stand-alone C tests. 2008-04-08 00:15:06 +02:00
Ludovic Courtès
8422eb9290 More `.gitignore'. 2008-04-07 23:48:08 +02:00
Ludovic Courtès
792ebd5dc4 Honor $TMPDIR in the test suite. 2008-03-13 13:56:43 +00:00
Ludovic Courtès
c89ae78ba6 Fix SRFI-37 `args-fold' with short option names of argument-less options. 2008-03-12 16:57:36 +00:00
Neil Jerram
1adbcd2eaa Updated to GNU coding
standards; added standard license statement.
2008-02-23 18:08:24 +00:00
Neil Jerram
5826bf6572 Release stuff: missing NEWS and 2007/2008 copyrights. 2008-02-15 22:37:52 +00:00
Ludovic Courtès
ffa88bdd5d Add hack for `gc.test' on SPARC GNU/Linux. 2008-02-15 15:59:34 +00:00
Neil Jerram
a06872c2bc * modules.c (the_root_module): Moved before scm_current_module.
(scm_current_module): Return the root module if `the-module' fluid
gives #f.

* standalone/Makefile.am: Add stanza for test-with-guile-module.

* standalone/test-with-guile-module.c: New test.
2008-02-01 22:47:53 +00:00
Neil Jerram
738f9ef01f * LICENSE: Change COPYING.LIB to COPYING.LESSER.
* COPYING.LESSER: Renamed, previously COPYING.LIB.

* COPYING: Removed.

* COPYING: Removed.

* COPYING: Removed.

* COPYING: Removed.

* COPYING: Removed.

* COPYING: Removed.

* COPYING: Removed.

* COPYING: Removed.
2008-01-22 21:29:54 +00:00
Neil Jerram
1978dd74b8 * hashtab.c (scm_hash_fn_create_handle_x): If supplied assoc_fn
returns neither a pair nor #f, signal a wrong-type-arg error.
(Thanks to Gregory Marton for reporting this.)

* tests/hash.test: New "hashx" test supplied by Gregory Marton;
prior to today's fix in libguile/hashtab.c, this caused a
segmentation fault.
2008-01-18 23:40:49 +00:00
Neil Jerram
95da7a8613 (top level): Explain the point of this test. 2007-12-29 12:33:18 +00:00
Neil Jerram
276cff1a52 * standalone/test-bad-identifiers: New test.
* standalone/Makefile.am (check_SCRIPTS, TESTS): Add it.
2007-12-29 01:34:19 +00:00
Ludovic Courtès
7c680febe5 Changes from arch/CVS synchronization 2007-12-13 12:32:02 +00:00
Ludovic Courtès
2bfaaa3ab7 Add missing SRFI-69 files. 2007-12-13 12:29:26 +00:00
Ludovic Courtès
8e0ea2987d Changes from arch/CVS synchronization 2007-12-03 14:15:54 +00:00
Neil Jerram
6f640c9f22 * tests/eval.test (promises)[unmemoizing a promise]: New test.
* tests/continuations.test ("continuations"): Use
with-debugging-evaluator.

* standalone/test-use-srfi: Use -q to avoid picking up the user's
~/.guile file

* lib.scm (with-debugging-evaluator*, with-debugging-evaluator):
New utilities.
2007-10-19 22:07:31 +00:00
Ludovic Courtès
dfdb8448a9 Changes from arch/CVS synchronization 2007-10-17 22:16:44 +00:00
Ludovic Courtès
02e73552f1 Changes from arch/CVS synchronization 2007-10-10 20:21:25 +00:00
Ludovic Courtès
dbb47af4a6 Changes from arch/CVS synchronization 2007-09-03 17:04:49 +00:00