/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */ #ident "Copyright (c) 2007, 2008 Tokutek Inc. All rights reserved." #ident "Id:" // Test for #3748 (FIFO's do not shrink their size after a flush) // This test makes sure that the code that stabilizes fifos works. #include "includes.h" #include "test.h" int verbose; static void test_3748 (void) { FIFO f; int r; f = NULL; r = toku_fifo_create(&f); char *thekey = 0; int thekeylen; char *theval = 0; int thevallen; #define buildkey(len) { \ thekeylen = len; \ thekey = toku_realloc(thekey, thekeylen); \ memset(thekey, len, thekeylen); \ } #define buildval(len) { \ thevallen = len+1; \ theval = toku_realloc(theval, thevallen); \ memset(theval, ~len, thevallen); \ } MSN startmsn = ZERO_MSN; int N=1000; // enqueue some stuff for (int i=0; i