- kv.key = tm->keys[j];
- rv = BV (clib_bihash_search) (h, &kv, &kv);
- if (j <= i && rv >= 0)
- {
- clib_warning
- ("i %d j %d search ok but should not be, value %lld",
- i, j, kv.value);
- }
- if (j > i && rv < 0)
+ p = hash_get (tm->key_hash, tm->keys[i]);
+ if (p == 0 || p[0] != (uword) (i + 1))
+ clib_warning ("ugh, couldn't find %lld\n", tm->keys[i]);
+ }
+ }
+
+ delta = clib_time_now (&tm->clib_time) - before;
+ total_searches = (uword) tm->search_iter * (uword) tm->nitems;
+
+ if ((acycle % tm->report_every_n) == 0)
+ {
+ fformat (stdout, "%lld searches in %.6f seconds\n",
+ total_searches, delta);
+
+ if (delta > 0)
+ fformat (stdout, "%.f searches per second\n",
+ ((f64) total_searches) / delta);
+ fformat (stdout, "Delete items...\n");
+ }
+
+ for (i = 0; i < tm->nitems; i++)
+ {
+ int j;
+ int rv;
+
+ kv.key = tm->keys[i];
+ kv.value = (u64) (i + 1);
+ rv = BV (clib_bihash_add_del) (h, &kv, 0 /* is_add */ );
+
+ if (rv < 0)
+ clib_warning ("delete key %lld not ok but should be",
+ tm->keys[i]);
+
+ if (tm->careful_delete_tests)
+ {
+ for (j = 0; j < tm->nitems; j++)