test-book-merge fails in current HEAD

Neil Williams linux at codehelp.co.uk
Sun Dec 5 07:07:23 EST 2004


On Sunday 05 December 2004 1:26 am, Derek Atkins wrote:
> Neil,
>
> I was playing with HEAD today trying to get the tests working.
> test-book-merge is failing with the following:
>
> FAILURE loop:#5 empty target entity test-book-merge.c:413
> FAIL: test-book-merge

Fixed. I fixed a separate bug in qof_book_merge and didn't patch the test 
case, sorry. I've added a note to explain:

 /* In this test rule_loop, any lines beginning with do_test() can be removed
 from a working rule_loop routine. It would be wise to still use some of the
 more obvious checks, e.g. that an entity or rule exists before querying the 
 parameters.
 
 Take particular care with MERGE_NEW - targetEnt is always NULL until the
 Commit.
 Do not attempt to use param_getfcn on targetEnt in the loop called by 
 qof_book_mergeRuleForeach(rule_loop, MERGE_NEW);

This is because the target book cannot be altered until the Commit, so because 
this entity is new, it doesn't have a target in the book yet - the target 
entity in the rule is null. At Commit, a new entity is created using the 
QofObject create: call which initialises it to the defaults. qof_book_merge 
then updates the new entity with the import data.

I can't do a lot more, it's down to the developer of the calling process to 
not call param_getfcn on a NULL entity.

> Can you please look into this as a high priority?

Patch sent.

> Thanks,
>
> -derek

-- 

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: not available
Url : http://lists.gnucash.org/pipermail/gnucash-devel/attachments/20041205/abf55dbc/attachment.bin


More information about the gnucash-devel mailing list