File: test-gc.rb

package info (click to toggle)
ruby-gnome 4.3.4-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 22,320 kB
  • sloc: ruby: 55,206; ansic: 29,012; xml: 333; sh: 229; cpp: 45; makefile: 42
file content (22 lines) | stat: -rw-r--r-- 476 bytes parent folder | download | duplicates (13)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
class TestGC < Test::Unit::TestCase
  priority :must
  def test_closure
    10.times do
      invisible = Gtk::Invisible.new
      invisible.signal_connect("destroy") {}
      GC.start
    end
  end

  def test_inheritance_and_gc
    button = Class.new(Gtk::Button)
    box = Gtk::Box.new(:horizontal)
    n = 10
    n.times do
      box.add(button.new)
    end
    GC.start
    assert_equal([button] * 10,
                 box.children.collect {|item| item.class})
  end
end