diff options
Diffstat (limited to 'lib/tdb2/test')
-rw-r--r-- | lib/tdb2/test/run-tdb1-3G-file.c | 2 | ||||
-rw-r--r-- | lib/tdb2/test/run-tdb1-incompatible.c | 15 | ||||
-rw-r--r-- | lib/tdb2/test/run-tdb1-wronghash-fail.c | 10 |
3 files changed, 16 insertions, 11 deletions
diff --git a/lib/tdb2/test/run-tdb1-3G-file.c b/lib/tdb2/test/run-tdb1-3G-file.c index 43e9f2ad9b..cf3db23321 100644 --- a/lib/tdb2/test/run-tdb1-3G-file.c +++ b/lib/tdb2/test/run-tdb1-3G-file.c @@ -89,7 +89,7 @@ int main(int argc, char *argv[]) free(data.dptr); /* That currently fills at the end, make sure that's true. */ - hash = tdb->hash_fn(&key); + hash = tdb_hash(tdb, key.dptr, key.dsize); rec_ptr = tdb1_find_lock_hash(tdb, key, hash, F_RDLCK, &rec); ok1(rec_ptr); ok1(rec_ptr > 2U*1024*1024*1024); diff --git a/lib/tdb2/test/run-tdb1-incompatible.c b/lib/tdb2/test/run-tdb1-incompatible.c index a2754461e2..58e1fba1fa 100644 --- a/lib/tdb2/test/run-tdb1-incompatible.c +++ b/lib/tdb2/test/run-tdb1-incompatible.c @@ -3,9 +3,10 @@ #include <stdlib.h> #include <err.h> -static unsigned int tdb1_dumb_hash(TDB_DATA *key) +static uint64_t tdb1_dumb_hash(const void *key, size_t len, uint64_t seed, + void *unused) { - return key->dsize; + return len; } static void log_fn(struct tdb1_context *tdb, enum tdb_log_level level, @@ -31,14 +32,16 @@ static unsigned int hdr_rwlocks(const char *fname) return hdr.rwlocks; } -static unsigned int jenkins_hashfn(TDB_DATA *key) +static uint64_t jenkins_hashfn(const void *key, size_t len, uint64_t seed, + void *unused) { - return hashlittle(key->dptr, key->dsize); + return hashlittle(key, len); } -static unsigned int old_hash(TDB_DATA *key) +static uint64_t old_hash(const void *key, size_t len, uint64_t seed, + void *unused) { - return tdb1_old_hash(key); + return tdb1_old_hash(key, len, seed, unused); } int main(int argc, char *argv[]) diff --git a/lib/tdb2/test/run-tdb1-wronghash-fail.c b/lib/tdb2/test/run-tdb1-wronghash-fail.c index 97a8293e7d..42bc6c02f4 100644 --- a/lib/tdb2/test/run-tdb1-wronghash-fail.c +++ b/lib/tdb2/test/run-tdb1-wronghash-fail.c @@ -11,16 +11,18 @@ static void log_fn(struct tdb1_context *tdb, enum tdb_log_level level, (*count)++; } -static unsigned int jenkins_hashfn(TDB_DATA *key) +static uint64_t jenkins_hashfn(const void *key, size_t len, uint64_t seed, + void *unused) { - return hashlittle(key->dptr, key->dsize); + return hashlittle(key, len); } /* the tdb1_old_hash function is "magic" as it automatically makes us test the * tdb1_incompatible_hash as well, so use this wrapper. */ -static unsigned int old_hash(TDB_DATA *key) +static uint64_t old_hash(const void *key, size_t len, uint64_t seed, + void *unused) { - return tdb1_old_hash(key); + return tdb1_old_hash(key, len, seed, unused); } int main(int argc, char *argv[]) |