Add test for WINDOW_UPDATE against reserved

This commit is contained in:
Tatsuhiro Tsujikawa 2013-08-19 00:48:48 +09:00
parent 618a1e0782
commit da384988cd
1 changed files with 14 additions and 0 deletions

View File

@ -1177,6 +1177,20 @@ void test_nghttp2_session_on_window_update_received(void)
nghttp2_frame_window_update_free(&frame.window_update);
/* WINDOW_UPDATE against reserved stream is a connection error */
stream = nghttp2_session_open_stream(session, 2, NGHTTP2_FLAG_NONE,
NGHTTP2_PRI_DEFAULT,
NGHTTP2_STREAM_RESERVED, NULL);
nghttp2_frame_window_update_init(&frame.window_update, NGHTTP2_FLAG_NONE,
2, 4096);
CU_ASSERT(!(session->goaway_flags & NGHTTP2_GOAWAY_FAIL_ON_SEND));
CU_ASSERT(0 == nghttp2_session_on_window_update_received(session, &frame));
CU_ASSERT(session->goaway_flags & NGHTTP2_GOAWAY_FAIL_ON_SEND);
nghttp2_frame_window_update_free(&frame.window_update);
nghttp2_session_del(session);
}