(I'm replying to the wrong message because I don't have the right one.) | From: Paul Wouters <[email protected]> | | On Tue, 18 Jun 2019, Andrew Cagney wrote: | | > why is a library function calling printf()? (if a c file needs | > something #include it). | | Because it is used in addconn which has no logging mechanism and only | uses stdout?
That should get fixed. There's a general rule that I've inferred: lib/* stuff should NOT use printf. There's no reason to believe that stdout and stding go anwhere at all. Saying that it should be fixed is easier than fixing it. In some parts of the library, error reports are returned to the caller, making the caller resposible for appropriate disposition of the report. That's the easiest solution but not always optimal. If a library routine needs to do more intricate logging, lswlog.h stuff should be used. And things that call the library should make sure that lswlog.h functions will work. | There are also many calls to fprintf() within the test compile | sections | when some files are compiled with "main()" enabled. Since I dont think | we ever used this in libreswan for any testing, I'd prefer to remove | all of those. Henry carefully built unit tests. Unit tests are a Good Thing. We should have and use more unit tests rather than fewer. I'm regret not writing unit tests for Pluto. We don't even have a framework in which to do it. It's always to late too add this. Wholesale deleting of unit tests seems like a barbaric act. It may be the case that if we started running these unit tests again, they would fail. That just means we have to fix the functions or fix the tests. Do not delete a test unlesss we delete the function being tested. If we have to fix the tests, we should check whether we have to fix the corresponding man pages. They too may have suffered bit-rot. _______________________________________________ Swan-dev mailing list [email protected] https://lists.libreswan.org/mailman/listinfo/swan-dev
