No unit tests for the logging module (log.c/log.h) #62
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
The
src/shared/log.candsrc/shared/log.hlogging module has no dedicated unit tests. While logging is a straightforward module, there are behaviors worth testing:set_log_level()filtering works correctly (messages below threshold are suppressed)log_message()with various log levelsLocation
src/shared/log.c,src/shared/log.hSuggested Fix
Add a simple test that:
A simple approach is to capture stderr output using
freopen()or pipe redirection, or to add a test-only function that checks the current log level.Severity
Low
Category
Quality