[Vala] Using TestCase class: assert (this is Object) fails in method, but not in constructor



Have a look at this code:

    public class Tests : Object {

        public Tests () {
            assert (this is Object); // THIS ASSERTION PASSES
            ts = new TestSuite ("dot_cap_dimmer") ;
            ts.add (new TestCase ("construction", (TestFixtureFunc)
setup, (TestFixtureFunc) test_construction, (TestFixtureFunc)
teardown)) ;
            TestSuite.get_root ().add_suite (ts) ;
        }

        void setup(void * fixture) {
            assert (this is Object);  // THIS ASSERTION FAILS
            this.cut = new DotCapDimmer () ;
            this.cut.on_change.connect (slot) ;
            this.called = false ;
        }
        ...
     }

Would anyone know what happens to the `this` variable when called
from the TestCase ? How came it is no longer an Object anymore ?

-- 
Skype: felipeanl


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]