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/
pgpYYlry2fG8N.pgp
Description: PGP signature
_______________________________________________ gnucash-devel mailing list [email protected] https://lists.gnucash.org/mailman/listinfo/gnucash-devel
