Fix tests & bug introduced in previous commit

This commit is contained in:
Carl Lerche
2017-08-24 16:48:01 -07:00
parent b0e6867877
commit c0433e8831
3 changed files with 5 additions and 5 deletions

View File

@@ -48,7 +48,7 @@ impl FlowControl {
}
pub fn assign_capacity(&mut self, capacity: WindowSize) {
self.available + capacity;
self.available += capacity;
}
/// Returns the number of bytes available but not assigned to the window.

View File

@@ -35,7 +35,7 @@ fn single_stream_send_large_body() {
let mut stream = h2.request(request, false).unwrap();
// Reserve capacity to send the payload
stream.reserve_capacity(payload.len()).unwrap();
stream.reserve_capacity(payload.len());
// The capacity should be immediately allocated
assert_eq!(stream.capacity(), payload.len());
@@ -88,7 +88,7 @@ fn single_stream_send_extra_large_body_multi_frames_one_buffer() {
let mut stream = h2.request(request, false).unwrap();
stream.reserve_capacity(payload.len()).unwrap();
stream.reserve_capacity(payload.len());
// The capacity should be immediately allocated
assert_eq!(stream.capacity(), payload.len());
@@ -153,7 +153,7 @@ fn single_stream_send_extra_large_body_multi_frames_multi_buffer() {
let mut stream = h2.request(request, false).unwrap();
stream.reserve_capacity(payload.len()).unwrap();
stream.reserve_capacity(payload.len());
// The capacity should be immediately allocated
assert_eq!(stream.capacity(), payload.len());

View File

@@ -75,7 +75,7 @@ fn send_recv_data() {
let mut stream = h2.request(request, false).unwrap();
// Reserve send capacity
stream.reserve_capacity(5).unwrap();
stream.reserve_capacity(5);
assert_eq!(stream.capacity(), 5);