subunit: Support formatting compatible with upstream subunit, for consistency.
[sfrench/samba-autobuild/.git] / source4 / torture / locktest.c
index 18c4156cc345d425e1b6325a20b0e477afd37b58..b3ee8fc28f9d47b8105d4f35fd7bf1074a29f9d0 100644 (file)
@@ -26,7 +26,6 @@
 #include "auth/gensec/gensec.h"
 #include "libcli/libcli.h"
 #include "param/param.h"
-#include "dynconfig/dynconfig.h"
 #include "libcli/resolve/resolve.h"
 
 static int numops = 1000;
@@ -34,9 +33,9 @@ static int showall;
 static int analyze;
 static int hide_unlock_fails;
 static int use_oplocks;
-static uint_t lock_range = 100;
-static uint_t lock_base = 0;
-static uint_t min_length = 0;
+static unsigned int lock_range = 100;
+static unsigned int lock_base = 0;
+static unsigned int min_length = 0;
 static int exact_error_codes;
 static int zero_zero;
 
@@ -107,7 +106,7 @@ static struct record *recorded;
 /***************************************************** 
 return a connection to a server
 *******************************************************/
-static struct smbcli_state *connect_one(struct event_context *ev,
+static struct smbcli_state *connect_one(struct tevent_context *ev,
                                        struct loadparm_context *lp_ctx,
                                        TALLOC_CTX *mem_ctx,
                                        char *share, int snum, int conn)
@@ -183,7 +182,7 @@ static struct smbcli_state *connect_one(struct event_context *ev,
 }
 
 
-static void reconnect(struct event_context *ev,
+static void reconnect(struct tevent_context *ev,
                      struct loadparm_context *lp_ctx,
                          TALLOC_CTX *mem_ctx,
                      struct smbcli_state *cli[NSERVERS][NCONNECTIONS], int fnum[NSERVERS][NCONNECTIONS][NFILES],
@@ -217,8 +216,8 @@ static bool test_one(struct smbcli_state *cli[NSERVERS][NCONNECTIONS],
                     int fnum[NSERVERS][NCONNECTIONS][NFILES],
                     struct record *rec)
 {
-       uint_t conn = rec->conn;
-       uint_t f = rec->f;
+       unsigned int conn = rec->conn;
+       unsigned int f = rec->f;
        uint64_t start = rec->start;
        uint64_t len = rec->len;
        enum brl_type op = rec->lock_type;
@@ -386,7 +385,7 @@ static int retest(struct smbcli_state *cli[NSERVERS][NCONNECTIONS],
                   int n)
 {
        int i;
-       printf("testing %u ...\n", n);
+       printf("Testing %u ...\n", n);
        for (i=0; i<n; i++) {
                if (i && i % 100 == 0) {
                        printf("%u\n", i);
@@ -405,7 +404,7 @@ static int retest(struct smbcli_state *cli[NSERVERS][NCONNECTIONS],
    we then do random locking ops in tamdem on the 4 fnums from each
    server and ensure that the results match
  */
-static int test_locks(struct event_context *ev,
+static int test_locks(struct tevent_context *ev,
                      struct loadparm_context *lp_ctx,
                          TALLOC_CTX *mem_ctx,
                      char *share[NSERVERS])
@@ -427,7 +426,7 @@ static int test_locks(struct event_context *ev,
 #endif
                        recorded[n].conn = random() % NCONNECTIONS;
                        recorded[n].f = random() % NFILES;
-                       recorded[n].start = lock_base + ((uint_t)random() % (lock_range-1));
+                       recorded[n].start = lock_base + ((unsigned int)random() % (lock_range-1));
                        recorded[n].len =  min_length +
                                random() % (lock_range-(recorded[n].start-lock_base));
                        recorded[n].start *= RANGE_MULTIPLE;
@@ -555,7 +554,7 @@ static void usage(poptContext pc)
        int opt;
        int seed, server;
        int username_count=0;
-       struct event_context *ev;
+       struct tevent_context *ev;
        struct loadparm_context *lp_ctx;
        poptContext pc;
        int argc_new, i;