Skip to content

Commit 097d777

Browse files
tests
1 parent 166ec7a commit 097d777

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

libudpard/udpard.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -606,8 +606,8 @@ typedef struct tx_transfer_t
606606
/// Constant transfer properties supplied by the client.
607607
/// The remote_* fields are identical to the local ones except in the case of P2P transfers, where
608608
/// they contain the values encoded in the P2P header. This is needed to find pending acks (to minimize duplicates),
609-
/// and to report the correct values via the feedback callback.
610-
/// By default, the remote_* fields equal the local ones.
609+
/// and to report the correct values via the feedback callback for P2P transfers.
610+
/// By default, upon construction, the remote_* fields equal the local ones, which is valid for ordinary messages.
611611
uint64_t topic_hash;
612612
uint64_t transfer_id;
613613
uint64_t remote_topic_hash;

libudpard/udpard.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,8 @@ typedef struct udpard_tx_mem_resources_t
329329
} udpard_tx_mem_resources_t;
330330

331331
/// Outcome notification for a reliable transfer previously scheduled for transmission.
332-
/// For P2P transfers, the topic hash and the transfer-ID values specify which message this is a response to.
332+
/// For P2P transfers, the topic hash and the transfer-ID are taken from the request header this response targets,
333+
/// not from the locally assigned response metadata.
333334
typedef struct udpard_tx_feedback_t
334335
{
335336
uint64_t topic_hash;

tests/src/test_e2e_responses.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,8 @@ void test_topic_with_p2p_response()
427427
udpard_tx_poll(&b_tx, now, UDPARD_IFACE_MASK_ALL);
428428
TEST_ASSERT_EQUAL_size_t(1, b_response_fb.count);
429429
TEST_ASSERT_TRUE(b_response_fb.success);
430+
TEST_ASSERT_EQUAL_UINT64(topic_hash, b_response_fb.topic_hash);
431+
TEST_ASSERT_EQUAL_UINT64(transfer_id, b_response_fb.transfer_id);
430432

431433
// ================================================================================================================
432434
// CLEANUP
@@ -727,6 +729,8 @@ void test_topic_with_p2p_response_under_loss()
727729

728730
TEST_ASSERT_EQUAL_size_t(1, b_response_fb.count);
729731
TEST_ASSERT_TRUE(b_response_fb.success);
732+
TEST_ASSERT_EQUAL_UINT64(topic_hash, b_response_fb.topic_hash);
733+
TEST_ASSERT_EQUAL_UINT64(transfer_id, b_response_fb.transfer_id);
730734

731735
TEST_ASSERT_GREATER_OR_EQUAL_size_t(1, b_topic_ctx.message_count);
732736
TEST_ASSERT_EQUAL_size_t(1, a_response_ctx.response_count);

0 commit comments

Comments
 (0)