Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nghttp2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
nghttp2
Commits
164312d8
Commit
164312d8
authored
May 12, 2012
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added test for EOF from recv_callback.
parent
88599228
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
0 deletions
+27
-0
tests/main.c
tests/main.c
+2
-0
tests/spdylay_session_test.c
tests/spdylay_session_test.c
+24
-0
tests/spdylay_session_test.h
tests/spdylay_session_test.h
+1
-0
No files found.
tests/main.c
View file @
164312d8
...
...
@@ -158,6 +158,8 @@ int main(int argc, char* argv[])
test_spdylay_submit_window_update
)
||
!
CU_add_test
(
pSuite
,
"session_data_read_temporal_failure"
,
test_spdylay_session_data_read_temporal_failure
)
||
!
CU_add_test
(
pSuite
,
"session_recv_eof"
,
test_spdylay_session_recv_eof
)
||
!
CU_add_test
(
pSuite
,
"frame_unpack_nv_spdy2"
,
test_spdylay_frame_unpack_nv_spdy2
)
||
!
CU_add_test
(
pSuite
,
"frame_unpack_nv_spdy3"
,
...
...
tests/spdylay_session_test.c
View file @
164312d8
...
...
@@ -105,6 +105,13 @@ static ssize_t scripted_recv_callback(spdylay_session *session,
return
wlen
;
}
static
ssize_t
eof_recv_callback
(
spdylay_session
*
session
,
uint8_t
*
data
,
size_t
len
,
int
flags
,
void
*
user_data
)
{
return
SPDYLAY_ERR_EOF
;
}
static
ssize_t
accumulator_send_callback
(
spdylay_session
*
session
,
const
uint8_t
*
buf
,
size_t
len
,
int
flags
,
void
*
user_data
)
...
...
@@ -2399,3 +2406,20 @@ void test_spdylay_session_data_read_temporal_failure(void)
spdylay_session_del
(
session
);
}
void
test_spdylay_session_recv_eof
(
void
)
{
spdylay_session
*
session
;
spdylay_session_callbacks
callbacks
;
memset
(
&
callbacks
,
0
,
sizeof
(
spdylay_session_callbacks
));
callbacks
.
send_callback
=
null_send_callback
;
callbacks
.
recv_callback
=
eof_recv_callback
;
spdylay_session_client_new
(
&
session
,
SPDYLAY_PROTO_SPDY3
,
&
callbacks
,
NULL
);
CU_ASSERT
(
SPDYLAY_ERR_EOF
==
spdylay_session_recv
(
session
));
spdylay_session_del
(
session
);
}
tests/spdylay_session_test.h
View file @
164312d8
...
...
@@ -70,5 +70,6 @@ void test_spdylay_session_set_initial_client_cert_origin(void);
void
test_spdylay_session_set_option
(
void
);
void
test_spdylay_submit_window_update
(
void
);
void
test_spdylay_session_data_read_temporal_failure
(
void
);
void
test_spdylay_session_recv_eof
(
void
);
#endif
/* SPDYLAY_SESSION_TEST_H */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment