Author: yamakenz
Date: Thu Nov 22 02:45:41 2007
New Revision: 5047

Modified:
  sigscheme-trunk/src/storage-compact.h
  sigscheme-trunk/test/test-string-proc.scm

Log:
* src/storage-compact.h
 - (SCM_ISAL_SYMBOL_INIT): Simplify
* test/test-string-proc.scm
 - Add tests for the bug fixed in r5040


Modified: sigscheme-trunk/src/storage-compact.h
==============================================================================
--- sigscheme-trunk/src/storage-compact.h       (original)
+++ sigscheme-trunk/src/storage-compact.h       Thu Nov 22 02:45:41 2007
@@ -642,11 +642,11 @@
#define SCM_ISAL_SYMBOL_INIT(o, n, c) \ do { \ char *_s = scm_align_str(n); \ - (SCM_ASSERT(SCM_ALIGNED_SYMBOL_NAME(_s)), \ - SCM_INIT((o), \ - (c), \ - (scm_uintobj_t)(_s) | SCM_MTAG_SYMBOL, \ - SCM_PTAG_MISC)); \ + SCM_ASSERT(SCM_ALIGNED_SYMBOL_NAME(_s)); \ + SCM_INIT((o), \ + (c), \ + (scm_uintobj_t)(_s) | SCM_MTAG_SYMBOL, \ + SCM_PTAG_MISC); \
    } while (0)
#define SCM_CELL_SYMBOLP(c)            SCM_MISC_CELL_TYPEP((c), SYMBOL)
#define SCM_CELL_SYMBOL_FIN(c) \

Modified: sigscheme-trunk/test/test-string-proc.scm
==============================================================================
--- sigscheme-trunk/test/test-string-proc.scm   (original)
+++ sigscheme-trunk/test/test-string-proc.scm   Thu Nov 22 02:45:41 2007
@@ -545,6 +545,11 @@
      (assert-error  (tn) (lambda () (string-set! (cp "あaうb") 3 #x00)))
      (assert-error  (tn) (lambda () (string-set! (cp "あaうb") 4 #x00)))
      (assert-error  (tn) (lambda () (string-set! (cp "あaうb") 5 #x00)))))
+;; Tests for the bug fixed in r5040
+(tn "string-set! multibyte char modification")
+(assert-equal? (tn) "Aabcde" (my-string-set! (cp "あabcde") 0 #\A))
+(assert-equal? (tn) "Aaう"   (my-string-set! (cp "あaう")   0 #\A))
+(assert-equal? (tn) "Aaうb"  (my-string-set! (cp "あaうb")  0 #\A))

(tn "substring invalid forms")
(assert-error  (tn) (lambda () (substring #\a 0 0)))

Reply via email to