summaryrefslogtreecommitdiff
path: root/source4/torture/local/dbspeed.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/torture/local/dbspeed.c')
-rw-r--r--source4/torture/local/dbspeed.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/source4/torture/local/dbspeed.c b/source4/torture/local/dbspeed.c
index 2a9eb49d01..3445812365 100644
--- a/source4/torture/local/dbspeed.c
+++ b/source4/torture/local/dbspeed.c
@@ -26,10 +26,12 @@
#include "lib/ldb/include/ldb_errors.h"
#include "lib/db_wrap.h"
#include "torture/torture.h"
+#include "param/param.h"
float tdb_speed;
-static BOOL tdb_add_record(struct tdb_wrap *tdbw, const char *fmt1, const char *fmt2, int i)
+static bool tdb_add_record(struct tdb_wrap *tdbw, const char *fmt1,
+ const char *fmt2, int i)
{
TDB_DATA key, data;
int ret;
@@ -48,7 +50,7 @@ static BOOL tdb_add_record(struct tdb_wrap *tdbw, const char *fmt1, const char *
/*
test tdb speed
*/
-static BOOL test_tdb_speed(struct torture_context *torture, const void *_data)
+static bool test_tdb_speed(struct torture_context *torture, const void *_data)
{
struct timeval tv;
struct tdb_wrap *tdbw;
@@ -118,32 +120,32 @@ static BOOL test_tdb_speed(struct torture_context *torture, const void *_data)
unlink("test.tdb");
talloc_free(tmp_ctx);
- return True;
+ return true;
failed:
unlink("test.tdb");
talloc_free(tmp_ctx);
- return False;
+ return false;
}
-static BOOL ldb_add_record(struct ldb_context *ldb, unsigned rid)
+static bool ldb_add_record(struct ldb_context *ldb, unsigned rid)
{
struct ldb_message *msg;
int ret;
msg = ldb_msg_new(ldb);
if (msg == NULL) {
- return False;
+ return false;
}
msg->dn = ldb_dn_new_fmt(msg, ldb, "SID=S-1-5-21-53173311-3623041448-2049097239-%u", rid);
if (msg->dn == NULL) {
- return False;
+ return false;
}
if (ldb_msg_add_fmt(msg, "UID", "%u", rid) != 0) {
- return False;
+ return false;
}
ret = ldb_add(ldb, msg);
@@ -157,7 +159,7 @@ static BOOL ldb_add_record(struct ldb_context *ldb, unsigned rid)
/*
test ldb speed
*/
-static BOOL test_ldb_speed(struct torture_context *torture, const void *_data)
+static bool test_ldb_speed(struct torture_context *torture, const void *_data)
{
struct timeval tv;
struct ldb_context *ldb;
@@ -173,7 +175,7 @@ static BOOL test_ldb_speed(struct torture_context *torture, const void *_data)
torture_comment(torture, "Testing ldb speed for sidmap\n");
- ldb = ldb_wrap_connect(tmp_ctx, "tdb://test.ldb",
+ ldb = ldb_wrap_connect(tmp_ctx, global_loadparm, "tdb://test.ldb",
NULL, NULL, LDB_FLG_NOSYNC, NULL);
if (!ldb) {
unlink("./test.ldb");
@@ -239,12 +241,12 @@ static BOOL test_ldb_speed(struct torture_context *torture, const void *_data)
unlink("./test.ldb");
talloc_free(tmp_ctx);
- return True;
+ return true;
failed:
unlink("./test.ldb");
talloc_free(tmp_ctx);
- return False;
+ return false;
}
struct torture_suite *torture_local_dbspeed(TALLOC_CTX *mem_ctx)