mirror of
https://github.com/fluencelabs/redis
synced 2025-03-19 17:10:50 +00:00
sdsfree x and y
This commit is contained in:
parent
239494db64
commit
26a1a08fc7
@ -1098,6 +1098,7 @@ int sdsTest(int argc, char *argv[]) {
|
|||||||
unsigned int oldfree;
|
unsigned 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);
|
||||||
@ -1110,6 +1111,8 @@ int sdsTest(int argc, char *argv[]) {
|
|||||||
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()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user