-
- /* Second expand, adds another zone of same size. */
- ok1(tdb_expand(tdb, 4 << INITIAL_ZONE_BITS) == 0);
- ok1(tdb->map_size ==
- (2<<INITIAL_ZONE_BITS) + sizeof(struct tdb_header));
- ok1(tdb_check(tdb, NULL, NULL) == 0);
-
- /* Large expand now will double file. */
- ok1(tdb_expand(tdb, 4 << INITIAL_ZONE_BITS) == 0);
- ok1(tdb->map_size ==
- (4<<INITIAL_ZONE_BITS) + sizeof(struct tdb_header));
- ok1(tdb_check(tdb, NULL, NULL) == 0);
-
- /* And again? */
- ok1(tdb_expand(tdb, 4 << INITIAL_ZONE_BITS) == 0);
- ok1(tdb->map_size ==
- (8<<INITIAL_ZONE_BITS) + sizeof(struct tdb_header));
- ok1(tdb_check(tdb, NULL, NULL) == 0);
-
- /* Below comfort level, won't fill zone. */
- ok1(tdb_expand(tdb,
- ((3 << INITIAL_ZONE_BITS)
- >> TDB_COMFORT_FACTOR_BITS)
- - sizeof(struct tdb_used_record)) == 0);
- ok1(tdb->map_size < (12<<INITIAL_ZONE_BITS)
- + sizeof(struct tdb_header));