+ if (!tdb)
+ continue;
+
+ /* Put a single entry in. */
+ v = 0;
+ ok1(tdb_store(tdb, key, data, TDB_INSERT) == 0);
+ enlarge_hash(tdb);
+ ok1(tdb_check(tdb, NULL, NULL) == 0);
+
+ /* Put a non-clashing entry in. */
+ v = 2;
+ ok1(tdb_store(tdb, key, data, TDB_INSERT) == 0);
+ enlarge_hash(tdb);
+ ok1(tdb_check(tdb, NULL, NULL) == 0);
+
+ /* Now, make a clash. */
+ v = 1;
+ ok1(tdb_store(tdb, key, data, TDB_INSERT) == 0);
+ enlarge_hash(tdb);
+ ok1(tdb_check(tdb, NULL, NULL) == 0);
+
+ /* Clash at end. */
+ v = ((1 << tdb->header.v.hash_bits) - 1) * 2;
+ ok1(tdb_store(tdb, key, data, TDB_INSERT) == 0);
+ v++;
+ ok1(tdb_store(tdb, key, data, TDB_INSERT) == 0);
+ ok1(tdb_check(tdb, NULL, NULL) == 0);
+ enlarge_hash(tdb);
+ ok1(tdb_check(tdb, NULL, NULL) == 0);
+
+ tdb_close(tdb);