Sha256: 0633ed3823562e85e22da07545a74745e301a9ed9a8302de2fa3a1cb666594b5

Contents?: true

Size: 769 Bytes

Versions: 3

Compression:

Stored size: 769 Bytes

Contents

#!/usr/bin/env ruby
# encoding: UTF-8

require File.expand_path('../test_helper', __FILE__)

class MeasureGCRunsTest < TestCase
  include MemoryTestHelper

  def test_gc_runs_mode
    RubyProf::measure_mode = RubyProf::GC_RUNS
    assert_equal(RubyProf::GC_RUNS, RubyProf::measure_mode)
  end

  def test_gc_runs_enabled_defined
    assert(defined?(RubyProf::GC_RUNS_ENABLED))
  end

  if RubyProf::GC_RUNS_ENABLED
    def test_gc_runs
      t = RubyProf.measure_gc_runs
      assert_kind_of Integer, t

      GC.enable_stats if GC.respond_to?(:enable_stats)
      GC.start

      u = RubyProf.measure_gc_runs
      assert u > t, [t, u].inspect
      RubyProf::measure_mode = RubyProf::GC_RUNS
      memory_test_helper
    end
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
honeybadger-4.5.3 vendor/bundle/ruby/2.6.0/gems/ruby-prof-0.18.0/test/measure_gc_runs_test.rb
ruby-prof-0.18.0-x64-mingw32 test/measure_gc_runs_test.rb
ruby-prof-0.18.0 test/measure_gc_runs_test.rb