<html aria-label="message body"><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">Yeah, that was a poor design on my part. Better to have two cases, the trivial one with 0 and another with some other number > 2. And it can lose the utterly pointless tests that list insertions increase the list length.<div><br></div><div>Regards,</div><div>John Ralls<br id="lineBreakAtBeginningOfMessage"><div><br><blockquote type="cite"><div>On Jan 22, 2026, at 05:44, Stefan Koch <stefan.koch.micro@gmail.com> wrote:</div><br class="Apple-interchange-newline"><div><div dir="ltr"><div dir="ltr"><div>Thank you. </div><div><br></div><div>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. </div><div><br></div><div>I personally don't like random numbers inside a test anyway. Does it make sense to use a fixed number in the range instead? </div><div><br></div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Thu, Jan 22, 2026 at 12:15 AM John Ralls <<a href="mailto:jralls@ceridwen.us">jralls@ceridwen.us</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>Stefan,<div><br></div><div>You write that you had to use TEST_F as if it was a bad thing. Using fixtures is a *good* thing. </div><div>I think that the message handling is separate from g_test and doesn’t require g_test_init, but your custom main() also inits QOF and the logging system so I guess you’re stuck with it.</div><div><br></div><div>I made some comments on your commit. </div><div><br></div><div>Regards,</div><div>John Ralls</div><div><br id="m_-1105854297493184440lineBreakAtBeginningOfMessage"><div><br><blockquote type="cite"><div>On Jan 21, 2026, at 11:53, Stefan Koch <<a href="mailto:stefan.koch.micro@gmail.com" target="_blank">stefan.koch.micro@gmail.com</a>> wrote:</div><br><div><div dir="ltr">(Thank you for merging my first commit test-qofid.cpp).<br><br>I am moving on to adding more coverage, in particular I thought in the qofinstance would be a good low level next step.<br><br>This is currently in part of the glib based test for test-oqf. I am proposing removing it from there and making it a stand alone google test. I like the stand alone test because it allows me just to run this one and see the coverage of just this test. (That removes other tests from providing accidental coverage.)<br><br>I also like full coverage since it is easy to check for 100% coverage, but hard to check if the coverage moved from 88% to 85% when running tests. I cannot get 100% coverage since there are some lines that are unreachable when the other subsystems are correct. I thought I saw some setup in lcov that allows marking of lines to not be covered, but I have not investigated that further.<br><br>There were some issues that I had to work out:<br>1. I had to use the google TEST_F so that I could have a class to replace the setup and teardown from glib testing.<br>2. I had to create a main() that overrides the default google one, that allows the setting g_test_init which is still needed since the qofinstance still makes use of the glib error handling.<br>3. I replaced the g_assert functions with the equivalent google test calls.<br>4. I replaced the g_test_message with a local call that does printf.<br><br>The I have not added extra coverage. I wanted to verify that this approach is what is desired here, or if this is too to change, and not worth your time reviewing.<br><br>The commit can be seen here: <a href="https://github.com/stefan-koch-micro/gnucash/commit/fc5742e12d8007f86929450080750a14bec3ec43#diff-dcd2eece63e17b3ec55c96a3eab8a60c4582884a2d01b47b1c4940c1c0594bf0" target="_blank">https://github.com/stefan-koch-micro/gnucash/commit/fc5742e12d8007f86929450080750a14bec3ec43#diff-dcd2eece63e17b3ec55c96a3eab8a60c4582884a2d01b47b1c4940c1c0594bf0</a><br>I have not made a pull request as this is a partial implementation. If the approach is OK, I will add more/full coverage and then make a merge request. (Or even do more of the test-qof set before making the request.)<br></div>
_______________________________________________<br>gnucash-devel mailing list<br><a href="mailto:gnucash-devel@gnucash.org" target="_blank">gnucash-devel@gnucash.org</a><br><a href="https://lists.gnucash.org/mailman/listinfo/gnucash-devel" target="_blank">https://lists.gnucash.org/mailman/listinfo/gnucash-devel</a><br></div></blockquote></div><br></div></div></blockquote></div></div>
</div></blockquote></div><br></div></body></html>