[前][次][番号順一覧][スレッド一覧]

ruby-changes:74433

From: Jemma <ko1@a...>
Date: Fri, 11 Nov 2022 00:12:04 +0900 (JST)
Subject: [ruby-changes:74433] 9986697b62 (master): Omit test on IO Buffers which relies on String being embedded

https://git.ruby-lang.org/ruby.git/commit/?id=9986697b62

From 9986697b621e5345177a1c395489dcc9fab8602b Mon Sep 17 00:00:00 2001
From: Jemma Issroff <jemmaissroff@g...>
Date: Tue, 8 Nov 2022 15:35:31 -0500
Subject: Omit test on IO Buffers which relies on String being embedded

There is currently a bug ([#19084]) in how extended strings work in
IO Buffers. Object Shapes changes will make the string in this test
extended on 32 bit machines. Since this behavior is currently broken
(unrelated to object shapes) on 32 bit machines, this test will then
fail. We preemptively omit it so that this commit can be reverted
once the bug is fixed.
---
 test/ruby/test_io_buffer.rb | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/test/ruby/test_io_buffer.rb b/test/ruby/test_io_buffer.rb
index 2204c3db09..70070e93c9 100644
--- a/test/ruby/test_io_buffer.rb
+++ b/test/ruby/test_io_buffer.rb
@@ -330,6 +330,10 @@ class TestIOBuffer < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_io_buffer.rb#L330
   end
 
   def test_read
+    # This is currently a bug in IO:Buffer [#19084] which affects extended
+    # strings. On 32 bit machines, the example below becomes extended, so
+    # we omit this test until the bug is fixed.
+    omit if GC::INTERNAL_CONSTANTS[:SIZE_POOL_COUNT] == 1
     io = Tempfile.new
     io.write("Hello World")
     io.seek(0)
@@ -339,7 +343,7 @@ class TestIOBuffer < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_io_buffer.rb#L343
 
     assert_equal "Hello", buffer.get_string(0, 5)
   ensure
-    io.close!
+    io.close! if io
   end
 
   def test_write
-- 
cgit v1.2.3


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]