From 1b9317381344c48be2d90353ba61490161615485 Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Wed, 2 Mar 2011 22:28:27 +0100 Subject: ldb:ldb tools - ldbtest - convert other result values to LDB codes as well I've forgotten this in my first patchset. Reviewed by: Tridge --- source4/lib/ldb/tools/ldbtest.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'source4') diff --git a/source4/lib/ldb/tools/ldbtest.c b/source4/lib/ldb/tools/ldbtest.c index 28c0674fdf..15c1e8b61e 100644 --- a/source4/lib/ldb/tools/ldbtest.c +++ b/source4/lib/ldb/tools/ldbtest.c @@ -66,7 +66,7 @@ static void add_records(struct ldb_context *ldb, #if 0 if (ldb_lock(ldb, "transaction") != 0) { printf("transaction lock failed\n"); - exit(1); + exit(LDB_ERR_OPERATIONS_ERROR); } #endif for (i=0;icount != 1)) { printf("Failed to find %s - %s\n", expr, ldb_errstring(ldb)); - exit(1); + exit(LDB_ERR_OPERATIONS_ERROR); } if (uid >= nrecords && res->count > 0) { printf("Found %s !? - %d\n", expr, ret); - exit(1); + exit(LDB_ERR_OPERATIONS_ERROR); } printf("Testing uid %d/%d - %d \r", i, uid, res->count); @@ -265,7 +265,7 @@ static void start_test(struct ldb_context *ldb, unsigned int nrecords, basedn = ldb_dn_new(ldb, ldb, options->basedn); if ( ! ldb_dn_validate(basedn)) { printf("Invalid base DN\n"); - exit(1); + exit(LDB_ERR_OPERATIONS_ERROR); } printf("Adding %d records\n", nrecords); @@ -330,7 +330,7 @@ static void start_test_index(struct ldb_context **ldb) if (ldb_add(*ldb, msg) != 0) { printf("Add of %s failed - %s\n", ldb_dn_get_linearized(msg->dn), ldb_errstring(*ldb)); - exit(1); + exit(LDB_ERR_OPERATIONS_ERROR); } basedn = ldb_dn_new(*ldb, *ldb, options->basedn); @@ -345,12 +345,12 @@ static void start_test_index(struct ldb_context **ldb) if (ldb_add(*ldb, msg) != 0) { printf("Add of %s failed - %s\n", ldb_dn_get_linearized(msg->dn), ldb_errstring(*ldb)); - exit(1); + exit(LDB_ERR_OPERATIONS_ERROR); } if (talloc_free(*ldb) != 0) { printf("failed to free/close ldb database"); - exit(1); + exit(LDB_ERR_OPERATIONS_ERROR); } (*ldb) = ldb_init(options, NULL); @@ -358,7 +358,7 @@ static void start_test_index(struct ldb_context **ldb) ret = ldb_connect(*ldb, options->url, flags, NULL); if (ret != 0) { printf("failed to connect to %s\n", options->url); - exit(1); + exit(LDB_ERR_OPERATIONS_ERROR); } basedn = ldb_dn_new(*ldb, *ldb, options->basedn); @@ -368,11 +368,11 @@ static void start_test_index(struct ldb_context **ldb) ret = ldb_search(*ldb, *ldb, &res, basedn, LDB_SCOPE_SUBTREE, NULL, "uid=test"); if (ret != LDB_SUCCESS) { printf("Search with (uid=test) filter failed!\n"); - exit(1); + exit(LDB_ERR_OPERATIONS_ERROR); } if(res->count != 1) { printf("Should have found 1 record - found %d\n", res->count); - exit(1); + exit(LDB_ERR_OPERATIONS_ERROR); } indexlist = ldb_dn_new(*ldb, *ldb, "@INDEXLIST"); @@ -380,7 +380,7 @@ static void start_test_index(struct ldb_context **ldb) if (ldb_delete(*ldb, msg->dn) != 0 || ldb_delete(*ldb, indexlist) != 0) { printf("cleanup failed - %s\n", ldb_errstring(*ldb)); - exit(1); + exit(LDB_ERR_OPERATIONS_ERROR); } printf("Finished index test\n"); -- cgit