Re: [Vala] GLib.assert_no_error not working?
- From: Al Thomas <astavale yahoo co uk>
- To: Vala <vala-list gnome org>, Michael Gratton <mike vee net>
- Subject: Re: [Vala] GLib.assert_no_error not working?
- Date: Thu, 8 Mar 2018 10:26:00 +0000 (UTC)
> On Thursday, 8 March 2018, 00:14:12 GMT, Michael Gratton <mike vee net> wrote:
GLib.assert_no_error doesn't seem to do anything that its API docs
advertises for me - doesn't asset, doesn't pretty print the error
message.
See the attached minimal test case, per the comments I'd expect it to
abort on line 9, but it actually aborts on line 11. This is what I get:
Am I missing something here?
The assertion is in a catch block so err will be set. Whereas assert_no_erroris used to check err is unset
(i.e. null). The line about 'produce a message that includesthe error message and code' seems like a
copy/paste error in the documentation.
What you might want is assert_error, but the C docs for that advise 'If you want totest that err is set, but
don't care what it's set to, just useg_assert (err != NULL)'
Regards,
Al
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]