Пример #1
0
void lruhash_test(void)
{
    struct lruhash *table;
    printf("test lruhash functions\n");

    table = lruhash_create(2, 8192, sizefunc, compfunc, delkey, deldata);
    test_bucket_find_entry(table);
    test_lru(table);
    test_short_table(table);
    test_long_table(table);
    lruhash_delete(table);

    table = lruhash_create(2, 8192, sizefunc, compfunc, delkey, deldata);
    test_threaded_table(table);
    lruhash_delete(table);
}
Пример #2
0
void slabhash_test(void)
{
	/* start very very small array, so it can do lots of table_grow() */
	/* also small in size so that reclaim has to be done quickly. */
	struct slabhash* table;
	unit_show_feature("slabhash");
	table = slabhash_create(4, 2, 10400, 
		test_slabhash_sizefunc, test_slabhash_compfunc, 
		test_slabhash_delkey, test_slabhash_deldata, NULL);
	test_short_table(table);
	test_long_table(table);
	slabhash_delete(table);
	table = slabhash_create(4, 2, 10400, 
		test_slabhash_sizefunc, test_slabhash_compfunc, 
		test_slabhash_delkey, test_slabhash_deldata, NULL);
	test_threaded_table(table);
	slabhash_delete(table);
}
void lruhash_test(void)
{
	/* start very very small array, so it can do lots of table_grow() */
	/* also small in size so that reclaim has to be done quickly. */
	struct lruhash* table ;
	unit_show_feature("lruhash");
	table = lruhash_create(2, 8192, 
		test_slabhash_sizefunc, test_slabhash_compfunc, 
		test_slabhash_delkey, test_slabhash_deldata, NULL);
	test_bin_find_entry(table);
	test_lru(table);
	test_short_table(table);
	test_long_table(table);
	lruhash_delete(table);
	table = lruhash_create(2, 8192, 
		test_slabhash_sizefunc, test_slabhash_compfunc, 
		test_slabhash_delkey, test_slabhash_deldata, NULL);
	test_threaded_table(table);
	lruhash_delete(table);
}