Do some more tests on virtual methods handling
commit0279f49d5205063fc5cafaa6f8c4a9eaba1d9966
authorPierre Wieser <pwieser@trychlos.org>
Sat, 22 Jan 2011 16:51:35 +0000 (22 17:51 +0100)
committerPierre Wieser <pwieser@trychlos.org>
Mon, 24 Jan 2011 19:39:03 +0000 (24 20:39 +0100)
treea55e0292fe925aff68dd260a60718fe03366f177
parentbc71ae6da60a9eb2959a292e7d426700cb7a63c2
Do some more tests on virtual methods handling

Rationale: The problem to solve is how to make sure all virtual methods of a class hierarchy
will be actually invoked.

It happends that this depends of whether an intemediate class which would not implement a
virtual method set this virtual to NULL or not in its class initialization.

If the virtual method pointer is set to NULL, then GObject library recognizes that the
method is not implemented, and this actually breaks the 'call parent method' paradigm.

Contrarily, if the virtual method is not set to NULL, then the GObject library automatically
jumps to the next parent which has implemented the method. In other words, using the 'call
parent method' paradigm implies that we never set a not-used method pointer to NULL.
src/test/test-virtuals.c