Updated as per review comments

This commit is contained in:
Gurwinder Singh
2019-08-16 08:45:08 +05:30
committed by Sean McArthur
parent 0a4bd393ec
commit ad7ffa795f
10 changed files with 42 additions and 124 deletions

View File

@@ -9,7 +9,7 @@ edition = "2018"
h2 = { path = "../.." }
env_logger = { version = "0.5.3", default-features = false }
futures-preview = "0.3.0-alpha.18"
futures-preview = "0.3.0-alpha.17"
honggfuzz = "0.5"
http = "0.1.3"
tokio = { git = "https://github.com/tokio-rs/tokio" }
tokio = "0.2.0-alpha.1"

View File

@@ -9,7 +9,7 @@ h2 = { path = "../..", features = ["unstable"] }
bytes = "0.4.7"
env_logger = "0.5.9"
futures-preview = "0.3.0-alpha.18"
futures-preview = "0.3.0-alpha.17"
http = "0.1.5"
string = "0.2"
tokio = { git = "https://github.com/tokio-rs/tokio" }
tokio = "0.2.0-alpha.1"

View File

@@ -7,16 +7,15 @@ pub mod assert;
pub mod raw;
pub mod frames;
pub mod prelude;
pub mod mock;
pub mod mock_io;
pub mod notify;
pub mod prelude;
pub mod util;
mod client_ext;
mod future_ext;
pub use crate::client_ext::{SendRequestExt};
pub use crate::client_ext::SendRequestExt;
pub use crate::future_ext::TestFuture;
pub type WindowSize = usize;

View File

@@ -1,53 +0,0 @@
use std::sync::Arc;
use std::sync::atomic::AtomicBool;
use std::sync::atomic::Ordering::SeqCst;
pub struct MockNotify {
inner: Arc<Inner>,
}
struct Inner {
notified: AtomicBool,
}
impl MockNotify {
pub fn new() -> Self {
MockNotify {
inner: Arc::new(Inner {
notified: AtomicBool::new(false),
}),
}
}
pub fn with<F: FnOnce() -> R, R>(&self, _f: F) -> R {
unimplemented!();
// use futures::future::poll_fn;
// self.clear();
// let mut f = Some(f);
// let res = tokio::spawn(poll_fn(move |cx| {
// Poll::Ready(f.take().unwrap()())
// })).poll_future_notify(&self.inner, 0);
// match res {
// Poll::Ready(v) => v,
// _ => unreachable!(),
// }
}
pub fn clear(&self) {
self.inner.notified.store(false, SeqCst);
}
pub fn is_notified(&self) -> bool {
self.inner.notified.load(SeqCst)
}
}
// impl Notify for Inner {
// fn notify(&self, _: usize) {
// self.notified.store(true, SeqCst);
// }
// }

View File

@@ -12,9 +12,6 @@ pub use super::mock::{self, idle_ms};
// Re-export frames helpers
pub use super::frames;
// Re-export mock notify
pub use super::notify::MockNotify;
// Re-export utility mod
pub use super::util;

View File

@@ -10,5 +10,5 @@ edition = "2018"
[dev-dependencies]
h2-support = { path = "../h2-support" }
log = "0.4.1"
futures-preview = "0.3.0-alpha.18"
tokio = { git = "https://github.com/tokio-rs/tokio" }
futures-preview = "0.3.0-alpha.17"
tokio = "0.2.0-alpha.1"