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
c06801cb
Commit
c06801cb
authored
Oct 01, 2011
by
Pieter Noordhuis
Browse files
Test successful connection
parent
aacf12c2
Changes
1
Hide whitespace changes
Inline
Side-by-side
test/test-handle.c
View file @
c06801cb
...
@@ -130,10 +130,28 @@ int test_connect_gai_unknown_host(void) {
...
@@ -130,10 +130,28 @@ int test_connect_gai_unknown_host(void) {
return
0
;
return
0
;
}
}
int
test_connect_gai_success
(
void
)
{
redis_handle
h
;
int
rv
;
rv
=
redis_handle_init
(
&
h
);
assert
(
rv
==
REDIS_OK
);
rv
=
redis_handle_connect_gai
(
&
h
,
AF_INET
,
"localhost"
,
redis_port
());
assert_equal_int
(
rv
,
REDIS_OK
);
rv
=
redis_handle_wait_connected
(
&
h
);
assert_equal_int
(
rv
,
REDIS_OK
);
redis_handle_destroy
(
&
h
);
return
0
;
}
int
main
(
void
)
{
int
main
(
void
)
{
test_connect_in_refused
();
test_connect_in_refused
();
test_connect_in6_refused
();
test_connect_in6_refused
();
test_connect_un_noent
();
test_connect_un_noent
();
test_connect_timeout
();
test_connect_timeout
();
test_connect_gai_unknown_host
();
test_connect_gai_unknown_host
();
test_connect_gai_success
();
}
}
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