File tree Expand file tree Collapse file tree
tests/rust/wasm32-wasip3/src/bin Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -62,9 +62,9 @@ fn test_ephemeral_port_assignment(family: IpAddressFamily) {
6262 assert_ne ! ( addr. port( ) , bound. port( ) ) ;
6363}
6464
65- fn test_dual_stack_support ( ) {
65+ fn test_reject_dual_stack ( ) {
6666 let sock = UdpSocket :: create ( IpAddressFamily :: Ipv6 ) . unwrap ( ) ;
67- let addr = IpSocketAddress :: ipv6_mapped_localhost ( 0 ) ;
67+ let addr = IpSocketAddress :: ipv4_mapped_ipv6_localhost ( 0 ) ;
6868 let result = sock. bind ( addr) ;
6969
7070 assert ! ( matches!( result, Err ( ErrorCode :: InvalidArgument ) ) ) ;
@@ -88,7 +88,7 @@ impl Guest for Component {
8888 test_not_bindable ( IpAddressFamily :: Ipv6 ) ;
8989 test_ephemeral_port_assignment ( IpAddressFamily :: Ipv4 ) ;
9090 test_ephemeral_port_assignment ( IpAddressFamily :: Ipv6 ) ;
91- test_dual_stack_support ( ) ;
91+ test_reject_dual_stack ( ) ;
9292 test_unspecified_addr ( IpAddressFamily :: Ipv4 ) ;
9393 test_unspecified_addr ( IpAddressFamily :: Ipv6 ) ;
9494
Original file line number Diff line number Diff line change @@ -21,9 +21,9 @@ fn test_invalid_address_family(family: IpAddressFamily) {
2121 assert ! ( matches!( result, Err ( ErrorCode :: InvalidArgument ) ) ) ;
2222}
2323
24- fn test_dual_stack_support ( ) {
24+ fn test_reject_dual_stack ( ) {
2525 let sock = UdpSocket :: create ( IpAddressFamily :: Ipv6 ) . unwrap ( ) ;
26- let addr = IpSocketAddress :: ipv6_mapped_localhost ( PORT ) ;
26+ let addr = IpSocketAddress :: ipv4_mapped_ipv6_localhost ( PORT ) ;
2727 let result = sock. connect ( addr) ;
2828
2929 assert ! ( matches!( result, Err ( ErrorCode :: InvalidArgument ) ) ) ;
@@ -111,7 +111,7 @@ impl Guest for Component {
111111 test_invalid_address_family ( IpAddressFamily :: Ipv4 ) ;
112112 test_invalid_address_family ( IpAddressFamily :: Ipv6 ) ;
113113
114- test_dual_stack_support ( ) ;
114+ test_reject_dual_stack ( ) ;
115115
116116 test_unspecified_remote_addr ( IpAddressFamily :: Ipv4 ) ;
117117 test_unspecified_remote_addr ( IpAddressFamily :: Ipv6 ) ;
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ async fn test_connected_with_addr(family: IpAddressFamily) {
5252 Err ( ErrorCode :: InvalidArgument )
5353 ) ;
5454
55- assert ! ( sock. send( vec![ 0 ; 1 ] , Some ( remote_addr) ) . await . is_ok ( ) ) ;
55+ sock. send ( vec ! [ 0 ; 1 ] , Some ( remote_addr) ) . await . unwrap ( ) ;
5656}
5757
5858async fn test_not_connected_empty_addr ( family : IpAddressFamily ) {
@@ -70,7 +70,7 @@ async fn test_unspecified_remote_addr(family: IpAddressFamily) {
7070 // FIXME: According to the spec this should return
7171 // `invalid-argument`: The IP address in `remote-address` is
7272 // set to INADDR_ANY (`0.0.0.0` / `::`).
73- assert ! ( matches!( result, Err ( ErrorCode :: RemoteUnreachable ) ) ) ;
73+ assert ! ( matches!( result, Err ( ErrorCode :: InvalidArgument ) ) ) ;
7474}
7575
7676async fn test_remote_addr_with_port_0 ( family : IpAddressFamily ) {
You can’t perform that action at this time.
0 commit comments