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
0a66b7c0
Commit
0a66b7c0
authored
Jan 05, 2012
by
Pieter Noordhuis
Browse files
Rename test helper to avoid naming conflict
parent
4757c6d1
Changes
1
Hide whitespace changes
Inline
Side-by-side
test/test-context.c
View file @
0a66b7c0
...
...
@@ -154,7 +154,7 @@ TEST(connect_gai_success) {
rv = redis_context_connect_gai(&c, "localhost", redis_port()); \
assert_equal_return(rv, REDIS_OK);
static
redis_object
*
read
(
redis_context
*
ctx
)
{
static
redis_object
*
read
_from_context
(
redis_context
*
ctx
)
{
redis_protocol
*
reply
;
int
rv
;
...
...
@@ -181,12 +181,12 @@ TEST(write_command) {
rv
=
redis_context_write_command
(
&
c
,
"set foo bar"
);
assert_equal_return
(
rv
,
REDIS_OK
);
compare_ok_status
(
read
(
&
c
));
compare_ok_status
(
read
_from_context
(
&
c
));
/* Check that the command was executed as intended */
rv
=
redis_context_write_command
(
&
c
,
"get foo"
);
assert_equal_return
(
rv
,
REDIS_OK
);
compare_string
(
read
(
&
c
),
"bar"
,
3
);
compare_string
(
read
_from_context
(
&
c
),
"bar"
,
3
);
redis_context_destroy
(
&
c
);
}
...
...
@@ -199,7 +199,7 @@ TEST(write_command_argv) {
size_t
argvlen1
[]
=
{
3
,
3
,
3
};
rv
=
redis_context_write_command_argv
(
&
c
,
argc1
,
argv1
,
argvlen1
);
assert_equal_return
(
rv
,
REDIS_OK
);
compare_ok_status
(
read
(
&
c
));
compare_ok_status
(
read
_from_context
(
&
c
));
/* Check that the command was executed as intended */
int
argc2
=
2
;
...
...
@@ -207,7 +207,7 @@ TEST(write_command_argv) {
size_t
argvlen2
[]
=
{
3
,
argvlen1
[
1
]
};
rv
=
redis_context_write_command_argv
(
&
c
,
argc2
,
argv2
,
argvlen2
);
assert_equal_return
(
rv
,
REDIS_OK
);
compare_string
(
read
(
&
c
),
argv1
[
2
],
argvlen1
[
2
]);
compare_string
(
read
_from_context
(
&
c
),
argv1
[
2
],
argvlen1
[
2
]);
redis_context_destroy
(
&
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