Included Modules

Class/Module Index [+]

Quicksearch

TestBin

Public Instance Methods

test_add() click to toggle source
# File gstreamer/test/test_bin.rb, line 64
def test_add
  bin = Gst::Bin.new
  element = create_element("fakesink")
  bin << element
  assert_equal(element, bin.children[0])
  assert_raise(TypeError) do
    bin << "XXX"
  end

  element2 = create_element("fakesink")
  element3 = create_element("fakesink")
  bin.add(element2, element3)
  assert_equal([element3, element2], bin.children[0, 2])
end
test_child_bus() click to toggle source
# File gstreamer/test/test_bin.rb, line 30
def test_child_bus
  bin = Gst::Bin.new
  assert_not_nil(bin.child_bus)
end
test_children() click to toggle source
# File gstreamer/test/test_bin.rb, line 4
def test_children
  bin = Gst::Bin.new

  element = create_element("filesink")
  no_interface_element = create_element("fakesink")
  bin << element << no_interface_element

  assert_equal([no_interface_element, element], bin.children)
  assert_equal([element], bin.children(Gst::ElementURIHandler))
end
test_clear() click to toggle source
# File gstreamer/test/test_bin.rb, line 89
def test_clear
  bin = Gst::Bin.new
  element1 = create_element("fakesink")
  element2 = create_element("fakesink")
  bin << element1 << element2
  assert_equal(2, bin.size)
  bin.clear
  assert_equal(0, bin.size)
end
test_clock_dirty?() click to toggle source
# File gstreamer/test/test_bin.rb, line 45
def test_clock_dirty?
  bin = Gst::Bin.new
  assert(!bin.clock_dirty?)
end
test_clock_provider() click to toggle source
# File gstreamer/test/test_bin.rb, line 59
def test_clock_provider
  bin = Gst::Bin.new
  assert_nil(bin.clock_provider)
end
test_messages() click to toggle source
# File gstreamer/test/test_bin.rb, line 35
def test_messages
  bin = Gst::Bin.new
  assert_equal([], bin.messages)
end
test_polling?() click to toggle source
# File gstreamer/test/test_bin.rb, line 40
def test_polling?
  bin = Gst::Bin.new
  assert(!bin.polling?)
end
test_provided_clock() click to toggle source
# File gstreamer/test/test_bin.rb, line 50
def test_provided_clock
  bin = Gst::Bin.new
  assert_nil(bin.provided_clock)
  bin.provided_clock = Gst::SystemClock.new
  assert_not_nil(bin.provided_clock)
  bin.provided_clock = nil
  assert_nil(bin.provided_clock)
end
test_refer_by_index() click to toggle source
# File gstreamer/test/test_bin.rb, line 129
def test_refer_by_index
  bin = Gst::Bin.new
  element1 = create_element("filesink")
  element2 = create_element("fakesink")

  assert_nil(bin.get_child(0))
  assert_nil(bin.get_child(1))
  assert_nil(bin.get_child(2))

  bin << element1 << element2
  assert_equal(element2, bin.get_child(0))
  assert_equal(element1, bin.get_child(1))
  assert_nil(bin.get_child(2))
end
test_refer_by_interface() click to toggle source
# File gstreamer/test/test_bin.rb, line 116
def test_refer_by_interface
  bin = Gst::Bin.new
  element = create_element("filesink")

  assert_nil(bin.get_child(Gst::ElementURIHandler))

  bin << create_element("fakesink")
  assert_nil(bin.get_child(Gst::ElementURIHandler))

  bin << element
  assert_equal(element, bin.get_child(Gst::ElementURIHandler))
end
test_refer_by_name() click to toggle source
# File gstreamer/test/test_bin.rb, line 99
def test_refer_by_name
  bin = Gst::Bin.new
  sub_bin = Gst::Bin.new
  bin << sub_bin

  element = create_element("fakesink")
  assert_nil(bin.get_child(element.name))
  assert_nil(sub_bin.get_child(element.name))
  assert_nil(sub_bin.get_child(element.name, true))

  bin << element
  assert_equal(element, bin.get_child(element.name))
  assert_equal(element, bin.get_child(element.name, true))
  assert_nil(sub_bin.get_child(element.name))
  assert_equal(element, sub_bin.get_child(element.name, true))
end
test_remove() click to toggle source
# File gstreamer/test/test_bin.rb, line 79
def test_remove
  bin = Gst::Bin.new
  element1 = create_element("fakesink")
  element2 = create_element("fakesink")
  bin << element1 << element2
  assert_equal(2, bin.size)
  bin.remove(element1, element2)
  assert_equal(0, bin.size)
end
test_sinks() click to toggle source
# File gstreamer/test/test_bin.rb, line 144
def test_sinks
  bin = Gst::Bin.new
  sink1 = create_element("filesink")
  sink2 = create_element("fakesink")
  src = create_element("fakesrc")

  assert_equal([], bin.sinks)

  bin << src << sink1 << sink2
  assert_equal([sink2, sink1], bin.sinks)
end
test_size() click to toggle source
# File gstreamer/test/test_bin.rb, line 15
def test_size
  bin = Gst::Bin.new
  assert_equal(0, bin.size)
  bin << create_element("fakesink")
  assert_equal(1, bin.size)
end
test_sources() click to toggle source
# File gstreamer/test/test_bin.rb, line 156
def test_sources
  bin = Gst::Bin.new
  src1 = create_element("filesrc")
  src2 = create_element("fakesrc")
  sink = create_element("fakesink")

  assert_equal([], bin.sources)

  bin << src1 << src2 << sink
  assert_equal([src2, src1], bin.sources)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.