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:06 +0200 |
commit | 16cc345d4f84367e70e133200f7aa335c2aae8c6 (patch) | |
tree | 955a33c25c19f3127e24ba6b0e108da6b1f7f804 /lib/tdb2/test/run-50-multiple-freelists.c | |
parent | 76758b9767fad45ff144bbfef3ab84bca5d4650e (diff) | |
download | samba-16cc345d4f84367e70e133200f7aa335c2aae8c6.tar.gz samba-16cc345d4f84367e70e133200f7aa335c2aae8c6.tar.bz2 samba-16cc345d4f84367e70e133200f7aa335c2aae8c6.zip |
TDB2: Goodbye TDB2, Hello NTDB.
This renames everything from tdb2 to ntdb: importantly, we no longer
use the tdb_ namespace, so you can link against both ntdb and tdb if
you want to.
This also enables building of standalone ntdb by the autobuild script.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'lib/tdb2/test/run-50-multiple-freelists.c')
-rw-r--r-- | lib/tdb2/test/run-50-multiple-freelists.c | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/lib/tdb2/test/run-50-multiple-freelists.c b/lib/tdb2/test/run-50-multiple-freelists.c deleted file mode 100644 index b102876c8d..0000000000 --- a/lib/tdb2/test/run-50-multiple-freelists.c +++ /dev/null @@ -1,70 +0,0 @@ -#include "tdb2-source.h" -#include "tap-interface.h" -#include "logging.h" -#include "layout.h" - -int main(int argc, char *argv[]) -{ - tdb_off_t off; - struct tdb_context *tdb; - struct tdb_layout *layout; - TDB_DATA key, data; - union tdb_attribute seed; - - /* This seed value previously tickled a layout.c bug. */ - seed.base.attr = TDB_ATTRIBUTE_SEED; - seed.seed.seed = 0xb1142bc054d035b4ULL; - seed.base.next = &tap_log_attr; - - plan_tests(11); - key = tdb_mkdata("Hello", 5); - data = tdb_mkdata("world", 5); - - /* Create a TDB with three free tables. */ - layout = new_tdb_layout(); - tdb_layout_add_freetable(layout); - tdb_layout_add_freetable(layout); - tdb_layout_add_freetable(layout); - tdb_layout_add_free(layout, 80, 0); - /* Used record prevent coalescing. */ - tdb_layout_add_used(layout, key, data, 6); - tdb_layout_add_free(layout, 160, 1); - key.dsize--; - tdb_layout_add_used(layout, key, data, 7); - tdb_layout_add_free(layout, 320, 2); - key.dsize--; - tdb_layout_add_used(layout, key, data, 8); - tdb_layout_add_free(layout, 40, 0); - tdb = tdb_layout_get(layout, free, &seed); - ok1(tdb_check(tdb, NULL, NULL) == 0); - - 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->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->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->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->ftable_off == layout->elem[0].base.off); - - /* Now we fail. */ - off = get_free(tdb, 0, 0, 1, TDB_USED_MAGIC, 0); - ok1(off == 0); - - tdb_close(tdb); - tdb_layout_free(layout); - - ok1(tap_log_messages == 0); - return exit_status(); -} |