/* * 主机侧单测桩:dbg_log.h * 模块功能:为 App/sync/time_sync.c 提供主机可编译的日志宏(映射到计数)。 * * ⚠ 仅供 test/host/time_sync/ 使用,不参与 MCU 构建。 * * 注意:time_sync.c 在 `#include "dbg_log.h"` 之前自行 `#define` 了 * DBG_LINE_BUF_MAX 与 DBG_TAG(真实头会用到它们),故本桩**不得**再定义这两个宏, * 否则触发 C4005 宏重定义告警(/W4)。 * * DBG_ERROR / DBG_INFO 计入计数器,供单测断言: * - "net_socket/bind/listen FAIL"、"open listener FAIL, retry later" → ERROR * - "no TIME packet in 30s, drop conn"、"wall clock updated"、"network re-init" → INFO * * 创建日期:2026-10-10 */ #ifndef DBG_LOG_H #define DBG_LOG_H #include /* 计数(在 time_sync_test.c 实现) */ extern int g_tstest_err_count; extern int g_tstest_info_count; #define DBG_INFO(fmt, ...) do { g_tstest_info_count++; } while (0) #define DBG_DEBUG(fmt, ...) do { } while (0) #define DBG_ERROR(fmt, ...) do { g_tstest_err_count++; } while (0) #endif /* DBG_LOG_H */