Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
hiredis
Commits
e0d5c712
Commit
e0d5c712
authored
Jun 18, 2011
by
Pieter Noordhuis
Browse files
Fix compiler warnings
parent
5f5b3d97
Changes
1
Show whitespace changes
Inline
Side-by-side
test.c
View file @
e0d5c712
...
@@ -77,7 +77,7 @@ static void disconnect(redisContext *c) {
...
@@ -77,7 +77,7 @@ static void disconnect(redisContext *c) {
}
}
static
redisContext
*
connect
(
struct
config
config
)
{
static
redisContext
*
connect
(
struct
config
config
)
{
redisContext
*
c
;
redisContext
*
c
=
NULL
;
if
(
config
.
type
==
CONN_TCP
)
{
if
(
config
.
type
==
CONN_TCP
)
{
c
=
redisConnect
(
config
.
tcp
.
host
,
config
.
tcp
.
port
);
c
=
redisConnect
(
config
.
tcp
.
host
,
config
.
tcp
.
port
);
...
@@ -455,6 +455,7 @@ static void test_blocking_connection(struct config config) {
...
@@ -455,6 +455,7 @@ static void test_blocking_connection(struct config config) {
static
void
test_blocking_io_errors
(
struct
config
config
)
{
static
void
test_blocking_io_errors
(
struct
config
config
)
{
redisContext
*
c
;
redisContext
*
c
;
redisReply
*
reply
;
redisReply
*
reply
;
void
*
_reply
;
int
major
,
minor
;
int
major
,
minor
;
/* Connect to target given by config. */
/* Connect to target given by config. */
...
@@ -478,7 +479,7 @@ static void test_blocking_io_errors(struct config config) {
...
@@ -478,7 +479,7 @@ static void test_blocking_io_errors(struct config config) {
/* > 2.0 returns OK on QUIT and read() should be issued once more
/* > 2.0 returns OK on QUIT and read() should be issued once more
* to know the descriptor is at EOF. */
* to know the descriptor is at EOF. */
test_cond
(
strcasecmp
(
reply
->
str
,
"OK"
)
==
0
&&
test_cond
(
strcasecmp
(
reply
->
str
,
"OK"
)
==
0
&&
redisGetReply
(
c
,
(
void
**
)
&
reply
)
==
REDIS_ERR
);
redisGetReply
(
c
,
&
_
reply
)
==
REDIS_ERR
);
freeReplyObject
(
reply
);
freeReplyObject
(
reply
);
}
else
{
}
else
{
test_cond
(
reply
==
NULL
);
test_cond
(
reply
==
NULL
);
...
@@ -497,7 +498,7 @@ static void test_blocking_io_errors(struct config config) {
...
@@ -497,7 +498,7 @@ static void test_blocking_io_errors(struct config config) {
test
(
"Returns I/O error on socket timeout: "
);
test
(
"Returns I/O error on socket timeout: "
);
struct
timeval
tv
=
{
0
,
1000
};
struct
timeval
tv
=
{
0
,
1000
};
assert
(
redisSetTimeout
(
c
,
tv
)
==
REDIS_OK
);
assert
(
redisSetTimeout
(
c
,
tv
)
==
REDIS_OK
);
test_cond
(
redisGetReply
(
c
,
(
void
**
)
&
reply
)
==
REDIS_ERR
&&
test_cond
(
redisGetReply
(
c
,
&
_
reply
)
==
REDIS_ERR
&&
c
->
err
==
REDIS_ERR_IO
&&
errno
==
EAGAIN
);
c
->
err
==
REDIS_ERR_IO
&&
errno
==
EAGAIN
);
redisFree
(
c
);
redisFree
(
c
);
}
}
...
...
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