diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2011-09-14 07:51:13 +0930 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2011-09-14 07:51:13 +0930 |
commit | 02f5b8fef868b7f77f1ac385740328757bff4d93 (patch) | |
tree | 5b3a4c3bb3d001bbcc08a0e9cc6968536a2b7d73 /lib/tdb2/test/run-tdb1.c | |
parent | f68a56ce8f38cc1768d8c2dca84f456f4ecfc625 (diff) | |
download | samba-02f5b8fef868b7f77f1ac385740328757bff4d93.tar.gz samba-02f5b8fef868b7f77f1ac385740328757bff4d93.tar.bz2 samba-02f5b8fef868b7f77f1ac385740328757bff4d93.zip |
tdb2: unify tdb1_fetch into tdb_fetch
Switch on the TDB_VERSION1 flag.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(Imported from CCAN commit 08c05da588018c6b76834e57b66d525546643708)
Diffstat (limited to 'lib/tdb2/test/run-tdb1.c')
-rw-r--r-- | lib/tdb2/test/run-tdb1.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/tdb2/test/run-tdb1.c b/lib/tdb2/test/run-tdb1.c index 584d7d6504..dca6473b1c 100644 --- a/lib/tdb2/test/run-tdb1.c +++ b/lib/tdb2/test/run-tdb1.c @@ -14,7 +14,7 @@ int main(int argc, char *argv[]) hsize.base.next = &tap_log_attr; hsize.tdb1_hashsize.hsize = 1024; - plan_tests(8); + plan_tests(9); tdb = tdb_open("run.tdb1", TDB_VERSION1, O_CREAT|O_TRUNC|O_RDWR, 0600, &hsize); @@ -29,14 +29,13 @@ int main(int argc, char *argv[]) ok1(tdb_store(tdb, key, data, TDB_INSERT) == TDB_ERR_EXISTS); ok1(tdb_store(tdb, key, data, TDB_MODIFY) == TDB_SUCCESS); - data = tdb1_fetch(tdb, key); + ok1(tdb_fetch(tdb, key, &data) == TDB_SUCCESS); ok1(data.dsize == strlen("world")); ok1(memcmp(data.dptr, "world", strlen("world")) == 0); free(data.dptr); key.dsize++; - data = tdb1_fetch(tdb, key); - ok1(data.dptr == NULL); + ok1(tdb_fetch(tdb, key, &data) == TDB_ERR_NOEXIST); tdb_close(tdb); return exit_status(); |