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
9adb3aed
Commit
9adb3aed
authored
Jul 12, 2011
by
Pieter Noordhuis
Browse files
Apply segmented test to 64-bit extremes
parent
ee443ce5
Changes
1
Show whitespace changes
Inline
Side-by-side
test/parser.c
View file @
9adb3aed
...
@@ -368,6 +368,7 @@ void test_integer(redis_parser_t *p) {
...
@@ -368,6 +368,7 @@ void test_integer(redis_parser_t *p) {
assert
(
redis_parser_execute
(
p
,
&
res
,
buf
,
strlen
(
buf
))
==
strlen
(
buf
));
assert
(
redis_parser_execute
(
p
,
&
res
,
buf
,
strlen
(
buf
))
==
strlen
(
buf
));
assert
(
res
!=
NULL
);
assert
(
res
!=
NULL
);
assert
(
cb_log_idx
==
1
&&
cb_log
[
0
].
integer_value
==
INT64_MAX
);
assert
(
cb_log_idx
==
1
&&
cb_log
[
0
].
integer_value
==
INT64_MAX
);
test_char_by_char
(
res
,
buf
,
strlen
(
buf
));
/* Signed 64-bit maximum overflow */
/* Signed 64-bit maximum overflow */
buf
=
":9223372036854775808
\r\n
"
;
buf
=
":9223372036854775808
\r\n
"
;
...
@@ -382,6 +383,7 @@ void test_integer(redis_parser_t *p) {
...
@@ -382,6 +383,7 @@ void test_integer(redis_parser_t *p) {
assert
(
redis_parser_execute
(
p
,
&
res
,
buf
,
strlen
(
buf
))
==
strlen
(
buf
));
assert
(
redis_parser_execute
(
p
,
&
res
,
buf
,
strlen
(
buf
))
==
strlen
(
buf
));
assert
(
res
!=
NULL
);
assert
(
res
!=
NULL
);
assert
(
cb_log_idx
==
1
&&
cb_log
[
0
].
integer_value
==
INT64_MIN
);
assert
(
cb_log_idx
==
1
&&
cb_log
[
0
].
integer_value
==
INT64_MIN
);
test_char_by_char
(
res
,
buf
,
strlen
(
buf
));
/* Signed 64-bit minimum overflow (or underflow...) */
/* Signed 64-bit minimum overflow (or underflow...) */
buf
=
":-9223372036854775809
\r\n
"
;
buf
=
":-9223372036854775809
\r\n
"
;
...
...
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