Commit 8db39699 authored by FuGangqiang's avatar FuGangqiang Committed by antirez
Browse files

sdsfree x and y

parent 98756d4c
...@@ -1083,6 +1083,7 @@ int main(void) { ...@@ -1083,6 +1083,7 @@ int main(void) {
int oldfree; int oldfree;
sdsfree(x); sdsfree(x);
sdsfree(y);
x = sdsnew("0"); x = sdsnew("0");
sh = (void*) (x-(sizeof(struct sdshdr))); sh = (void*) (x-(sizeof(struct sdshdr)));
test_cond("sdsnew() free/len buffers", sh->len == 1 && sh->free == 0); test_cond("sdsnew() free/len buffers", sh->len == 1 && sh->free == 0);
...@@ -1095,6 +1096,8 @@ int main(void) { ...@@ -1095,6 +1096,8 @@ int main(void) {
test_cond("sdsIncrLen() -- content", x[0] == '0' && x[1] == '1'); test_cond("sdsIncrLen() -- content", x[0] == '0' && x[1] == '1');
test_cond("sdsIncrLen() -- len", sh->len == 2); test_cond("sdsIncrLen() -- len", sh->len == 2);
test_cond("sdsIncrLen() -- free", sh->free == oldfree-1); test_cond("sdsIncrLen() -- free", sh->free == oldfree-1);
sdsfree(x);
} }
} }
test_report() test_report()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment