2 Commits

Author SHA1 Message Date
xfy911
c78086f2e5 test(log): 补充日志输出过滤与调用稳定性测试
- test_log_calls_no_crash: 直接调用 log_error/warn/info/debug 确认不崩溃
- test_log_level_filter: 用 pipe 重定向 stderr,验证 ERROR 级别下 INFO 被过滤、ERROR 正常输出
- 修复缺失 string.h 头文件警告
2026-06-04 00:23:10 +08:00
xfy911
3c521823b1 feat(tests): 添加 config 和 log 模块单元测试 + http.c 缓冲区溢出防护
- 新增 test_log.c: 8 个测试覆盖日志级别 getter/setter、前缀设置、持久化
- 新增 test_config.c: 11 个测试覆盖 JSON 配置加载、注释支持、错误处理、merge 覆盖逻辑
- http.c: 修复 response header 格式化中的 snprintf 边界条件,防止缓冲区溢出
- Makefile: 添加 test_log、test_config 编译规则,更新 .PHONY 列表
2026-06-04 00:02:18 +08:00