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
b550b8c8
Commit
b550b8c8
authored
Jul 12, 2011
by
Pieter Noordhuis
Browse files
More tests for status and error messages
parent
628a961f
Changes
1
Show whitespace changes
Inline
Side-by-side
test/parser.c
View file @
b550b8c8
...
@@ -442,6 +442,10 @@ void test_status(redis_parser_t *p) {
...
@@ -442,6 +442,10 @@ void test_status(redis_parser_t *p) {
assert
(
res
->
plen
==
9
);
assert
(
res
->
plen
==
9
);
assert
(
res
->
coff
==
1
);
assert
(
res
->
coff
==
1
);
assert
(
res
->
clen
==
6
);
assert
(
res
->
clen
==
6
);
assert
(
!
strncmp
(
cb_log
[
0
].
string_buf
,
buf
+
1
,
6
));
/* Chunked check */
test_char_by_char
(
res
,
buf
,
len
);
}
}
void
test_error
(
redis_parser_t
*
p
)
{
void
test_error
(
redis_parser_t
*
p
)
{
...
@@ -458,6 +462,10 @@ void test_error(redis_parser_t *p) {
...
@@ -458,6 +462,10 @@ void test_error(redis_parser_t *p) {
assert
(
res
->
plen
==
8
);
assert
(
res
->
plen
==
8
);
assert
(
res
->
coff
==
1
);
assert
(
res
->
coff
==
1
);
assert
(
res
->
clen
==
5
);
assert
(
res
->
clen
==
5
);
assert
(
!
strncmp
(
cb_log
[
0
].
string_buf
,
buf
+
1
,
5
));
/* Chunked check */
test_char_by_char
(
res
,
buf
,
len
);
}
}
int
main
(
int
argc
,
char
**
argv
)
{
int
main
(
int
argc
,
char
**
argv
)
{
...
...
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