Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unused test helpers #10021

Merged
merged 2 commits into from
Feb 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
25 changes: 0 additions & 25 deletions test/ruby/test_gc_compact.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true
require 'test/unit'
require 'fiddle'
require 'etc'

if RUBY_PLATFORM =~ /s390x/
warn "Currently, it is known that the compaction does not work well on s390x; contribution is welcome https://github.com/ruby/ruby/pull/5077"
Expand Down Expand Up @@ -112,10 +110,6 @@ def test_gc_verify_compaction_references_not_implemented
end
end

def os_page_size
return true unless defined?(Etc::SC_PAGE_SIZE)
end

def test_gc_compact_stats
list = []

Expand All @@ -130,10 +124,6 @@ def test_gc_compact_stats
refute_predicate compact_stats[:moved], :empty?
end

def memory_location(obj)
(Fiddle.dlwrap(obj) >> 1)
end

def big_list(level = 10)
if level > 0
big_list(level - 1)
Expand All @@ -146,21 +136,6 @@ def big_list(level = 10)
end
end

# Find an object that's allocated in a slot that had a previous
# tenant, and that tenant moved and is still alive
def find_object_in_recycled_slot(addresses)
new_object = nil

100_000.times do
new_object = Object.new
if addresses.index memory_location(new_object)
break
end
end

new_object
end

def test_complex_hash_keys
list_of_objects = big_list
hash = list_of_objects.hash
Expand Down