sdsfree x and y

This commit is contained in:
FuGangqiang
2015-04-20 23:03:34 +08:00
committed by antirez
parent 98756d4c0d
commit 8db3969971

View File

@ -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()