重构代码的架构设计,增加测试单元,提高代码可靠性

This commit is contained in:
2026-03-23 20:40:04 +08:00
parent c2ce221691
commit a4bf0962b2
31 changed files with 2084 additions and 703 deletions

16
tests/test_p1_key.c Normal file
View File

@@ -0,0 +1,16 @@
#include "../src/Drv/key.h"
#include "test_common.h"
int main(void)
{
Key_Init();
ASSERT_EQ_INT(EN_KEY_FLAG_NULL, g_tRemoteKey.byKeyValid);
ASSERT_EQ_INT(KEY_NONE, g_tRemoteKey.byKeyValue);
g_tRemoteKey.byKeyValid = EN_KEY_FLAG_NEW;
g_tRemoteKey.byKeyValue = KEY_U;
ASSERT_EQ_INT(KEY_U, Key_Read());
ASSERT_EQ_INT(EN_KEY_FLAG_NULL, g_tRemoteKey.byKeyValid);
ASSERT_EQ_INT(KEY_NONE, Key_Read());
return 0;
}