Parent

Methods

Class/Module Index [+]

Quicksearch

Gst::Object

Public Instance Methods

test(tc) click to toggle source
# File gstreamer/tests/misc.rb, line 52
def test(tc)
    # Test name
    tc.assert_instance_of(String, n = name)
    unless is_a?(Gst::PadTemplate)
        tc.assert set_name("foo") == self
        tc.assert name == "foo"
        tc.assert (name = "bar") == "bar"
        tc.assert set_name(n) == self 
    end
    # Test flags
    flags = {
        destroyed? => Gst::Object::FLAG_DESTROYED,
        floating?  => Gst::Object::FLAG_FLOATING
    }
    test_flags(tc, flags)
end
test_flags(tc, flags) click to toggle source
# File gstreamer/tests/misc.rb, line 68
def test_flags(tc, flags)
    tc.assert_instance_of(Fixnum, f = self.flags)
    flags.each do |ok, flag|
        tc.assert_instance_of(Fixnum,  flag)
        tc.assert_bool ok
        tc.assert flag?(flag) == ok
        if ok
            tc.assert unset_flag(flag) == self
            tc.assert flag?(flag) == false
            tc.assert set_flag(flag) == self
        else
            tc.assert set_flag(flag) == self
            tc.assert flag?(flag) == true 
            tc.assert unset_flag(flag) == self 
        end    
    end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.