Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
hiredis
Commits
7ad207fb
Commit
7ad207fb
authored
Jan 05, 2012
by
Pieter Noordhuis
Browse files
Make ignoring connection in test more explicit
parent
945aae00
Changes
1
Hide whitespace changes
Inline
Side-by-side
test/test-context.c
View file @
7ad207fb
...
@@ -255,6 +255,11 @@ TEST(call_command_argv) {
...
@@ -255,6 +255,11 @@ TEST(call_command_argv) {
redis_context_destroy
(
&
c
);
redis_context_destroy
(
&
c
);
}
}
void
run_server_ignore_connection
(
int
fd
,
void
*
data
)
{
((
void
)
fd
);
((
void
)
data
);
}
TEST
(
flush_against_full_kernel_buffer
)
{
TEST
(
flush_against_full_kernel_buffer
)
{
SETUP_CONNECT
();
SETUP_CONNECT
();
...
@@ -262,6 +267,7 @@ TEST(flush_against_full_kernel_buffer) {
...
@@ -262,6 +267,7 @@ TEST(flush_against_full_kernel_buffer) {
run_server_args
args
;
run_server_args
args
;
args
.
address
=
addr
;
args
.
address
=
addr
;
args
.
fn
.
ptr
=
run_server_ignore_connection
;
spawn
(
run_server
,
&
args
);
spawn
(
run_server
,
&
args
);
...
@@ -285,7 +291,8 @@ TEST(flush_against_full_kernel_buffer) {
...
@@ -285,7 +291,8 @@ TEST(flush_against_full_kernel_buffer) {
assert_equal_int
(
errno
,
ETIMEDOUT
);
assert_equal_int
(
errno
,
ETIMEDOUT
);
}
}
void
close_after_accept
(
int
fd
,
void
*
data
)
{
void
run_server_close_after_accept
(
int
fd
,
void
*
data
)
{
((
void
)
data
);
close
(
fd
);
close
(
fd
);
}
}
...
@@ -296,7 +303,7 @@ TEST(read_against_closed_connection) {
...
@@ -296,7 +303,7 @@ TEST(read_against_closed_connection) {
run_server_args
args
;
run_server_args
args
;
args
.
address
=
addr
;
args
.
address
=
addr
;
args
.
fn
.
ptr
=
close_after_accept
;
args
.
fn
.
ptr
=
run_server_
close_after_accept
;
spawn
(
run_server
,
&
args
);
spawn
(
run_server
,
&
args
);
...
...
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