diff --git a/tests/main.c b/tests/main.c index 22fd27dd..e7304f4f 100644 --- a/tests/main.c +++ b/tests/main.c @@ -135,7 +135,10 @@ int main(int argc, char* argv[]) test_spdylay_session_defer_data) || !CU_add_test(pSuite, "session_flow_control", test_spdylay_session_flow_control) || - !CU_add_test(pSuite, "frame_unpack_nv", test_spdylay_frame_unpack_nv) || + !CU_add_test(pSuite, "frame_unpack_nv_spdy2", + test_spdylay_frame_unpack_nv_spdy2) || + !CU_add_test(pSuite, "frame_unpack_nv_spdy3", + test_spdylay_frame_unpack_nv_spdy3) || !CU_add_test(pSuite, "frame_count_nv_space", test_spdylay_frame_count_nv_space) || !CU_add_test(pSuite, "frame_count_unpack_nv_space", @@ -145,12 +148,18 @@ int main(int argc, char* argv[]) test_spdylay_frame_pack_goaway_spdy2) || !CU_add_test(pSuite, "frame_pack_goaway_spdy3", test_spdylay_frame_pack_goaway_spdy3) || - !CU_add_test(pSuite, "frame_pack_syn_stream", - test_spdylay_frame_pack_syn_stream) || - !CU_add_test(pSuite, "frame_pack_syn_reply", - test_spdylay_frame_pack_syn_reply) || - !CU_add_test(pSuite, "frame_pack_headers", - test_spdylay_frame_pack_headers) || + !CU_add_test(pSuite, "frame_pack_syn_stream_spdy2", + test_spdylay_frame_pack_syn_stream_spdy2) || + !CU_add_test(pSuite, "frame_pack_syn_stream_spdy3", + test_spdylay_frame_pack_syn_stream_spdy3) || + !CU_add_test(pSuite, "frame_pack_syn_reply_spdy2", + test_spdylay_frame_pack_syn_reply_spdy2) || + !CU_add_test(pSuite, "frame_pack_syn_reply_spdy3", + test_spdylay_frame_pack_syn_reply_spdy3) || + !CU_add_test(pSuite, "frame_pack_headers_spdy2", + test_spdylay_frame_pack_headers_spdy2) || + !CU_add_test(pSuite, "frame_pack_headers_spdy3", + test_spdylay_frame_pack_headers_spdy3) || !CU_add_test(pSuite, "frame_pack_window_update", test_spdylay_frame_pack_window_update) || !CU_add_test(pSuite, "frame_pack_settings", diff --git a/tests/spdylay_frame_test.c b/tests/spdylay_frame_test.c index 6d231ff4..3f47db65 100644 --- a/tests/spdylay_frame_test.c +++ b/tests/spdylay_frame_test.c @@ -60,9 +60,13 @@ void test_spdylay_frame_unpack_nv_with(size_t len_size) spdylay_frame_nv_del(nv); } -void test_spdylay_frame_unpack_nv() +void test_spdylay_frame_unpack_nv_spdy2() { test_spdylay_frame_unpack_nv_with(2); +} + +void test_spdylay_frame_unpack_nv_spdy3() +{ test_spdylay_frame_unpack_nv_with(4); } @@ -256,7 +260,7 @@ void test_spdylay_frame_pack_goaway_spdy3() test_spdylay_frame_pack_goaway_version(SPDYLAY_PROTO_SPDY3); } -void test_spdylay_frame_pack_syn_stream_with(uint16_t version) +void test_spdylay_frame_pack_syn_stream_version(uint16_t version) { spdylay_zlib deflater, inflater; spdylay_frame frame, oframe; @@ -299,13 +303,17 @@ void test_spdylay_frame_pack_syn_stream_with(uint16_t version) spdylay_buffer_free(&inflatebuf); } -void test_spdylay_frame_pack_syn_stream() +void test_spdylay_frame_pack_syn_stream_spdy2() { - test_spdylay_frame_pack_syn_stream_with(SPDYLAY_PROTO_SPDY2); - test_spdylay_frame_pack_syn_stream_with(SPDYLAY_PROTO_SPDY3); + test_spdylay_frame_pack_syn_stream_version(SPDYLAY_PROTO_SPDY2); } -void test_spdylay_frame_pack_syn_reply_with(uint16_t version) +void test_spdylay_frame_pack_syn_stream_spdy3() +{ + test_spdylay_frame_pack_syn_stream_version(SPDYLAY_PROTO_SPDY3); +} + +void test_spdylay_frame_pack_syn_reply_version(uint16_t version) { spdylay_zlib deflater, inflater; spdylay_frame frame, oframe; @@ -347,13 +355,17 @@ void test_spdylay_frame_pack_syn_reply_with(uint16_t version) spdylay_buffer_free(&inflatebuf); } -void test_spdylay_frame_pack_syn_reply() +void test_spdylay_frame_pack_syn_reply_spdy2() { - test_spdylay_frame_pack_syn_reply_with(SPDYLAY_PROTO_SPDY2); - test_spdylay_frame_pack_syn_reply_with(SPDYLAY_PROTO_SPDY3); + test_spdylay_frame_pack_syn_reply_version(SPDYLAY_PROTO_SPDY2); } -void test_spdylay_frame_pack_headers_with(uint16_t version) +void test_spdylay_frame_pack_syn_reply_spdy3() +{ + test_spdylay_frame_pack_syn_reply_version(SPDYLAY_PROTO_SPDY3); +} + +void test_spdylay_frame_pack_headers_version(uint16_t version) { spdylay_zlib deflater, inflater; spdylay_frame frame, oframe; @@ -395,10 +407,14 @@ void test_spdylay_frame_pack_headers_with(uint16_t version) spdylay_buffer_free(&inflatebuf); } -void test_spdylay_frame_pack_headers() +void test_spdylay_frame_pack_headers_spdy2() { - test_spdylay_frame_pack_headers_with(SPDYLAY_PROTO_SPDY2); - test_spdylay_frame_pack_headers_with(SPDYLAY_PROTO_SPDY3); + test_spdylay_frame_pack_headers_version(SPDYLAY_PROTO_SPDY2); +} + +void test_spdylay_frame_pack_headers_spdy3() +{ + test_spdylay_frame_pack_headers_version(SPDYLAY_PROTO_SPDY3); } void test_spdylay_frame_pack_window_update() diff --git a/tests/spdylay_frame_test.h b/tests/spdylay_frame_test.h index cb3f241a..fddc2241 100644 --- a/tests/spdylay_frame_test.h +++ b/tests/spdylay_frame_test.h @@ -25,16 +25,20 @@ #ifndef SPDYLAY_FRAME_TEST_H #define SPDYLAY_FRAME_TEST_H -void test_spdylay_frame_unpack_nv(); +void test_spdylay_frame_unpack_nv_spdy2(); +void test_spdylay_frame_unpack_nv_spdy3(); void test_spdylay_frame_pack_nv_duplicate_keys(); void test_spdylay_frame_count_nv_space(); void test_spdylay_frame_count_unpack_nv_space(); void test_spdylay_frame_pack_ping(); void test_spdylay_frame_pack_goaway_spdy2(); void test_spdylay_frame_pack_goaway_spdy3(); -void test_spdylay_frame_pack_syn_stream(); -void test_spdylay_frame_pack_syn_reply(); -void test_spdylay_frame_pack_headers(); +void test_spdylay_frame_pack_syn_stream_spdy2(); +void test_spdylay_frame_pack_syn_stream_spdy3(); +void test_spdylay_frame_pack_syn_reply_spdy2(); +void test_spdylay_frame_pack_syn_reply_spdy3(); +void test_spdylay_frame_pack_headers_spdy2(); +void test_spdylay_frame_pack_headers_spdy3(); void test_spdylay_frame_pack_window_update(); void test_spdylay_frame_pack_settings(); void test_spdylay_frame_nv_sort();