[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] GNU Guile branch, master, updated. release_1-9-15-95-g99
From: |
Andy Wingo |
Subject: |
[Guile-commits] GNU Guile branch, master, updated. release_1-9-15-95-g99015f6 |
Date: |
Mon, 14 Feb 2011 19:17:01 +0000 |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".
http://git.savannah.gnu.org/cgit/guile.git/commit/?id=99015f6d4e6026de761f95f6446fc9b49f8b6311
The branch, master has been updated
via 99015f6d4e6026de761f95f6446fc9b49f8b6311 (commit)
via ca65967360ba9d9564435b9c16839cea8b69a9a6 (commit)
from 533d8212af5476764a465a2814869172a32a9ead (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 99015f6d4e6026de761f95f6446fc9b49f8b6311
Author: Andy Wingo <address@hidden>
Date: Mon Feb 14 20:21:04 2011 +0100
add vector-move test cases
* test-suite/tests/vectors.test ("vector-move-left!")
("vector-move-right!"): Add test cases for recent bug.
commit ca65967360ba9d9564435b9c16839cea8b69a9a6
Author: Ian Price <address@hidden>
Date: Mon Feb 14 03:44:31 2011 +0000
fix fencepost error in vector-move-left! and -right!
* libguile/vectors.c (scm_vector_move_right_x, scm_vector_move_left_x):
Fix edge case.
-----------------------------------------------------------------------
Summary of changes:
libguile/vectors.c | 4 ++--
test-suite/tests/vectors.test | 14 +++++++++++++-
2 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/libguile/vectors.c b/libguile/vectors.c
index f9b4fc2..2ab5b78 100644
--- a/libguile/vectors.c
+++ b/libguile/vectors.c
@@ -533,7 +533,7 @@ SCM_DEFINE (scm_vector_move_left_x, "vector-move-left!", 5,
0, 0,
i = scm_to_unsigned_integer (start1, 0, len1);
e = scm_to_unsigned_integer (end1, i, len1);
- SCM_ASSERT_RANGE (SCM_ARG3, end1, (e-i) < len2);
+ SCM_ASSERT_RANGE (SCM_ARG3, end1, (e-i) <= len2);
j = scm_to_unsigned_integer (start2, 0, len2);
SCM_ASSERT_RANGE (SCM_ARG5, start2, j <= len2 - (e - i));
@@ -573,7 +573,7 @@ SCM_DEFINE (scm_vector_move_right_x, "vector-move-right!",
5, 0, 0,
i = scm_to_unsigned_integer (start1, 0, len1);
e = scm_to_unsigned_integer (end1, i, len1);
- SCM_ASSERT_RANGE (SCM_ARG3, end1, (e-i) < len2);
+ SCM_ASSERT_RANGE (SCM_ARG3, end1, (e-i) <= len2);
j = scm_to_unsigned_integer (start2, 0, len2);
SCM_ASSERT_RANGE (SCM_ARG5, start2, j <= len2 - (e - i));
diff --git a/test-suite/tests/vectors.test b/test-suite/tests/vectors.test
index f4df7de..97b3f18 100644
--- a/test-suite/tests/vectors.test
+++ b/test-suite/tests/vectors.test
@@ -1,6 +1,6 @@
;;;; vectors.test --- test suite for Guile's vector functions -*- scheme -*-
;;;;
-;;;; Copyright (C) 2003, 2006, 2010 Free Software Foundation, Inc.
+;;;; Copyright (C) 2003, 2006, 2010, 2011 Free Software Foundation, Inc.
;;;;
;;;; This library is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Lesser General Public
@@ -97,6 +97,12 @@
(vector-move-left! a 3 5 b 7)
(equal? b #(10 20 30 40 50 60 70 4 5))))
+ (pass-if "whole thing"
+ (let ((a (vector 1 2 3 4 5 6 7 8 9))
+ (b (vector 10 20 30 40 50 60 70 80 90)))
+ (vector-move-left! a 0 9 b 0)
+ (equal? b #(1 2 3 4 5 6 7 8 9))))
+
(pass-if-exception "past end" exception:out-of-range
(let ((a (vector 1 2 3 4 5 6 7 8 9))
(b (vector 10 20 30 40 50 60 70 80 90)))
@@ -137,6 +143,12 @@
(vector-move-right! a 3 5 b 7)
(equal? b #(10 20 30 40 50 60 70 4 5))))
+ (pass-if "whole thing"
+ (let ((a (vector 1 2 3 4 5 6 7 8 9))
+ (b (vector 10 20 30 40 50 60 70 80 90)))
+ (vector-move-right! a 0 9 b 0)
+ (equal? b #(1 2 3 4 5 6 7 8 9))))
+
(pass-if-exception "past end" exception:out-of-range
(let ((a (vector 1 2 3 4 5 6 7 8 9))
(b (vector 10 20 30 40 50 60 70 80 90)))
hooks/post-receive
--
GNU Guile
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Guile-commits] GNU Guile branch, master, updated. release_1-9-15-95-g99015f6,
Andy Wingo <=