时间终于同步,存储成功
This commit is contained in:
48
test/sd2506_test.h
Normal file
48
test/sd2506_test.h
Normal file
@@ -0,0 +1,48 @@
|
||||
#ifndef SD2506_TEST_H
|
||||
#define SD2506_TEST_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* ============ Phase 使能开关(取消注释即启用,默认全开) ============ */
|
||||
#define ENABLE_RTC_BASIC_TESTS /* Phase 1: 基本读写 / 走时 */
|
||||
#define ENABLE_RTC_WRTC_PROBE_TESTS /* Phase 2: WRTC 解锁时序探测(定位正确时序) */
|
||||
#define ENABLE_RTC_PERSIST_TESTS /* Phase 3: 跨重启持久化 */
|
||||
|
||||
/* ============ 测试统计(与 STORAGE/GD5F 套件一致的独立统计) ============ */
|
||||
typedef struct {
|
||||
uint16_t total;
|
||||
uint16_t passed;
|
||||
uint16_t failed;
|
||||
} sd2506_test_stats_t;
|
||||
|
||||
extern sd2506_test_stats_t g_sd2506_test_stats;
|
||||
|
||||
#define SD2506_TEST_CHECK(cond, fmt, ...) do { \
|
||||
g_sd2506_test_stats.total++; \
|
||||
if (cond) { \
|
||||
g_sd2506_test_stats.passed++; \
|
||||
DBG_INFO("[PASS] " fmt, ##__VA_ARGS__); \
|
||||
} else { \
|
||||
g_sd2506_test_stats.failed++; \
|
||||
DBG_ERROR("[FAIL] " fmt, ##__VA_ARGS__); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define SD2506_TEST_REPORT(name) do { \
|
||||
DBG_INFO("=== %s: %u/%u PASSED (failed=%u) ===", \
|
||||
name, g_sd2506_test_stats.passed, g_sd2506_test_stats.total, \
|
||||
g_sd2506_test_stats.failed); \
|
||||
} while (0)
|
||||
|
||||
/* 测试入口:由 StartCh395fTestTask 经 TEST_SUITE_RTC 调度,顺序执行 Phase 1~3 */
|
||||
void sd2506_test_run(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* SD2506_TEST_H */
|
||||
Reference in New Issue
Block a user