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
redis
Commits
01f36192
Commit
01f36192
authored
Apr 27, 2011
by
Pieter Noordhuis
Browse files
Extra tests for string2ll
parent
6e258c76
Changes
1
Show whitespace changes
Inline
Side-by-side
src/util.c
View file @
01f36192
...
@@ -333,6 +333,14 @@ void test_string2ll(void) {
...
@@ -333,6 +333,14 @@ void test_string2ll(void) {
strcpy
(
buf
,
"+1"
);
strcpy
(
buf
,
"+1"
);
assert
(
string2ll
(
buf
,
strlen
(
buf
),
&
v
)
==
0
);
assert
(
string2ll
(
buf
,
strlen
(
buf
),
&
v
)
==
0
);
/* Leading space. */
strcpy
(
buf
,
" 1"
);
assert
(
string2ll
(
buf
,
strlen
(
buf
),
&
v
)
==
0
);
/* Trailing space. */
strcpy
(
buf
,
"1 "
);
assert
(
string2ll
(
buf
,
strlen
(
buf
),
&
v
)
==
0
);
/* May not start with 0. */
/* May not start with 0. */
strcpy
(
buf
,
"01"
);
strcpy
(
buf
,
"01"
);
assert
(
string2ll
(
buf
,
strlen
(
buf
),
&
v
)
==
0
);
assert
(
string2ll
(
buf
,
strlen
(
buf
),
&
v
)
==
0
);
...
...
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