mariadb/newbrt/tests/keytest.c
Yoni Fogel 3b42b55489 Closes #1378 Merged all changes into main.
git-svn-id: file:///svn/toku/tokudb@9507 c7de825b-a66e-492c-adef-691d508d4ae1
2013-04-16 23:57:41 -04:00

25 lines
760 B
C

#include "test.h"
#include "key.h"
void
toku_test_keycompare (void) {
assert(toku_keycompare("a",1, "a",1)==0);
assert(toku_keycompare("aa",2, "a",1)>0);
assert(toku_keycompare("a",1, "aa",2)<0);
assert(toku_keycompare("b",1, "aa",2)>0);
assert(toku_keycompare("aa",2, "b",1)<0);
assert(toku_keycompare("aaaba",5, "aaaba",5)==0);
assert(toku_keycompare("aaaba",5, "aaaaa",5)>0);
assert(toku_keycompare("aaaaa",5, "aaaba",5)<0);
assert(toku_keycompare("aaaaa",3, "aaaba",3)==0);
assert(toku_keycompare("\000\000\000\a", 4, "\000\000\000\004", 4)>0);
}
int
test_main (int argc , const char *argv[]) {
default_parse_args(argc, argv);
toku_test_keycompare();
if (verbose) printf("test ok\n");
return 0;
}