存储测试通过
This commit is contained in:
@@ -17,6 +17,9 @@
|
||||
#include "net_socket.h"
|
||||
#include "ch395f_test.h"
|
||||
#include "ch395f.h"
|
||||
#include "test_config.h"
|
||||
#include "storage_test.h"
|
||||
#include "gd5f_test.h"
|
||||
|
||||
#define DBG_TAG "[TEST_TASK]"
|
||||
#include "dbg_log.h"
|
||||
@@ -48,7 +51,7 @@ test_stats_t g_test_stats;
|
||||
static void test_parse_ip(const char *str, uint8_t *ip_arr)
|
||||
{
|
||||
uint32_t val;
|
||||
int i;
|
||||
int32_t i;
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
val = 0;
|
||||
@@ -121,7 +124,7 @@ static void phase1_run(void) {
|
||||
ch395f_set_ip_addr(set_ip);
|
||||
memset(ip_info, 0, sizeof(ip_info));
|
||||
ch395f_get_ip_inf(ip_info);
|
||||
int match = (ip_info[0] == 192 && ip_info[1] == 168 &&
|
||||
int32_t match = (ip_info[0] == 192 && ip_info[1] == 168 &&
|
||||
ip_info[2] == 1 && ip_info[3] == 100);
|
||||
DBG_INFO(" [P1-03] ch395f_set_ip_addr(192.168.1.100)");
|
||||
DBG_INFO(" expect: IP[0..3] = 192.168.1.100");
|
||||
@@ -141,7 +144,7 @@ static void phase1_run(void) {
|
||||
ch395f_set_gwip_addr(set_gw);
|
||||
memset(ip_info, 0, sizeof(ip_info));
|
||||
ch395f_get_ip_inf(ip_info);
|
||||
int match = (ip_info[4] == 192 && ip_info[5] == 168 &&
|
||||
int32_t match = (ip_info[4] == 192 && ip_info[5] == 168 &&
|
||||
ip_info[6] == 1 && ip_info[7] == 1);
|
||||
DBG_INFO(" [P1-04] ch395f_set_gwip_addr(192.168.1.1)");
|
||||
DBG_INFO(" expect: GW[0..3] = 192.168.1.1");
|
||||
@@ -161,7 +164,7 @@ static void phase1_run(void) {
|
||||
ch395f_set_mask_addr(set_mask);
|
||||
memset(ip_info, 0, sizeof(ip_info));
|
||||
ch395f_get_ip_inf(ip_info);
|
||||
int match = (ip_info[8] == 255 && ip_info[9] == 255 &&
|
||||
int32_t match = (ip_info[8] == 255 && ip_info[9] == 255 &&
|
||||
ip_info[10] == 255 && ip_info[11] == 0);
|
||||
DBG_INFO(" [P1-05] ch395f_set_mask_addr(255.255.255.0)");
|
||||
DBG_INFO(" expect: MASK[0..3] = 255.255.255.0");
|
||||
@@ -503,8 +506,8 @@ static void phase2_tc202_once(uint8_t sock, uint16_t local_port)
|
||||
uint16_t n;
|
||||
uint16_t rl;
|
||||
uint32_t tick;
|
||||
int k;
|
||||
int match;
|
||||
int32_t k;
|
||||
int32_t match;
|
||||
|
||||
for (k = 0; k < 64; k++) {
|
||||
tx[k] = (uint8_t)k;
|
||||
@@ -596,7 +599,7 @@ static void phase2_tc202(void)
|
||||
{
|
||||
uint8_t sock = 0;
|
||||
uint8_t ip_arr[4];
|
||||
int i;
|
||||
int32_t i;
|
||||
|
||||
test_parse_ip(PHASE2_REMOTE_IP, ip_arr);
|
||||
|
||||
@@ -804,7 +807,7 @@ static void phase2_run(void)
|
||||
static void phase3_run(void) {
|
||||
uint8_t sock = 0;
|
||||
uint8_t rx_buf[300] = {0};
|
||||
int counted;
|
||||
int32_t counted;
|
||||
|
||||
DBG_INFO("=== CH395F Phase 3 Tests (UDP) ===");
|
||||
|
||||
@@ -845,8 +848,8 @@ static void phase3_run(void) {
|
||||
counted = 0;
|
||||
while (counted < PHASE3_TOTAL_ROUNDS) {
|
||||
uint32_t tick = HAL_GetTick();
|
||||
int echo_ok = 0;
|
||||
int is_probe = 0;
|
||||
int32_t echo_ok = 0;
|
||||
int32_t is_probe = 0;
|
||||
while (HAL_GetTick() - tick < 30000) {
|
||||
uint16_t rlen = ch395f_get_recv_len(sock);
|
||||
if (rlen > 8) {
|
||||
@@ -925,7 +928,7 @@ static void phase3_run(void) {
|
||||
|
||||
static void phase4_run(void) {
|
||||
uint8_t ip_info[20] = {0};
|
||||
int same = 0;
|
||||
int32_t same = 0;
|
||||
|
||||
DBG_INFO("=== CH395F Phase 4 Tests (DHCP) ===");
|
||||
|
||||
@@ -1015,7 +1018,7 @@ static void phase4_run(void) {
|
||||
ch395f_set_des_ip(anno_sock, bcast);
|
||||
ch395f_set_des_port(anno_sock, 0);
|
||||
|
||||
int hello_ok = 0;
|
||||
int32_t hello_ok = 0;
|
||||
uint32_t wait = HAL_GetTick();
|
||||
while (HAL_GetTick() - wait < PHASE4_HELLO_WAIT_MS) {
|
||||
ch395f_get_glob_int_status_all();
|
||||
@@ -1112,13 +1115,13 @@ static void phase5_run(void) {
|
||||
static uint8_t exp[PHASE5_CHUNK_SIZE];
|
||||
uint8_t sock = 0;
|
||||
uint8_t ip_arr[4];
|
||||
int chunks;
|
||||
int bad = 0;
|
||||
int conn_ok = 0;
|
||||
int blk_tx = 0;
|
||||
int blk_rx = 0;
|
||||
int can_write = 1;
|
||||
int progress_64k = -1;
|
||||
int32_t chunks;
|
||||
int32_t bad = 0;
|
||||
int32_t conn_ok = 0;
|
||||
int32_t blk_tx = 0;
|
||||
int32_t blk_rx = 0;
|
||||
int32_t can_write = 1;
|
||||
int32_t progress_64k = -1;
|
||||
uint32_t send_bytes;
|
||||
uint32_t sum_tx = 0;
|
||||
uint32_t sum_rx = 0;
|
||||
@@ -1345,8 +1348,9 @@ void StartCh395fTestTask(void *argument)
|
||||
{
|
||||
(void)argument;
|
||||
|
||||
DBG_INFO("Test task started");
|
||||
DBG_INFO("Test task started, suite=%s", TEST_SUITE_NAME);
|
||||
|
||||
#if defined(TEST_SUITE_CH395F)
|
||||
#if defined(ENABLE_HW_LAYER_TESTS)
|
||||
/* 硬件层模式(阶段 1~5):netTask 未创建,由本任务完成一次性协议栈
|
||||
* 初始化并独占 CH395F —— 无 net_poll() 并发读取中断,无 SPI 并发事务 */
|
||||
@@ -1384,8 +1388,13 @@ void StartCh395fTestTask(void *argument)
|
||||
#if defined(ENABLE_PHASE7_TESTS)
|
||||
net_layer_client_test_main();
|
||||
#else
|
||||
net_layer_test_main();
|
||||
net_layer_test_main();
|
||||
#endif
|
||||
#endif /* TEST_SUITE_CH395F */
|
||||
#elif defined(TEST_SUITE_STORAGE)
|
||||
storage_test_run();
|
||||
#elif defined(TEST_SUITE_GD5F)
|
||||
gd5f_test_run();
|
||||
#endif
|
||||
|
||||
for (;;) {
|
||||
|
||||
Reference in New Issue
Block a user