/* -*- mode: C; c-basic-offset: 4 -*- */ #ident "Copyright (c) 2008 Tokutek Inc. All rights reserved." #include "includes.h" #include "test.h" #include static TOKUTXN const null_txn = 0; static DB * const null_db = 0; static void test_flat (void) { char fname[]= __FILE__ ".brt"; u_int64_t limit=100; u_int64_t ilimit=100; unlink_file_and_bit(fname); CACHETABLE ct; // set the cachetable to size 1 so that things won't fit. int r = toku_brt_create_cachetable(&ct, 1, ZERO_LSN, NULL_LOGGER); assert(r==0); BRT t; r = toku_brt_create(&t); assert(r==0); r = toku_brt_set_flags(t, TOKU_DB_DUP + TOKU_DB_DUPSORT); assert(r == 0); r = toku_brt_set_nodesize(t, 4096); assert(r == 0); r = toku_brt_open(t, fname, fname, 0, 1, 1, ct, null_txn, (DB*)0); u_int64_t i; for (i=0; i=prevless); prevless=less; assert(greater<=prevgreater); prevgreater=greater; } r = toku_close_brt(t, 0, 0); assert(r==0); r = toku_cachetable_close(&ct); assert(r==0); } int test_main (int argc , const char *argv[]) { default_parse_args(argc, argv); test_flat(); toku_malloc_cleanup(); if (verbose) printf("test ok\n"); return 0; }