v2-on-ui #4

Merged
wandering1 merged 497 commits from v2-on-ui into master 2026-11-02 04:07:13 +08:00
Showing only changes of commit b3ef7289a0 - Show all commits
+9 -5
View File
@@ -497,7 +497,11 @@ static void tc_open_listener(void) {
CHECK(s_beat_id_bad == 0, "TC-TS-015b 心跳位恒为 TASK_WD_TIMESYNC");
}
/* ===================== TC-TS-020..029:handle_conn ===================== */
/* ===================== TC-TS-020..029:handle_conn =====================
* ⚠ N34 阶段1(2026-10-13)契约变更:handle_conn **不再** net_close
* (单连接模式下 conn==listen,close 会连监听一起毁);会话收尾只返回外层,
* 由 time_sync_task 在 `conn != ls`(模拟器多连接后端)时才关数据 fd。
* 故本组断言一律为 s_close_calls == 0;任务级关闭见 TC-TS-040e。 */
static void tc_handle_conn(void) {
uint8_t pkt[16];
@@ -513,7 +517,7 @@ static void tc_handle_conn(void) {
CHECK(s_set_unix_last == 0x12345678u, "TC-TS-020b epoch 按大端解析");
CHECK((s_recv_calls == 1) && (s_recv_len_log[0] == 16), "TC-TS-020c 首次请求 16 字节");
CHECK(s_recv_to_log[0] == 50U, "TC-TS-020d 单次等待片长 = 50ms");
CHECK((s_close_calls == 1) && (s_close_socks[0] == 7), "TC-TS-020e 处理完关闭连接");
CHECK(s_close_calls == 0, "TC-TS-020e 处理完**不**关闭连接(N34 阶段1:close 交外层 conn!=ls 分支)");
CHECK(g_tstest_info_count == 1, "TC-TS-020f 留痕 wall clock updated");
/* 2) 分段送达:4 + 4 */
@@ -552,7 +556,7 @@ static void tc_handle_conn(void) {
s_recv_seq_n = 1;
time_sync_handle_conn(4);
CHECK(s_set_unix_calls == 0, "TC-TS-023 非 TIME 前缀不更新墙钟");
CHECK(s_close_calls == 1, "TC-TS-023b 仍关闭连接");
CHECK(s_close_calls == 0, "TC-TS-023b 非 TIME 前缀也不关闭连接");
/* 5) 对端关闭(EOF) */
fakes_reset();
@@ -560,7 +564,7 @@ static void tc_handle_conn(void) {
s_recv_seq_n = 1;
time_sync_handle_conn(6);
CHECK((s_set_unix_calls == 0) && (s_recv_calls == 1), "TC-TS-024 对端关闭(EOF)立即退出不解析");
CHECK(s_close_calls == 1, "TC-TS-024b 关闭连接");
CHECK(s_close_calls == 0, "TC-TS-024b EOF 也不关闭连接(net 层 auto_relisten 收口监听)");
/* 6) 真错误 */
fakes_reset();
@@ -586,7 +590,7 @@ static void tc_handle_conn(void) {
time_sync_handle_conn(6);
CHECK(s_recv_calls == 1, "TC-TS-027 预算耗尽后不再读(只读 1 次)");
CHECK(g_tstest_info_count == 1, "TC-TS-027b 留痕 no TIME packet in 30s, drop conn");
CHECK(s_close_calls == 1, "TC-TS-027c 仍关闭连接");
CHECK(s_close_calls == 0, "TC-TS-027c 预算耗尽也不关闭连接");
/* 9) 剩余预算不足一片 */
fakes_reset();