diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2012-02-14 14:45:21 +1030 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2012-02-14 14:45:21 +1030 |
commit | 205242e1769f96e0e8fccd52378965d35dd02093 (patch) | |
tree | 5bce8a0d01f0f6dd2360b93033934d27a93d9eef /lib/tdb/test/run-nested-transactions.c | |
parent | 8fa345d952328c5866f3a0f835f3599343c51b00 (diff) | |
download | samba-205242e1769f96e0e8fccd52378965d35dd02093.tar.gz samba-205242e1769f96e0e8fccd52378965d35dd02093.tar.xz samba-205242e1769f96e0e8fccd52378965d35dd02093.zip |
tdb/test: fix up tests for use in SAMBA tdb code.
1) Make sure we include "tdb_private.h" first, to get the right headers
(esp. the correct setting of _FILE_OFFSET_BITS before unistd.h).
2) Fix 3G file test since expand logic has changed.
3) Fix nested transaction test, since default is to allow nesting.
4) Capture fdatasync, which was slowing down transaction expand.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'lib/tdb/test/run-nested-transactions.c')
-rw-r--r-- | lib/tdb/test/run-nested-transactions.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/tdb/test/run-nested-transactions.c b/lib/tdb/test/run-nested-transactions.c index 7c83846c2e..c4765def34 100644 --- a/lib/tdb/test/run-nested-transactions.c +++ b/lib/tdb/test/run-nested-transactions.c @@ -26,11 +26,11 @@ int main(int argc, char *argv[]) key.dptr = (void *)"hi"; tdb = tdb_open_ex("run-nested-transactions.tdb", - 1024, TDB_CLEAR_IF_FIRST, + 1024, TDB_CLEAR_IF_FIRST|TDB_DISALLOW_NESTING, O_CREAT|O_TRUNC|O_RDWR, 0600, &taplogctx, NULL); ok1(tdb); - /* No nesting by default. */ + /* Nesting disallowed. */ ok1(tdb_transaction_start(tdb) == 0); data.dptr = (void *)"world"; data.dsize = strlen("world"); @@ -53,8 +53,9 @@ int main(int argc, char *argv[]) free(data.dptr); tdb_close(tdb); + /* Nesting allowed by default */ tdb = tdb_open_ex("run-nested-transactions.tdb", - 1024, TDB_ALLOW_NESTING, O_RDWR, 0, &taplogctx, NULL); + 1024, TDB_DEFAULT, O_RDWR, 0, &taplogctx, NULL); ok1(tdb); ok1(tdb_transaction_start(tdb) == 0); |