Commits

Anonymous committed c7d0e07

Added a test for the [Cf_gadget] scheduler to detect stack leaks. Expect
the IPv6 socket address tuple to contain a scope identifier.

Comments (0)

Files changed (1)

     let test () =
         try
             let bind =
-                (Cf_ip6_addr.loopback :> Cf_ip6_addr.opaque Cf_ip6_addr.t), 0
+                (Cf_ip6_addr.loopback :> Cf_ip6_addr.opaque Cf_ip6_addr.t),
+                0, 0l
             in
             let listen = new Cf_tcp6_socket.listener bind in
             listen#listen 1;
             a#setsockopt Cf_ip_common.tcp_nodelay true;
             b#setsockopt Cf_ip_common.tcp_nodelay true;
             let laddr = a#getpeername and raddr = b#getsockname in
-            let lhost, lport = laddr in
-            let rhost, rport = raddr in
+            let lhost, lport, lscope = laddr in
+            let rhost, rport, rscope = raddr in
             if lhost <> rhost then
                 failwith "T12 error: host a#getpeername <> b#getsockname";
             if lport <> rport then
                 failwith "T12 error: port a#getpeername <> b#getsockname";
+            if lscope <> rscope then
+                failwith "T12 error: port a#getpeername <> b#getsockname";
             let laddr = a#getsockname and raddr = b#getpeername in
-            let lhost, lport = laddr in
-            let rhost, rport = raddr in
+            let lhost, lport, lscope = laddr in
+            let rhost, rport, rscope = raddr in
             if lhost <> rhost then
                 failwith "T12 error: host a#getsockname <> b#getpeername";
             if lport <> rport then
                 failwith "T12 error: port a#getsockname <> b#getpeername";
+            if lscope <> rscope then
+                failwith "T12 error: port a#getsockname <> b#getpeername";
             let tx = String.make len 'x' and rx = String.create len in
             let n = a#send tx 0 len in
             if n <> len then failwith "T12 error: tx incomplete!";