[Vala] Using TestCase class: assert (this is Object) fails in method, but not in constructor
- From: Felipe Lavratti <felipelav gmail com>
- To: Vala List <vala-list gnome org>
- Subject: [Vala] Using TestCase class: assert (this is Object) fails in method, but not in constructor
- Date: Thu, 4 Feb 2016 18:18:59 -0200
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]