Commit 33d98c5a authored by Dave Wells's avatar Dave Wells Committed by Yoni Fogel

add key-value checks, extraneous entry checks

git-svn-id: file:///svn/toku/tokudb@12998 c7de825b-a66e-492c-adef-691d508d4ae1
parent 0bc28ee9
......@@ -75,7 +75,25 @@ do_x1_recover (BOOL did_commit)
if (did_commit) {
assert(ra==0);
assert(rb==0);
fprintf(stderr, "Both present. Yay!\n");
// verify key-value pairs
assert(aa.size==2);
assert(ab.size==2);
assert(ba.size==2);
assert(bb.size==2);
unsigned int i;
char a[2] = "a";
char b[2] = "b";
for (i=0;i<2;i++) {
assert(*(char*)(aa.data + i) == a[i]);
assert(*(char*)(ab.data + i) == b[i]);
assert(*(char*)(ba.data + i) == b[i]);
assert(*(char*)(bb.data + i) == a[i]);
}
// make sure no other entries in DB
assert(ca->c_get(ca, &aa, &ab, DB_NEXT) == DB_NOTFOUND);
assert(cb->c_get(cb, &ba, &bb, DB_NEXT) == DB_NOTFOUND);
fprintf(stderr, "Both verified. Yay!\n");
} else {
// It wasn't commited (it also wasn't aborted), but a checkpoint happened.
assert(ra==DB_NOTFOUND);
......
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