clean up tests. remove placeholder assert-true tests, fix replay
protection and NAT test logic, fix MWP connection test peer ID registration, use atomic port counter for test parallelism
This commit is contained in:
@@ -426,8 +426,12 @@ test "ReplayProtector: same message ID different peers" {
|
||||
// Peer A sends message ID 42
|
||||
try protector.checkMessage(42, current_time, 15000, 1, peer_a);
|
||||
|
||||
// Peer B tries same message ID - should fail (message IDs are global)
|
||||
const result = protector.checkMessage(42, current_time + 1, 15001, 1, peer_b);
|
||||
// Peer B sends same message ID — allowed because replay protection is per-peer.
|
||||
// Each peer chooses IDs independently, so collisions between peers are expected.
|
||||
try protector.checkMessage(42, current_time + 1, 15001, 1, peer_b);
|
||||
|
||||
// But Peer A replaying its own message ID should still be rejected
|
||||
const result = protector.checkMessage(42, current_time + 2, 15002, 2, peer_a);
|
||||
try testing.expectError(ReplayError.DuplicateMessageId, result);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user