g_return

Neil Williams linux at codehelp.co.uk
Thu Aug 12 18:58:16 EDT 2004


On Thursday 12 August 2004 12:03, Neil Williams wrote:
> On Wednesday 11 August 2004 10:33, Derek Atkins wrote:
> > Neil Williams <linux at codehelp.co.uk> writes:
> > > I even tried g_return_if_fail(1 == 2);
> >
> > This should definitely trigger...

This is what I needed to solve the problem:
in my .c file (not the .h)

#ifdef G_LOG_DOMAIN
#undef G_LOG_DOMAIN
#define G_LOG_DOMAIN "qof-book-merge"
#endif

When, in a separate test program that links qof_book_merge, I deliberately 
pass a NULL instead of one of the QofBook pointers, like this:

result = qof_book_mergeInit(NULL, mainbook);

I now get:

qof-book-merge-CRITICAL **: file ../qof_book_merge.c: line 49 
(qof_book_mergeInit): assertion `(importBook != NULL)&&(targetBook != NULL)' 
failed.

The program aborts cleanly.

As this is a conditional define and it's only in the qof-book-merge code, 
would this be a problem to keep in the .c file?

-- 

Neil Williams
=============
http://www.codehelp.co.uk/
http://www.dclug.org.uk/
http://www.isbn.org.uk/
http://sourceforge.net/projects/isbnsearch/

http://www.biglumber.com/x/web?qs=0x8801094A28BCB3E3
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: signature
Url : http://lists.gnucash.org/pipermail/gnucash-devel/attachments/20040812/96a5e07e/attachment.bin


More information about the gnucash-devel mailing list