]> git.lizzy.rs Git - rust.git/commitdiff
auto merge of #10394 : yichoi/rust/make_check_pass_android, r=brson
authorbors <bors@rust-lang.org>
Mon, 11 Nov 2013 14:21:16 +0000 (06:21 -0800)
committerbors <bors@rust-lang.org>
Mon, 11 Nov 2013 14:21:16 +0000 (06:21 -0800)
To enable test on android bot #9120

some tests are disabled and can be fixed further.

1  2 
src/librustuv/addrinfo.rs
src/libstd/run.rs
src/libstd/unstable/dynamic_lib.rs
src/test/run-pass/rtio-processes.rs

index 601cc9f84add0ef3307ea73ad51abe6157c43e3c,7b78d5f032bece7bbdb739b8f3d83628ddfaa2a2..2808915907b2717d41f82cbf37cabda0e2c93e7d
@@@ -184,27 -235,40 +184,28 @@@ pub fn accum_addrinfo(addr: &Addrinfo) 
      }
  }
  
 -impl NativeHandle<*uvll::uv_getaddrinfo_t> for GetAddrInfoRequest {
 -    fn from_native_handle(handle: *uvll::uv_getaddrinfo_t) -> GetAddrInfoRequest {
 -        GetAddrInfoRequest(handle)
 -    }
 -    fn native_handle(&self) -> *uvll::uv_getaddrinfo_t {
 -        match self { &GetAddrInfoRequest(ptr) => ptr }
 -    }
 -}
 -
  #[cfg(test)]
  mod test {
 -    use Loop;
      use std::rt::io::net::ip::{SocketAddr, Ipv4Addr};
      use super::*;
 +    use super::super::local_loop;
  
      #[test]
+     #[ignore(cfg(target_os="android"))] // cannot give tcp/ip permission without help of apk
      fn getaddrinfo_test() {
 -        let mut loop_ = Loop::new();
 -        let mut req = GetAddrInfoRequest::new();
 -        do req.getaddrinfo(&loop_, Some("localhost"), None, None) |_, addrinfo, _| {
 -            let sockaddrs = accum_addrinfo(addrinfo);
 -            let mut found_local = false;
 -            let local_addr = &SocketAddr {
 -                ip: Ipv4Addr(127, 0, 0, 1),
 -                port: 0
 -            };
 -            for addr in sockaddrs.iter() {
 -                found_local = found_local || addr.address == *local_addr;
 +        match GetAddrInfoRequest::run(local_loop(), Some("localhost"), None, None) {
 +            Ok(infos) => {
 +                let mut found_local = false;
 +                let local_addr = &SocketAddr {
 +                    ip: Ipv4Addr(127, 0, 0, 1),
 +                    port: 0
 +                };
 +                for addr in infos.iter() {
 +                    found_local = found_local || addr.address == *local_addr;
 +                }
 +                assert!(found_local);
              }
 -            assert!(found_local);
 +            Err(e) => fail!("{:?}", e),
          }
 -        loop_.run();
 -        loop_.close();
 -        req.delete();
      }
  }
Simple merge
Simple merge
Simple merge