/* * 模块名称:主机侧单测桩 - dbg_log.h(net_cfg 模块专用) * 模块功能:把 MCU 版 DBG_* 宏替换为**计数**,让"该留痕的有没有留痕"变成可断言 * 的行为;同时不往 stdout 打日志——汇总行是 harness 的判据,必须干净。 * * ⚠ 仅供 test/host/net_cfg/ 使用,不参与 MCU 构建。 * * 为什么是计数而不是 printf 直通:net_cfg.c 的三条日志恰好对应三条契约 * (load OK / load FAIL / save OK|FAIL),计数能钉住"哪条该响、哪条不该响" * ——例如"写盘失败必须留痕、但不得触发应用"这类只能靠计数判的分支。 * 计数器定义在 net_cfg_test.c,每组用例前清零。 * * 创建日期:2026-10-23 */ #ifndef DBG_LOG_H #define DBG_LOG_H extern int g_netcfg_info_count; extern int g_netcfg_error_count; extern int g_netcfg_debug_count; #define DBG_INFO(fmt, ...) do { (void)(fmt); g_netcfg_info_count++; } while (0) #define DBG_DEBUG(fmt, ...) do { (void)(fmt); g_netcfg_debug_count++; } while (0) #define DBG_ERROR(fmt, ...) do { (void)(fmt); g_netcfg_error_count++; } while (0) #endif /* DBG_LOG_H */