Re: [Vala] Various tests with the new contract support, but also with non-GLib.Object classes



On Thu, 2008-04-24 at 01:22 +0200, Philip Van Hoof wrote:
I was just testing various things in vala, and noticed this:

pvanhoof schtrumpf:~$ ./test 
** Message: test.vala:31: 100
** Message: test.vala:21: 99
pvanhoof schtrumpf:~$ 

I attached the test.vala file, since in class Test x will be initialized
to 100, and foo returns bar + x, those values are not right afaik.

ps. I peeked at the .c file, and self->x is never set to 100.

This is a bug, however, it only happens if you use non-GObject classes.
It should work fine with `public class Test : Object'. We also want to
support field initializers for non-GObject classes, though.

Also note that the ensures is never checked in the generated .c file

Right, runtime checks for postconditions are only inserted for virtual
and abstract methods in classes and interfaces, at the moment.
Preconditions should already work for all method types.

Feel free to open bug reports about these two issues.

Jürg




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