mariadb/ft/tests/keytest.c
Yoni Fogel 3a208cebc4 closes [t:4913]. Modelines now synchronized in every source/header file (and always top two lines)
git-svn-id: file:///svn/toku/tokudb@43762 c7de825b-a66e-492c-adef-691d508d4ae1
2013-04-17 00:00:36 -04:00

28 lines
881 B
C

/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
// vim: expandtab:ts=8:sw=4:softtabstop=4:
#ident "$Id$"
#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;
}