Skip to content

Commit

Permalink
udp: make basic test work even if Ipv6 support is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
stormshield-damiend committed Jan 2, 2024
1 parent 088a09a commit 0e7c39b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions quinn-udp/tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@ use socket2::Socket;

#[test]
fn basic() {
let send = UdpSocket::bind("[::1]:0").unwrap();
let recv = UdpSocket::bind("[::1]:0").unwrap();
let send = UdpSocket::bind("[::1]:0")
.or_else(|_| UdpSocket::bind("127.0.0.1:0"))
.unwrap();
let recv = UdpSocket::bind("[::1]:0")
.or_else(|_| UdpSocket::bind("127.0.0.1:0"))
.unwrap();
let dst_addr = recv.local_addr().unwrap();
test_send_recv(
&send.into(),
Expand Down

0 comments on commit 0e7c39b

Please sign in to comment.