@@ -375,9 +375,11 @@ static void test_tx_ack_and_scheduler(void)
375375 make_scattered (NULL , 0 ),
376376 record_feedback ,
377377 make_user_context (& fstate )));
378+ TEST_ASSERT_EQUAL_UINT32 (1U << 0U , udpard_tx_pending_iface_mask (& tx1 ));
378379 udpard_rx_t rx = { .tx = & tx1 };
379380 tx_receive_ack (& rx , 21 , 42 );
380381 TEST_ASSERT_EQUAL_size_t (1 , fstate .count );
382+ TEST_ASSERT_EQUAL_UINT32 (0U , udpard_tx_pending_iface_mask (& tx1 ));
381383 udpard_tx_free (& tx1 );
382384
383385 // Ack suppressed when coverage not improved.
@@ -397,6 +399,7 @@ static void test_tx_ack_and_scheduler(void)
397399 rx .tx = & tx2 ;
398400 tx_send_ack (& rx , 0 , udpard_prio_fast , 7 , 8 , (udpard_remote_t ){ .uid = 9 , .endpoints = { make_ep (3 ) } });
399401 TEST_ASSERT_EQUAL_UINT64 (0 , rx .errors_ack_tx );
402+ TEST_ASSERT_EQUAL_UINT32 (0U , udpard_tx_pending_iface_mask (& tx2 ));
400403 udpard_tx_free (& tx2 );
401404
402405 // Ack replaced with broader coverage.
@@ -406,6 +409,7 @@ static void test_tx_ack_and_scheduler(void)
406409 tx_send_ack (& rx , 0 , udpard_prio_fast , 9 , 9 , (udpard_remote_t ){ .uid = 11 , .endpoints = { make_ep (4 ) } });
407410 tx_send_ack (
408411 & rx , 0 , udpard_prio_fast , 9 , 9 , (udpard_remote_t ){ .uid = 11 , .endpoints = { make_ep (4 ), make_ep (5 ) } });
412+ TEST_ASSERT_NOT_EQUAL (0U , udpard_tx_pending_iface_mask (& tx3 ));
409413 udpard_tx_free (& tx3 );
410414
411415 // Ack push failure with TX present.
@@ -466,6 +470,7 @@ static void test_tx_ack_and_scheduler(void)
466470 tx5 .ack_baseline_timeout = 1 ;
467471 tx_promote_staged_transfers (& tx5 , 1 );
468472 TEST_ASSERT_NOT_NULL (tx5 .queue [0 ][staged .priority ].head );
473+ TEST_ASSERT_EQUAL_UINT32 (1U << 0U , udpard_tx_pending_iface_mask (& tx5 ));
469474
470475 // Ejection stops when NIC refuses.
471476 staged .cursor [0 ] = staged .head [0 ];
@@ -535,7 +540,7 @@ static void test_tx_stage_if_via_tx_push(void)
535540 TEST_ASSERT_TRUE (udpard_tx_new (& tx , 30U , 1U , 4U , mem , & vt ));
536541 tx .user = & log ;
537542 tx .ack_baseline_timeout = 10 ;
538- udpard_udpip_ep_t dest [UDPARD_IFACE_COUNT_MAX ] = { make_ep (1 ), { 0 } };
543+ udpard_udpip_ep_t dest [UDPARD_IFACE_COUNT_MAX ] = { make_ep (1 ), make_ep ( 2 ), { 0 } };
539544
540545 TEST_ASSERT_GREATER_THAN_UINT32 (0 ,
541546 udpard_tx_push (& tx ,
@@ -548,14 +553,18 @@ static void test_tx_stage_if_via_tx_push(void)
548553 make_scattered (NULL , 0 ),
549554 record_feedback ,
550555 make_user_context (& fb )));
556+ TEST_ASSERT_EQUAL_UINT32 ((1U << 0U ) | (1U << 1U ), udpard_tx_pending_iface_mask (& tx ));
551557
552558 udpard_tx_poll (& tx , 0 , UDPARD_IFACE_MASK_ALL );
553559 udpard_tx_poll (& tx , 160 , UDPARD_IFACE_MASK_ALL );
554560 udpard_tx_poll (& tx , 400 , UDPARD_IFACE_MASK_ALL );
561+ TEST_ASSERT_EQUAL_UINT32 (0U , udpard_tx_pending_iface_mask (& tx ));
555562
556- TEST_ASSERT_EQUAL_size_t (2 , log .count );
563+ TEST_ASSERT_EQUAL_size_t (4 , log .count );
557564 TEST_ASSERT_EQUAL (0 , log .when [0 ]);
558- TEST_ASSERT_EQUAL (160 , log .when [1 ]);
565+ TEST_ASSERT_EQUAL (0 , log .when [1 ]);
566+ TEST_ASSERT_EQUAL (160 , log .when [2 ]);
567+ TEST_ASSERT_EQUAL (160 , log .when [3 ]);
559568 TEST_ASSERT_NULL (tx .index_staged );
560569 udpard_tx_free (& tx );
561570 instrumented_allocator_reset (& alloc );
0 commit comments