From bf48ef9babdd9d21a644ff4c73990bd5d3aafa82 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sun, 24 Aug 2014 22:36:35 +0900 Subject: [PATCH] Add test to check consumed size when no auto window update is enabled --- tests/nghttp2_session_test.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/nghttp2_session_test.c b/tests/nghttp2_session_test.c index 3d4092f1..97a03cb4 100644 --- a/tests/nghttp2_session_test.c +++ b/tests/nghttp2_session_test.c @@ -4517,12 +4517,20 @@ void test_nghttp2_session_flow_control_data_with_padding_recv(void) uint8_t data[1024]; nghttp2_frame_hd hd; nghttp2_stream *stream; + nghttp2_option *option; memset(&callbacks, 0, sizeof(nghttp2_session_callbacks)); callbacks.send_callback = null_send_callback; + nghttp2_option_new(&option); + /* Disable auto window update so that we can check padding is + consumed automatically */ + nghttp2_option_set_no_auto_window_update(option, 1); + /* Initial window size to 64KiB - 1*/ - nghttp2_session_client_new(&session, &callbacks, NULL); + nghttp2_session_client_new2(&session, &callbacks, NULL, option); + + nghttp2_option_del(option); stream = nghttp2_session_open_stream(session, 1, NGHTTP2_STREAM_FLAG_NONE, &pri_spec_default, @@ -4544,6 +4552,8 @@ void test_nghttp2_session_flow_control_data_with_padding_recv(void) CU_ASSERT((int32_t)hd.length == session->recv_window_size); CU_ASSERT((int32_t)hd.length == stream->recv_window_size); + CU_ASSERT(256 == session->consumed_size); + CU_ASSERT(256 == stream->consumed_size); nghttp2_session_del(session); }