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:
@@ -840,9 +840,6 @@ test "DiscoveryManager: pruneStalePeers removes old peers" {
|
||||
|
||||
// Call prune (even with no peers)
|
||||
_ = manager.pruneStalePeers();
|
||||
|
||||
// Should not crash
|
||||
try testing.expect(true);
|
||||
}
|
||||
|
||||
test "DiscoveryManager: getDiscoveredPeers returns copy" {
|
||||
@@ -869,9 +866,6 @@ test "DiscoveryManager: cleanup respects max_peers" {
|
||||
try manager.start();
|
||||
|
||||
manager.cleanup();
|
||||
|
||||
// Should not crash
|
||||
try testing.expect(true);
|
||||
}
|
||||
|
||||
test "DiscoveryManager: maintain sends discovery request" {
|
||||
@@ -919,9 +913,6 @@ test "DiscoveryManager: sendGoodbye notifies peers" {
|
||||
|
||||
const local_peer_id = PeerId{ .bytes = [_]u8{0x55} ** 32 };
|
||||
try manager.sendGoodbye(local_peer_id, .shutdown);
|
||||
|
||||
// Even with no discovered peers, shouldn't crash
|
||||
try testing.expect(true);
|
||||
}
|
||||
|
||||
test "DiscoveryManager: broadcastKeepAlive to all peers" {
|
||||
@@ -934,9 +925,6 @@ test "DiscoveryManager: broadcastKeepAlive to all peers" {
|
||||
|
||||
const local_peer_id = PeerId{ .bytes = [_]u8{0x66} ** 32 };
|
||||
try manager.broadcastKeepAlive(local_peer_id);
|
||||
|
||||
// With no discovered peers, no packets sent but shouldn't crash
|
||||
try testing.expect(true);
|
||||
}
|
||||
|
||||
test "DiscoveryManager: multiple messages in sequence" {
|
||||
@@ -1043,8 +1031,6 @@ test "DiscoveryManager: handle truncated message gracefully" {
|
||||
|
||||
// Should handle gracefully without crashing
|
||||
_ = manager.listen(100) catch false;
|
||||
|
||||
try testing.expect(true);
|
||||
}
|
||||
|
||||
test "DiscoveryManager: handle invalid message type" {
|
||||
@@ -1065,6 +1051,4 @@ test "DiscoveryManager: handle invalid message type" {
|
||||
|
||||
// Should handle gracefully
|
||||
_ = manager.listen(100) catch false;
|
||||
|
||||
try testing.expect(true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user