QOF events (was: Re: the changeset)

Neil Williams linux at codehelp.co.uk
Sat Feb 11 10:25:31 EST 2006


On Saturday 11 February 2006 2:39 pm, Derek Atkins wrote:
> I'm not sure what exactly you could test here..  It's not like
> there's a testable behavior.

A test object, two sample handlers, a context and it's OK. I check that the 
correct handler is being called with the correct info, I check that handlers 
are registered and unregistered (although this test will only be thorough 
once the enum is replaced), I explicitly check for the bug that Chris 
reported and with your patch I can show that it is fixed. 

> You're not guaranteed a crash,

With Chris' report, yes, you were guaranteed a crash. With your patch, it's 
fixed. The method is to register two handlers, then in a DELETE event in one 
handler, you unregister the handler that was registered *first* - because new 
handlers are prepended to the list, this is due to be called next. 
Seg. fault. Everytime. Once patched, it works fine. I also test in reverse 
(just to make sure).

> I suppose you could create a testcase where you have two callback
> functions that share some state and then you can error out when a
> callback function is executed when it shouldn't be.

I check that too - using the context.

I've got a few more tests to add and then I'll commit it and you can see what 
I'm testing.

-- 

Neil Williams
=============
http://www.data-freedom.org/
http://www.nosoftwarepatents.com/
http://www.linux.codehelp.co.uk/

-------------- 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/20060211/68d53979/attachment.bin


More information about the gnucash-devel mailing list