mirror of
https://gitee.com/openharmony/third_party_nghttp2
synced 2024-11-23 07:50:02 +00:00
Added test
This commit is contained in:
parent
a52ff39850
commit
5ececcd8e7
@ -94,8 +94,6 @@ int spdylay_frame_unpack_syn_stream(spdylay_syn_stream *frame,
|
||||
const uint8_t *payload, size_t payloadlen,
|
||||
spdylay_zlib *inflater);
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Unpacks SYN_REPLY frame byte sequence into |frame|. This function
|
||||
* returns 0 if it succeeds or negative error code.
|
||||
|
@ -69,8 +69,9 @@ int main()
|
||||
!CU_add_test(pSuite, "session_recv", test_spdylay_session_recv) ||
|
||||
!CU_add_test(pSuite, "session_add_frame",
|
||||
test_spdylay_session_add_frame) ||
|
||||
!CU_add_test(pSuite, "frame_unpack_nv",
|
||||
test_spdylay_frame_unpack_nv)) {
|
||||
!CU_add_test(pSuite, "frame_unpack_nv", test_spdylay_frame_unpack_nv) ||
|
||||
!CU_add_test(pSuite, "frame_count_nv_space",
|
||||
test_spdylay_frame_count_nv_space)) {
|
||||
CU_cleanup_registry();
|
||||
return CU_get_error();
|
||||
}
|
||||
|
@ -28,17 +28,18 @@
|
||||
|
||||
#include "spdylay_frame.h"
|
||||
|
||||
static const char *headers[] = {
|
||||
"method", "GET",
|
||||
"scheme", "https",
|
||||
"url", "/",
|
||||
"x-head", "foo",
|
||||
"x-head", "bar",
|
||||
"version", "HTTP/1.1",
|
||||
NULL
|
||||
};
|
||||
|
||||
void test_spdylay_frame_unpack_nv()
|
||||
{
|
||||
const char *headers[] = {
|
||||
"method", "GET",
|
||||
"scheme", "https",
|
||||
"url", "/",
|
||||
"version", "HTTP/1.1",
|
||||
"x-head", "foo",
|
||||
"x-head", "bar",
|
||||
NULL
|
||||
};
|
||||
const char in[1024];
|
||||
char **nv;
|
||||
int i;
|
||||
@ -48,3 +49,8 @@ void test_spdylay_frame_unpack_nv()
|
||||
free(nv);
|
||||
}
|
||||
|
||||
void test_spdylay_frame_count_nv_space()
|
||||
{
|
||||
CU_ASSERT(83 == spdylay_frame_count_nv_space(headers));
|
||||
}
|
||||
|
||||
|
@ -26,5 +26,6 @@
|
||||
#define SPDYLAY_FRAME_TEST_H
|
||||
|
||||
void test_spdylay_frame_unpack_nv();
|
||||
void test_spdylay_frame_count_nv_space();
|
||||
|
||||
#endif /* SPDYLAY_FRAME_TEST_H */
|
||||
|
Loading…
Reference in New Issue
Block a user