Commit 5ececcd8 authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

Added test

parent a52ff398
...@@ -94,8 +94,6 @@ int spdylay_frame_unpack_syn_stream(spdylay_syn_stream *frame, ...@@ -94,8 +94,6 @@ int spdylay_frame_unpack_syn_stream(spdylay_syn_stream *frame,
const uint8_t *payload, size_t payloadlen, const uint8_t *payload, size_t payloadlen,
spdylay_zlib *inflater); spdylay_zlib *inflater);
/* /*
* Unpacks SYN_REPLY frame byte sequence into |frame|. This function * Unpacks SYN_REPLY frame byte sequence into |frame|. This function
* returns 0 if it succeeds or negative error code. * returns 0 if it succeeds or negative error code.
......
...@@ -69,8 +69,9 @@ int main() ...@@ -69,8 +69,9 @@ int main()
!CU_add_test(pSuite, "session_recv", test_spdylay_session_recv) || !CU_add_test(pSuite, "session_recv", test_spdylay_session_recv) ||
!CU_add_test(pSuite, "session_add_frame", !CU_add_test(pSuite, "session_add_frame",
test_spdylay_session_add_frame) || test_spdylay_session_add_frame) ||
!CU_add_test(pSuite, "frame_unpack_nv", !CU_add_test(pSuite, "frame_unpack_nv", test_spdylay_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(); CU_cleanup_registry();
return CU_get_error(); return CU_get_error();
} }
......
...@@ -28,17 +28,18 @@ ...@@ -28,17 +28,18 @@
#include "spdylay_frame.h" #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() 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]; const char in[1024];
char **nv; char **nv;
int i; int i;
...@@ -48,3 +49,8 @@ void test_spdylay_frame_unpack_nv() ...@@ -48,3 +49,8 @@ void test_spdylay_frame_unpack_nv()
free(nv); free(nv);
} }
void test_spdylay_frame_count_nv_space()
{
CU_ASSERT(83 == spdylay_frame_count_nv_space(headers));
}
...@@ -26,5 +26,6 @@ ...@@ -26,5 +26,6 @@
#define SPDYLAY_FRAME_TEST_H #define SPDYLAY_FRAME_TEST_H
void test_spdylay_frame_unpack_nv(); void test_spdylay_frame_unpack_nv();
void test_spdylay_frame_count_nv_space();
#endif /* SPDYLAY_FRAME_TEST_H */ #endif /* SPDYLAY_FRAME_TEST_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment