Approach for adding more coverage in qofinstance.c
John Ralls
jralls at ceridwen.us
Thu Jan 22 19:44:06 EST 2026
> On Jan 22, 2026, at 5:44 AM, Stefan Koch <stefan.koch.micro at gmail.com> wrote:
>
> I think the g_test_init is necessary mainly for the g_test_log_set_fatal_handler and/or the g_log_set_handler. So, I think I will need it even after I replace the glib random numbers.
>
Stefan,
No, they’re both implemented in glib/gmessages.c with no reference to the test system. In fact you might not need to set the fatal handler if you don’t call g_test_init: The first thing it does is set the fatal mask to CRITICAL, ERROR, an WARNING. Normally only CRITICAL is fatal.
For an example that uses g_log_set_handler without g_test_init see https://github.com/Gnucash/gnucash/blob/stable/libgnucash/backend/xml/test/gtest-load-save-files.cpp
Regards,
John Ralls
More information about the gnucash-devel
mailing list