From 984e0233fe0c60fb5c6c5f937c214e30c1b7c6f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3?= Date: Mon, 17 Feb 2020 16:57:45 +0900 Subject: [PATCH] TestTime#test_memsize: skip when on GC_DEBUG GC_DEBUG=1 makes this test fail because it changes the size of struct RVALUE. I don't think the test is useful then. Let's just skip. --- gc.c | 1 + test/ruby/test_time.rb | 1 + 2 files changed, 2 insertions(+) diff --git a/gc.c b/gc.c index f0de80ca71..fba751b24c 100644 --- a/gc.c +++ b/gc.c @@ -11851,6 +11851,7 @@ Init_GC(void) rb_mGC = rb_define_module("GC"); gc_constants = rb_hash_new(); + rb_hash_aset(gc_constants, ID2SYM(rb_intern("DEBUG")), GC_DEBUG ? Qtrue : Qfalse); rb_hash_aset(gc_constants, ID2SYM(rb_intern("RVALUE_SIZE")), SIZET2NUM(sizeof(RVALUE))); rb_hash_aset(gc_constants, ID2SYM(rb_intern("HEAP_PAGE_OBJ_LIMIT")), SIZET2NUM(HEAP_PAGE_OBJ_LIMIT)); rb_hash_aset(gc_constants, ID2SYM(rb_intern("HEAP_PAGE_BITMAP_SIZE")), SIZET2NUM(HEAP_PAGE_BITMAP_SIZE)); diff --git a/test/ruby/test_time.rb b/test/ruby/test_time.rb index 0ff09f3fcb..785376f09c 100644 --- a/test/ruby/test_time.rb +++ b/test/ruby/test_time.rb @@ -1256,6 +1256,7 @@ class TestTime < Test::Unit::TestCase def test_memsize # Time objects are common in some code, try to keep them small skip "Time object size test" if /^(?:i.?86|x86_64)-linux/ !~ RUBY_PLATFORM + skip "GC is in debug" if GC::INTERNAL_CONSTANTS[:DEBUG] require 'objspace' t = Time.at(0) size = GC::INTERNAL_CONSTANTS[:RVALUE_SIZE]