summaryrefslogtreecommitdiff
path: root/lib/tdb/test
diff options
context:
space:
mode:
Diffstat (limited to 'lib/tdb/test')
-rw-r--r--lib/tdb/test/lock-tracking.c2
-rw-r--r--lib/tdb/test/run-3G-file.c4
-rw-r--r--lib/tdb/test/run-nested-transactions.c7
-rw-r--r--lib/tdb/test/run-open-during-transaction.c4
-rw-r--r--lib/tdb/test/run-transaction-expand.c12
5 files changed, 16 insertions, 13 deletions
diff --git a/lib/tdb/test/lock-tracking.c b/lib/tdb/test/lock-tracking.c
index e66dae75cd..b6f1cc27d0 100644
--- a/lib/tdb/test/lock-tracking.c
+++ b/lib/tdb/test/lock-tracking.c
@@ -1,10 +1,10 @@
/* We save the locks so we can reaquire them. */
+#include "../common/tdb_private.h"
#include <unistd.h>
#include <fcntl.h>
#include <stdarg.h>
#include <stdlib.h>
#include "tap-interface.h"
-#include "../common/tdb_private.h"
#include "lock-tracking.h"
struct lock {
diff --git a/lib/tdb/test/run-3G-file.c b/lib/tdb/test/run-3G-file.c
index ba85d1473e..5ea4fcfbde 100644
--- a/lib/tdb/test/run-3G-file.c
+++ b/lib/tdb/test/run-3G-file.c
@@ -81,8 +81,8 @@ int main(int argc, char *argv[])
ok1(tdb);
tdb->methods = &large_io_methods;
- /* Enlarge the file (internally multiplies by 100). */
- ok1(tdb_expand(tdb, 30000000) == 0);
+ /* Enlarge the file (internally multiplies by 2). */
+ ok1(tdb_expand(tdb, 1500000000) == 0);
/* Put an entry in, and check it. */
key.dsize = strlen("hi");
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);
diff --git a/lib/tdb/test/run-open-during-transaction.c b/lib/tdb/test/run-open-during-transaction.c
index bd6e33d563..f4a00525d8 100644
--- a/lib/tdb/test/run-open-during-transaction.c
+++ b/lib/tdb/test/run-open-during-transaction.c
@@ -1,5 +1,4 @@
-#define _XOPEN_SOURCE 500
-#include <unistd.h>
+#include "../common/tdb_private.h"
#include "lock-tracking.h"
static ssize_t pwrite_check(int fd, const void *buf, size_t count, off_t offset);
@@ -11,7 +10,6 @@ static int ftruncate_check(int fd, off_t length);
#define fcntl fcntl_with_lockcheck
#define ftruncate ftruncate_check
-#include "../common/tdb_private.h"
#include "../common/io.c"
#include "../common/tdb.c"
#include "../common/lock.c"
diff --git a/lib/tdb/test/run-transaction-expand.c b/lib/tdb/test/run-transaction-expand.c
index e43eec412b..3b79dbb6ea 100644
--- a/lib/tdb/test/run-transaction-expand.c
+++ b/lib/tdb/test/run-transaction-expand.c
@@ -1,6 +1,3 @@
-/* We need this otherwise fcntl locking fails. */
-#define _FILE_OFFSET_BITS 64
-#define _XOPEN_SOURCE 500
#include "../common/tdb_private.h"
/* Speed up the tests: setting TDB_NOSYNC removed recovery altogether. */
@@ -18,7 +15,14 @@ static inline int fake_msync(void *addr, size_t length, int flags)
#define msync fake_msync
#endif
-#include "../common/tdb_private.h"
+#ifdef HAVE_FDATASYNC
+static inline int fake_fdatasync(int fd)
+{
+ return 0;
+}
+#define fdatasync fake_fdatasync
+#endif
+
#include "../common/io.c"
#include "../common/tdb.c"
#include "../common/lock.c"