diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2012-06-18 22:30:26 +0930 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2012-06-19 05:38:05 +0200 |
commit | c3dcdf08f3472748c9e7984488398064abcd454a (patch) | |
tree | 3c7ea8afbb00cfae914bd7011d0a4b1321764133 /lib/tdb2/test | |
parent | cab6e116786641e28747de3f70c8cd89ba17673f (diff) | |
download | samba-c3dcdf08f3472748c9e7984488398064abcd454a.tar.gz samba-c3dcdf08f3472748c9e7984488398064abcd454a.tar.bz2 samba-c3dcdf08f3472748c9e7984488398064abcd454a.zip |
TDB2: more internal cleanups after TDB1 compatibility removal.
This eliminates the separate tdb2 substructure, and makes some
tdb1-required functions static.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'lib/tdb2/test')
-rw-r--r-- | lib/tdb2/test/helprun-layout.c | 6 | ||||
-rw-r--r-- | lib/tdb2/test/run-03-coalesce.c | 10 | ||||
-rw-r--r-- | lib/tdb2/test/run-04-basichash.c | 8 | ||||
-rw-r--r-- | lib/tdb2/test/run-30-exhaust-before-expand.c | 2 | ||||
-rw-r--r-- | lib/tdb2/test/run-50-multiple-freelists.c | 8 |
5 files changed, 17 insertions, 17 deletions
diff --git a/lib/tdb2/test/helprun-layout.c b/lib/tdb2/test/helprun-layout.c index 3e56d0ed7a..b9cd4a6432 100644 --- a/lib/tdb2/test/helprun-layout.c +++ b/lib/tdb2/test/helprun-layout.c @@ -191,8 +191,8 @@ static void add_to_freetable(struct tdb_context *tdb, unsigned ftable, struct tle_freetable *freetable) { - tdb->tdb2.ftable_off = freetable->base.off; - tdb->tdb2.ftable = ftable; + tdb->ftable_off = freetable->base.off; + tdb->ftable = ftable; add_free_record(tdb, eoff, sizeof(struct tdb_used_record) + elen, TDB_LOCK_WAIT, false); } @@ -367,7 +367,7 @@ struct tdb_context *tdb_layout_get(struct tdb_layout *layout, } } - tdb->tdb2.ftable_off = find_ftable(layout, 0)->base.off; + tdb->ftable_off = find_ftable(layout, 0)->base.off; return tdb; } diff --git a/lib/tdb2/test/run-03-coalesce.c b/lib/tdb2/test/run-03-coalesce.c index ad39719bcb..ecc469fa32 100644 --- a/lib/tdb2/test/run-03-coalesce.c +++ b/lib/tdb2/test/run-03-coalesce.c @@ -44,7 +44,7 @@ int main(int argc, char *argv[]) ok1(free_record_length(tdb, layout->elem[1].base.off) == len); /* Figure out which bucket free entry is. */ - b_off = bucket_off(tdb->tdb2.ftable_off, size_to_bucket(len)); + b_off = bucket_off(tdb->ftable_off, size_to_bucket(len)); /* Lock and fail to coalesce. */ ok1(tdb_lock_free_bucket(tdb, b_off, TDB_LOCK_WAIT) == 0); test = layout->elem[1].base.off; @@ -70,7 +70,7 @@ int main(int argc, char *argv[]) ok1(tdb_check(tdb, NULL, NULL) == 0); /* Figure out which bucket free entry is. */ - b_off = bucket_off(tdb->tdb2.ftable_off, size_to_bucket(1024)); + b_off = bucket_off(tdb->ftable_off, size_to_bucket(1024)); /* Lock and fail to coalesce. */ ok1(tdb_lock_free_bucket(tdb, b_off, TDB_LOCK_WAIT) == 0); test = layout->elem[1].base.off; @@ -97,7 +97,7 @@ int main(int argc, char *argv[]) ok1(tdb_check(tdb, NULL, NULL) == 0); /* Figure out which bucket (first) free entry is. */ - b_off = bucket_off(tdb->tdb2.ftable_off, size_to_bucket(1024)); + b_off = bucket_off(tdb->ftable_off, size_to_bucket(1024)); /* Lock and coalesce. */ ok1(tdb_lock_free_bucket(tdb, b_off, TDB_LOCK_WAIT) == 0); test = layout->elem[2].base.off; @@ -127,7 +127,7 @@ int main(int argc, char *argv[]) ok1(tdb_check(tdb, NULL, NULL) == 0); /* Figure out which bucket free entry is. */ - b_off = bucket_off(tdb->tdb2.ftable_off, size_to_bucket(1024)); + b_off = bucket_off(tdb->ftable_off, size_to_bucket(1024)); /* Lock and coalesce. */ ok1(tdb_lock_free_bucket(tdb, b_off, TDB_LOCK_WAIT) == 0); test = layout->elem[2].base.off; @@ -157,7 +157,7 @@ int main(int argc, char *argv[]) ok1(tdb_check(tdb, NULL, NULL) == 0); /* Figure out which bucket free entry is. */ - b_off = bucket_off(tdb->tdb2.ftable_off, size_to_bucket(1024)); + b_off = bucket_off(tdb->ftable_off, size_to_bucket(1024)); /* Lock and coalesce. */ ok1(tdb_lock_free_bucket(tdb, b_off, TDB_LOCK_WAIT) == 0); test = layout->elem[2].base.off; diff --git a/lib/tdb2/test/run-04-basichash.c b/lib/tdb2/test/run-04-basichash.c index 9ab45ad978..dc75fc72dc 100644 --- a/lib/tdb2/test/run-04-basichash.c +++ b/lib/tdb2/test/run-04-basichash.c @@ -68,9 +68,9 @@ int main(int argc, char *argv[]) /* Make sure we fill it in for later finding. */ off = new_off + sizeof(struct tdb_used_record); - ok1(!tdb->tdb2.io->twrite(tdb, off, key.dptr, key.dsize)); + ok1(!tdb->io->twrite(tdb, off, key.dptr, key.dsize)); off += key.dsize; - ok1(!tdb->tdb2.io->twrite(tdb, off, dbuf.dptr, dbuf.dsize)); + ok1(!tdb->io->twrite(tdb, off, dbuf.dptr, dbuf.dsize)); /* We should be able to unlock that OK. */ ok1(tdb_unlock_hashes(tdb, h.hlock_start, h.hlock_range, @@ -228,9 +228,9 @@ int main(int argc, char *argv[]) /* Make sure we fill it in for later finding. */ off = new_off + sizeof(struct tdb_used_record); - ok1(!tdb->tdb2.io->twrite(tdb, off, key.dptr, key.dsize)); + ok1(!tdb->io->twrite(tdb, off, key.dptr, key.dsize)); off += key.dsize; - ok1(!tdb->tdb2.io->twrite(tdb, off, dbuf.dptr, dbuf.dsize)); + ok1(!tdb->io->twrite(tdb, off, dbuf.dptr, dbuf.dsize)); /* We should be able to unlock that OK. */ ok1(tdb_unlock_hashes(tdb, h.hlock_start, h.hlock_range, diff --git a/lib/tdb2/test/run-30-exhaust-before-expand.c b/lib/tdb2/test/run-30-exhaust-before-expand.c index c39f0591f0..13bb9461d4 100644 --- a/lib/tdb2/test/run-30-exhaust-before-expand.c +++ b/lib/tdb2/test/run-30-exhaust-before-expand.c @@ -8,7 +8,7 @@ static bool empty_freetable(struct tdb_context *tdb) unsigned int i; /* Now, free table should be completely exhausted in zone 0 */ - if (tdb_read_convert(tdb, tdb->tdb2.ftable_off, &ftab, sizeof(ftab)) != 0) + if (tdb_read_convert(tdb, tdb->ftable_off, &ftab, sizeof(ftab)) != 0) abort(); for (i = 0; i < sizeof(ftab.buckets)/sizeof(ftab.buckets[0]); i++) { diff --git a/lib/tdb2/test/run-50-multiple-freelists.c b/lib/tdb2/test/run-50-multiple-freelists.c index 617b1e4dd4..b102876c8d 100644 --- a/lib/tdb2/test/run-50-multiple-freelists.c +++ b/lib/tdb2/test/run-50-multiple-freelists.c @@ -41,22 +41,22 @@ int main(int argc, char *argv[]) off = get_free(tdb, 0, 80 - sizeof(struct tdb_used_record), 0, TDB_USED_MAGIC, 0); ok1(off == layout->elem[3].base.off); - ok1(tdb->tdb2.ftable_off == layout->elem[0].base.off); + ok1(tdb->ftable_off == layout->elem[0].base.off); off = get_free(tdb, 0, 160 - sizeof(struct tdb_used_record), 0, TDB_USED_MAGIC, 0); ok1(off == layout->elem[5].base.off); - ok1(tdb->tdb2.ftable_off == layout->elem[1].base.off); + ok1(tdb->ftable_off == layout->elem[1].base.off); off = get_free(tdb, 0, 320 - sizeof(struct tdb_used_record), 0, TDB_USED_MAGIC, 0); ok1(off == layout->elem[7].base.off); - ok1(tdb->tdb2.ftable_off == layout->elem[2].base.off); + ok1(tdb->ftable_off == layout->elem[2].base.off); off = get_free(tdb, 0, 40 - sizeof(struct tdb_used_record), 0, TDB_USED_MAGIC, 0); ok1(off == layout->elem[9].base.off); - ok1(tdb->tdb2.ftable_off == layout->elem[0].base.off); + ok1(tdb->ftable_off == layout->elem[0].base.off); /* Now we fail. */ off = get_free(tdb, 0, 0, 1, TDB_USED_MAGIC, 0); |