/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * * the files COPYING and Copyright.html. COPYING can be found at the root * * of the source code distribution tree; Copyright.html can be found at the * * root level of an installed copy of the electronic HDF5 document set and * * is linked from the top-level documents page. It can also be found at * * http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have * * access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Test HDF Skip List routines. REMARKS DESIGN BUGS/LIMITATIONS EXPORTED ROUTINES AUTHOR Quincey Koziol MODIFICATION HISTORY 11/15/04 - Started coding */ #include #include #include "testhdf5.h" #include "H5SLprivate.h" /* The number of elements in testing arrays */ #define NUM_ELEMS 1000 /* Random numbers */ static int rand_num[NUM_ELEMS]; static int sort_rand_num[NUM_ELEMS]; static int rev_sort_rand_num[NUM_ELEMS]; static int tst_sort(const void *i1, const void *i2) { return(*(const int *)i1-*(const int *)i2); } static int tst_rev_sort(const void *i1, const void *i2) { return(*(const int *)i2-*(const int *)i1); } /**************************************************************** ** ** test_skiplist_init(): Test H5SL (skiplist) code. ** Initialize data for skip list testing ** ****************************************************************/ static void test_skiplist_init(void) { time_t curr_time; /* Current time, for seeding random number generator */ int new_val; /* New value to insert */ unsigned found; /* Flag to indicate value was inserted already */ size_t u,v; /* Local index variables */ /* Initialize random number seed */ curr_time=time(NULL); HDsrandom((unsigned long)curr_time); /* Create randomized set of numbers */ for(u=0; u