summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2004-06-01 10:12:52 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:56:23 -0500
commit770e3307ce3da928762e15a136c562df86a9c799 (patch)
tree95930ce042b039faad683515a13e1d8413871b5d /source4/torture
parent98d291423ff581786a369ce373c861f94c654aa0 (diff)
downloadsamba-770e3307ce3da928762e15a136c562df86a9c799.tar.gz
samba-770e3307ce3da928762e15a136c562df86a9c799.tar.bz2
samba-770e3307ce3da928762e15a136c562df86a9c799.zip
r962: convert 'unsigned' and 'unsigned int' to uint_t
metze (This used to be commit 57151e80eb1090281401930c8fe25b20a8cf3a38)
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/basic/denytest.c2
-rw-r--r--source4/torture/basic/mangle_test.c6
-rw-r--r--source4/torture/locktest.c12
-rw-r--r--source4/torture/locktest2.c22
-rw-r--r--source4/torture/nbench/nbio.c8
-rw-r--r--source4/torture/raw/qfileinfo.c30
-rw-r--r--source4/torture/raw/read.c12
-rw-r--r--source4/torture/raw/write.c12
-rw-r--r--source4/torture/rpc/lsa.c2
-rw-r--r--source4/torture/torture.c14
10 files changed, 60 insertions, 60 deletions
diff --git a/source4/torture/basic/denytest.c b/source4/torture/basic/denytest.c
index 0e4f5251da..102b44fbd3 100644
--- a/source4/torture/basic/denytest.c
+++ b/source4/torture/basic/denytest.c
@@ -1393,7 +1393,7 @@ static struct {
};
-static void progress_bar(unsigned i, unsigned total)
+static void progress_bar(uint_t i, uint_t total)
{
if (i % 10 != 0) return;
printf("%5d/%5d\r", i, total);
diff --git a/source4/torture/basic/mangle_test.c b/source4/torture/basic/mangle_test.c
index 94dac45b9d..4859ee7c4c 100644
--- a/source4/torture/basic/mangle_test.c
+++ b/source4/torture/basic/mangle_test.c
@@ -24,7 +24,7 @@ static TDB_CONTEXT *tdb;
#define NAME_LENGTH 20
-static unsigned total, collisions, failures;
+static uint_t total, collisions, failures;
static BOOL test_one(struct cli_state *cli, const char *name)
{
@@ -108,8 +108,8 @@ static BOOL test_one(struct cli_state *cli, const char *name)
static void gen_name(char *name)
{
const char *chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz._-$~...";
- unsigned max_idx = strlen(chars);
- unsigned len;
+ uint_t max_idx = strlen(chars);
+ uint_t len;
int i;
char *p;
diff --git a/source4/torture/locktest.c b/source4/torture/locktest.c
index 99dcf9fd47..10238c75a5 100644
--- a/source4/torture/locktest.c
+++ b/source4/torture/locktest.c
@@ -30,9 +30,9 @@ static BOOL showall;
static BOOL analyze;
static BOOL hide_unlock_fails;
static BOOL use_oplocks;
-static unsigned lock_range = 100;
-static unsigned lock_base = 0;
-static unsigned min_length = 0;
+static uint_t lock_range = 100;
+static uint_t lock_base = 0;
+static uint_t min_length = 0;
static BOOL exact_error_codes;
static BOOL zero_zero;
@@ -164,8 +164,8 @@ static BOOL test_one(struct cli_state *cli[NSERVERS][NCONNECTIONS],
int fnum[NSERVERS][NCONNECTIONS][NFILES],
struct record *rec)
{
- unsigned conn = rec->conn;
- unsigned f = rec->f;
+ uint_t conn = rec->conn;
+ uint_t f = rec->f;
uint64_t start = rec->start;
uint64_t len = rec->len;
enum brl_type op = rec->lock_type;
@@ -322,7 +322,7 @@ static void test_locks(char *share[NSERVERS])
#endif
recorded[n].conn = random() % NCONNECTIONS;
recorded[n].f = random() % NFILES;
- recorded[n].start = lock_base + ((unsigned)random() % (lock_range-1));
+ recorded[n].start = lock_base + ((uint_t)random() % (lock_range-1));
recorded[n].len = min_length +
random() % (lock_range-(recorded[n].start-lock_base));
recorded[n].start *= RANGE_MULTIPLE;
diff --git a/source4/torture/locktest2.c b/source4/torture/locktest2.c
index ac48da58b9..40227d2997 100644
--- a/source4/torture/locktest2.c
+++ b/source4/torture/locktest2.c
@@ -54,7 +54,7 @@ static BOOL use_oplocks;
struct record {
char r1, r2;
char conn, f, fstype;
- unsigned start, len;
+ uint_t start, len;
char needed;
};
@@ -91,7 +91,7 @@ static BOOL try_close(struct cli_state *c, int fstype, int fd)
}
static BOOL try_lock(struct cli_state *c, int fstype,
- int fd, unsigned start, unsigned len,
+ int fd, uint_t start, uint_t len,
enum brl_type op)
{
struct flock lock;
@@ -113,7 +113,7 @@ static BOOL try_lock(struct cli_state *c, int fstype,
}
static BOOL try_unlock(struct cli_state *c, int fstype,
- int fd, unsigned start, unsigned len)
+ int fd, uint_t start, uint_t len)
{
struct flock lock;
@@ -224,13 +224,13 @@ static BOOL test_one(struct cli_state *cli[NSERVERS][NCONNECTIONS],
int fnum[NSERVERS][NUMFSTYPES][NCONNECTIONS][NFILES],
struct record *rec)
{
- unsigned conn = rec->conn;
- unsigned f = rec->f;
- unsigned fstype = rec->fstype;
- unsigned start = rec->start;
- unsigned len = rec->len;
- unsigned r1 = rec->r1;
- unsigned r2 = rec->r2;
+ uint_t conn = rec->conn;
+ uint_t f = rec->f;
+ uint_t fstype = rec->fstype;
+ uint_t start = rec->start;
+ uint_t len = rec->len;
+ uint_t r1 = rec->r1;
+ uint_t r2 = rec->r2;
enum brl_type op;
int server;
BOOL ret[NSERVERS];
@@ -377,7 +377,7 @@ static void test_locks(char *share1, char *share2, char *nfspath1, char *nfspath
recorded[n].conn = random() % NCONNECTIONS;
recorded[n].fstype = random() % NUMFSTYPES;
recorded[n].f = random() % NFILES;
- recorded[n].start = LOCKBASE + ((unsigned)random() % (LOCKRANGE-1));
+ recorded[n].start = LOCKBASE + ((uint_t)random() % (LOCKRANGE-1));
recorded[n].len = 1 +
random() % (LOCKRANGE-(recorded[n].start-LOCKBASE));
recorded[n].start *= RANGE_MULTIPLE;
diff --git a/source4/torture/nbench/nbio.c b/source4/torture/nbench/nbio.c
index 9f8c6e6c73..a7a82027a3 100644
--- a/source4/torture/nbench/nbio.c
+++ b/source4/torture/nbench/nbio.c
@@ -207,14 +207,14 @@ void nb_unlink(const char *fname, int attr, NTSTATUS status)
void nb_createx(const char *fname,
- unsigned create_options, unsigned create_disposition, int handle,
+ uint_t create_options, uint_t create_disposition, int handle,
NTSTATUS status)
{
union smb_open io;
uint32_t desired_access;
NTSTATUS ret;
TALLOC_CTX *mem_ctx;
- unsigned flags = 0;
+ uint_t flags = 0;
struct ftable *f;
mem_ctx = talloc_init("raw_open");
@@ -335,7 +335,7 @@ void nb_write(int handle, int offset, int size, int ret_size, NTSTATUS status)
}
-void nb_lockx(int handle, unsigned offset, int size, NTSTATUS status)
+void nb_lockx(int handle, uint_t offset, int size, NTSTATUS status)
{
union smb_lock io;
int i;
@@ -361,7 +361,7 @@ void nb_lockx(int handle, unsigned offset, int size, NTSTATUS status)
check_status("LockX", status, ret);
}
-void nb_unlockx(int handle, unsigned offset, int size, NTSTATUS status)
+void nb_unlockx(int handle, uint_t offset, int size, NTSTATUS status)
{
union smb_lock io;
int i;
diff --git a/source4/torture/raw/qfileinfo.c b/source4/torture/raw/qfileinfo.c
index 26c94b6a09..07fb81e6d9 100644
--- a/source4/torture/raw/qfileinfo.c
+++ b/source4/torture/raw/qfileinfo.c
@@ -23,8 +23,8 @@
static struct {
const char *name;
enum fileinfo_level level;
- unsigned only_paths:1;
- unsigned only_handles:1;
+ uint_t only_paths:1;
+ uint_t only_handles:1;
uint32_t capability_mask;
NTSTATUS fnum_status, fname_status;
union smb_fileinfo fnum_finfo, fname_finfo;
@@ -416,21 +416,21 @@ BOOL torture_raw_qfileinfo(int dummy)
s1 = fnum_find(sname); \
if (s1 && s1->stype.out.tfield != correct_size) { \
printf("(%d) handle %s/%s incorrect - %u should be %u\n", __LINE__, #stype, #tfield, \
- (unsigned)s1->stype.out.tfield, \
- (unsigned)correct_size); \
+ (uint_t)s1->stype.out.tfield, \
+ (uint_t)correct_size); \
ret = False; \
} \
s1 = fname_find(sname); \
if (s1 && s1->stype.out.tfield != correct_size) { \
printf("(%d) path %s/%s incorrect - %u should be %u\n", __LINE__, #stype, #tfield, \
- (unsigned)s1->stype.out.tfield, \
- (unsigned)correct_size); \
+ (uint_t)s1->stype.out.tfield, \
+ (uint_t)correct_size); \
ret = False; \
}} while (0)
s1 = fnum_find("STANDARD_INFO");
correct_size = s1->standard_info.out.size;
- printf("size: %u\n", (unsigned)correct_size);
+ printf("size: %u\n", (uint_t)correct_size);
SIZE_CHECK("GETATTR", getattr, size);
SIZE_CHECK("GETATTRE", getattre, size);
@@ -451,7 +451,7 @@ BOOL torture_raw_qfileinfo(int dummy)
s1 = fnum_find("STANDARD_INFO");
correct_size = s1->standard_info.out.alloc_size;
- printf("alloc_size: %u\n", (unsigned)correct_size);
+ printf("alloc_size: %u\n", (uint_t)correct_size);
SIZE_CHECK("GETATTRE", getattre, alloc_size);
SIZE_CHECK("STANDARD", standard, alloc_size);
@@ -470,21 +470,21 @@ BOOL torture_raw_qfileinfo(int dummy)
s1 = fnum_find(sname); \
if (s1 && s1->stype.out.tfield != correct_attrib) { \
printf("(%d) handle %s/%s incorrect - 0x%x should be 0x%x\n", __LINE__, #stype, #tfield, \
- (unsigned)s1->stype.out.tfield, \
- (unsigned)correct_attrib); \
+ (uint_t)s1->stype.out.tfield, \
+ (uint_t)correct_attrib); \
ret = False; \
} \
s1 = fname_find(sname); \
if (s1 && s1->stype.out.tfield != correct_attrib) { \
printf("(%d) path %s/%s incorrect - 0x%x should be 0x%x\n", __LINE__, #stype, #tfield, \
- (unsigned)s1->stype.out.tfield, \
- (unsigned)correct_attrib); \
+ (uint_t)s1->stype.out.tfield, \
+ (uint_t)correct_attrib); \
ret = False; \
}} while (0)
s1 = fnum_find("BASIC_INFO");
correct_attrib = s1->basic_info.out.attrib;
- printf("attrib: 0x%x\n", (unsigned)correct_attrib);
+ printf("attrib: 0x%x\n", (uint_t)correct_attrib);
ATTRIB_CHECK("GETATTR", getattr, attrib);
ATTRIB_CHECK("GETATTRE", getattre, attrib);
@@ -688,13 +688,13 @@ BOOL torture_raw_qfileinfo(int dummy)
if (s1 && s1->stype.out.tfield != 0) { \
printf("(%d) handle %s/%s unknown != 0 (0x%x)\n", __LINE__, \
#stype, #tfield, \
- (unsigned)s1->stype.out.tfield); \
+ (uint_t)s1->stype.out.tfield); \
} \
s1 = fname_find(sname); \
if (s1 && s1->stype.out.tfield != 0) { \
printf("(%d) path %s/%s unknown != 0 (0x%x)\n", __LINE__, \
#stype, #tfield, \
- (unsigned)s1->stype.out.tfield); \
+ (uint_t)s1->stype.out.tfield); \
}} while (0)
/* now get a bit fancier .... */
diff --git a/source4/torture/raw/read.c b/source4/torture/raw/read.c
index 5e1d055e22..5fba3f1b31 100644
--- a/source4/torture/raw/read.c
+++ b/source4/torture/raw/read.c
@@ -48,7 +48,7 @@
/*
setup a random buffer based on a seed
*/
-static void setup_buffer(char *buf, unsigned seed, int len)
+static void setup_buffer(char *buf, uint_t seed, int len)
{
int i;
srandom(seed);
@@ -58,7 +58,7 @@ static void setup_buffer(char *buf, unsigned seed, int len)
/*
check a random buffer based on a seed
*/
-static BOOL check_buffer(char *buf, unsigned seed, int len, int line)
+static BOOL check_buffer(char *buf, uint_t seed, int len, int line)
{
int i;
srandom(seed);
@@ -86,7 +86,7 @@ static BOOL test_read(struct cli_state *cli, TALLOC_CTX *mem_ctx)
const int maxsize = 90000;
const char *fname = BASEDIR "\\test.txt";
const char *test_data = "TEST DATA";
- unsigned seed = time(NULL);
+ uint_t seed = time(NULL);
buf = talloc_zero(mem_ctx, maxsize);
@@ -212,7 +212,7 @@ static BOOL test_lockread(struct cli_state *cli, TALLOC_CTX *mem_ctx)
const int maxsize = 90000;
const char *fname = BASEDIR "\\test.txt";
const char *test_data = "TEST DATA";
- unsigned seed = time(NULL);
+ uint_t seed = time(NULL);
buf = talloc_zero(mem_ctx, maxsize);
@@ -355,7 +355,7 @@ static BOOL test_readx(struct cli_state *cli, TALLOC_CTX *mem_ctx)
const int maxsize = 90000;
const char *fname = BASEDIR "\\test.txt";
const char *test_data = "TEST DATA";
- unsigned seed = time(NULL);
+ uint_t seed = time(NULL);
buf = talloc_zero(mem_ctx, maxsize);
@@ -540,7 +540,7 @@ static BOOL test_readbraw(struct cli_state *cli, TALLOC_CTX *mem_ctx)
const int maxsize = 90000;
const char *fname = BASEDIR "\\test.txt";
const char *test_data = "TEST DATA";
- unsigned seed = time(NULL);
+ uint_t seed = time(NULL);
buf = talloc_zero(mem_ctx, maxsize);
diff --git a/source4/torture/raw/write.c b/source4/torture/raw/write.c
index 18c992b8c6..8873ca5ae8 100644
--- a/source4/torture/raw/write.c
+++ b/source4/torture/raw/write.c
@@ -61,7 +61,7 @@
/*
setup a random buffer based on a seed
*/
-static void setup_buffer(char *buf, unsigned seed, int len)
+static void setup_buffer(char *buf, uint_t seed, int len)
{
int i;
srandom(seed);
@@ -71,7 +71,7 @@ static void setup_buffer(char *buf, unsigned seed, int len)
/*
check a random buffer based on a seed
*/
-static BOOL check_buffer(char *buf, unsigned seed, int len, int line)
+static BOOL check_buffer(char *buf, uint_t seed, int len, int line)
{
int i;
srandom(seed);
@@ -98,7 +98,7 @@ static BOOL test_write(struct cli_state *cli, TALLOC_CTX *mem_ctx)
char *buf;
const int maxsize = 90000;
const char *fname = BASEDIR "\\test.txt";
- unsigned seed = time(NULL);
+ uint_t seed = time(NULL);
union smb_fileinfo finfo;
buf = talloc_zero(mem_ctx, maxsize);
@@ -217,7 +217,7 @@ static BOOL test_writex(struct cli_state *cli, TALLOC_CTX *mem_ctx)
char *buf;
const int maxsize = 90000;
const char *fname = BASEDIR "\\test.txt";
- unsigned seed = time(NULL);
+ uint_t seed = time(NULL);
union smb_fileinfo finfo;
buf = talloc_zero(mem_ctx, maxsize);
@@ -391,7 +391,7 @@ static BOOL test_writeunlock(struct cli_state *cli, TALLOC_CTX *mem_ctx)
char *buf;
const int maxsize = 90000;
const char *fname = BASEDIR "\\test.txt";
- unsigned seed = time(NULL);
+ uint_t seed = time(NULL);
union smb_fileinfo finfo;
buf = talloc_zero(mem_ctx, maxsize);
@@ -530,7 +530,7 @@ static BOOL test_writeclose(struct cli_state *cli, TALLOC_CTX *mem_ctx)
char *buf;
const int maxsize = 90000;
const char *fname = BASEDIR "\\test.txt";
- unsigned seed = time(NULL);
+ uint_t seed = time(NULL);
union smb_fileinfo finfo;
buf = talloc_zero(mem_ctx, maxsize);
diff --git a/source4/torture/rpc/lsa.c b/source4/torture/rpc/lsa.c
index 7dfa2494b7..e3c603da17 100644
--- a/source4/torture/rpc/lsa.c
+++ b/source4/torture/rpc/lsa.c
@@ -343,7 +343,7 @@ static BOOL test_CreateSecret(struct dcerpc_pipe *p,
printf("Testing CreateSecret\n");
- asprintf(&secname, "torturesecret-%u", (unsigned)random());
+ asprintf(&secname, "torturesecret-%u", (uint_t)random());
init_lsa_Name(&r.in.name, secname);
diff --git a/source4/torture/torture.c b/source4/torture/torture.c
index aadc07781a..fbe0fd5097 100644
--- a/source4/torture/torture.c
+++ b/source4/torture/torture.c
@@ -237,7 +237,7 @@ static BOOL rw_torture(struct cli_state *c)
for (i=0;i<torture_numops;i++) {
- unsigned n = (unsigned)sys_random()%10;
+ uint_t n = (uint_t)sys_random()%10;
if (i % 10 == 0) {
printf("%d\r", i); fflush(stdout);
}
@@ -324,8 +324,8 @@ static BOOL rw_torture3(struct cli_state *c, const char *lockfname)
uint_t i = 0;
char buf[131072];
char buf_rd[131072];
- unsigned count;
- unsigned countprev = 0;
+ uint_t count;
+ uint_t countprev = 0;
ssize_t sent = 0;
BOOL correct = True;
@@ -372,7 +372,7 @@ static BOOL rw_torture3(struct cli_state *c, const char *lockfname)
if (procnum == 0)
{
- sent = ((unsigned)sys_random()%(20))+ 1;
+ sent = ((uint_t)sys_random()%(20))+ 1;
if (sent > sizeof(buf) - count)
{
sent = sizeof(buf) - count;
@@ -453,7 +453,7 @@ static BOOL rw_torture2(struct cli_state *c1, struct cli_state *c2)
for (i=0;i<torture_numops;i++)
{
- size_t buf_size = ((unsigned)sys_random()%(sizeof(buf)-1))+ 1;
+ size_t buf_size = ((uint_t)sys_random()%(sizeof(buf)-1))+ 1;
if (i % 10 == 0) {
printf("%d\r", i); fflush(stdout);
}
@@ -556,7 +556,7 @@ static BOOL run_locktest1(int dummy)
const char *fname = "\\lockt1.lck";
int fnum1, fnum2, fnum3;
time_t t1, t2;
- unsigned lock_timeout;
+ uint_t lock_timeout;
if (!torture_open_connection(&cli1) || !torture_open_connection(&cli2)) {
return False;
@@ -4053,7 +4053,7 @@ double torture_create_procs(BOOL (*fn)(struct cli_state *, int), BOOL *result)
static struct {
const char *name;
BOOL (*fn)(int);
- unsigned flags;
+ uint_t flags;
} torture_ops[] = {
{"FDPASS", run_fdpasstest, 0},
{"LOCK1", run_locktest1, 0},