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
redis
Commits
8db39699
Commit
8db39699
authored
Apr 20, 2015
by
FuGangqiang
Committed by
antirez
May 04, 2015
Browse files
sdsfree x and y
parent
98756d4c
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/sds.c
View file @
8db39699
...
...
@@ -1083,6 +1083,7 @@ int main(void) {
int
oldfree
;
sdsfree
(
x
);
sdsfree
(
y
);
x
=
sdsnew
(
"0"
);
sh
=
(
void
*
)
(
x
-
(
sizeof
(
struct
sdshdr
)));
test_cond
(
"sdsnew() free/len buffers"
,
sh
->
len
==
1
&&
sh
->
free
==
0
);
...
...
@@ -1095,6 +1096,8 @@ int main(void) {
test_cond
(
"sdsIncrLen() -- content"
,
x
[
0
]
==
'0'
&&
x
[
1
]
==
'1'
);
test_cond
(
"sdsIncrLen() -- len"
,
sh
->
len
==
2
);
test_cond
(
"sdsIncrLen() -- free"
,
sh
->
free
==
oldfree
-
1
);
sdsfree
(
x
);
}
}
test_report
()
...
...
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