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
acf174fb
Commit
acf174fb
authored
Jul 05, 2011
by
Pieter Noordhuis
Browse files
Fix tests
parent
4088a8f9
Changes
1
Hide whitespace changes
Inline
Side-by-side
test/parser.c
View file @
acf174fb
...
@@ -243,7 +243,7 @@ void test_integer(void) {
...
@@ -243,7 +243,7 @@ void test_integer(void) {
/* Start with 0 */
/* Start with 0 */
buf
=
":0123
\r\n
"
;
buf
=
":0123
\r\n
"
;
reinitialize
(
p
);
reinitialize
(
p
);
assert
(
redis_parser_execute
(
p
,
&
res
,
buf
,
strlen
(
buf
))
==
1
);
assert
(
redis_parser_execute
(
p
,
&
res
,
buf
,
strlen
(
buf
))
==
2
);
assert
(
res
==
NULL
);
assert
(
res
==
NULL
);
/* Start with non-digit */
/* Start with non-digit */
...
@@ -274,7 +274,7 @@ void test_integer(void) {
...
@@ -274,7 +274,7 @@ void test_integer(void) {
/* Signed 64-bit maximum overflow */
/* Signed 64-bit maximum overflow */
buf
=
":9223372036854775808
\r\n
"
;
buf
=
":9223372036854775808
\r\n
"
;
reinitialize
(
p
);
reinitialize
(
p
);
assert
(
redis_parser_execute
(
p
,
&
res
,
buf
,
strlen
(
buf
))
==
strlen
(
buf
)
-
2
);
assert
(
redis_parser_execute
(
p
,
&
res
,
buf
,
strlen
(
buf
))
==
strlen
(
buf
)
-
1
);
assert
(
res
==
NULL
);
assert
(
res
==
NULL
);
/* Signed 64-bit minimum */
/* Signed 64-bit minimum */
...
@@ -287,7 +287,7 @@ void test_integer(void) {
...
@@ -287,7 +287,7 @@ void test_integer(void) {
/* Signed 64-bit minimum overflow (or underflow...) */
/* Signed 64-bit minimum overflow (or underflow...) */
buf
=
":-9223372036854775809
\r\n
"
;
buf
=
":-9223372036854775809
\r\n
"
;
reinitialize
(
p
);
reinitialize
(
p
);
assert
(
redis_parser_execute
(
p
,
&
res
,
buf
,
strlen
(
buf
))
==
strlen
(
buf
)
-
2
);
assert
(
redis_parser_execute
(
p
,
&
res
,
buf
,
strlen
(
buf
))
==
strlen
(
buf
)
-
1
);
assert
(
res
==
NULL
);
assert
(
res
==
NULL
);
free_parser
(
p
);
free_parser
(
p
);
...
...
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