summaryrefslogtreecommitdiff
path: root/source3/torture
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-10-18 17:40:25 -0700
committerJeremy Allison <jra@samba.org>2007-10-18 17:40:25 -0700
commit30191d1a5704ad2b158386b511558972d539ce47 (patch)
tree4f46e5c4f28f672ab661aa18f45745860970a88c /source3/torture
parent789856f63ff73fec66298e95c91c60db7bdaf14e (diff)
downloadsamba-30191d1a5704ad2b158386b511558972d539ce47.tar.gz
samba-30191d1a5704ad2b158386b511558972d539ce47.tar.bz2
samba-30191d1a5704ad2b158386b511558972d539ce47.zip
RIP BOOL. Convert BOOL -> bool. I found a few interesting
bugs in various places whilst doing this (places that assumed BOOL == int). I also need to fix the Samba4 pidl generation (next checkin). Jeremy. (This used to be commit f35a266b3cbb3e5fa6a86be60f34fe340a3ca71f)
Diffstat (limited to 'source3/torture')
-rw-r--r--source3/torture/cmd_vfs.c2
-rw-r--r--source3/torture/denytest.c10
-rw-r--r--source3/torture/locktest.c18
-rw-r--r--source3/torture/locktest2.c18
-rw-r--r--source3/torture/mangle_test.c6
-rw-r--r--source3/torture/masktest.c8
-rw-r--r--source3/torture/pdbtest.c6
-rw-r--r--source3/torture/rpctorture.c4
-rw-r--r--source3/torture/scanner.c8
-rw-r--r--source3/torture/t_asn1.c2
-rw-r--r--source3/torture/torture.c248
-rw-r--r--source3/torture/utable.c4
-rw-r--r--source3/torture/vfstest.c6
13 files changed, 170 insertions, 170 deletions
diff --git a/source3/torture/cmd_vfs.c b/source3/torture/cmd_vfs.c
index 636450d35e..02bee835b0 100644
--- a/source3/torture/cmd_vfs.c
+++ b/source3/torture/cmd_vfs.c
@@ -829,7 +829,7 @@ static NTSTATUS cmd_ftruncate(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int ar
static NTSTATUS cmd_lock(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, const char **argv)
{
- BOOL ret;
+ bool ret;
int fd;
int op;
long offset;
diff --git a/source3/torture/denytest.c b/source3/torture/denytest.c
index 3787cd88d0..9b08552df7 100644
--- a/source3/torture/denytest.c
+++ b/source3/torture/denytest.c
@@ -19,7 +19,7 @@
#include "includes.h"
-extern BOOL torture_showall;
+extern bool torture_showall;
enum deny_result {A_0=0, A_X=1, A_R=2, A_W=3, A_RW=5};
@@ -1403,12 +1403,12 @@ static void progress_bar(unsigned i, unsigned total)
/*
this produces a matrix of deny mode behaviour for 1 connection
*/
-BOOL torture_denytest1(int dummy)
+bool torture_denytest1(int dummy)
{
struct cli_state *cli1;
int fnum1, fnum2;
int i;
- BOOL correct = True;
+ bool correct = True;
const char *fnames[2] = {"\\denytest1.dat", "\\denytest1.exe"};
if (!torture_open_connection(&cli1, 0)) {
@@ -1489,12 +1489,12 @@ BOOL torture_denytest1(int dummy)
/*
this produces a matrix of deny mode behaviour with 2 connections
*/
-BOOL torture_denytest2(int dummy)
+bool torture_denytest2(int dummy)
{
static struct cli_state *cli1, *cli2;
int fnum1, fnum2;
int i;
- BOOL correct = True;
+ bool correct = True;
const char *fnames[2] = {"\\denytest2.dat", "\\denytest2.exe"};
if (!torture_open_connection(&cli1, 0) || !torture_open_connection(&cli2, 1)) {
diff --git a/source3/torture/locktest.c b/source3/torture/locktest.c
index 394a237a03..20fd49b3e1 100644
--- a/source3/torture/locktest.c
+++ b/source3/torture/locktest.c
@@ -23,17 +23,17 @@ static fstring password[2];
static fstring username[2];
static int got_user;
static int got_pass;
-static BOOL use_kerberos;
+static bool use_kerberos;
static int numops = 1000;
-static BOOL showall;
-static BOOL analyze;
-static BOOL hide_unlock_fails;
-static BOOL use_oplocks;
+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 BOOL exact_error_codes;
-static BOOL zero_zero;
+static bool exact_error_codes;
+static bool zero_zero;
extern char *optarg;
extern int optind;
@@ -295,7 +295,7 @@ static void reconnect(struct cli_state *cli[NSERVERS][NCONNECTIONS], int fnum[NS
-static BOOL test_one(struct cli_state *cli[NSERVERS][NCONNECTIONS],
+static bool test_one(struct cli_state *cli[NSERVERS][NCONNECTIONS],
int fnum[NSERVERS][NCONNECTIONS][NFILES],
struct record *rec)
{
@@ -305,7 +305,7 @@ static BOOL test_one(struct cli_state *cli[NSERVERS][NCONNECTIONS],
SMB_BIG_UINT len = rec->len;
enum brl_type op = rec->lock_type;
int server;
- BOOL ret[NSERVERS];
+ bool ret[NSERVERS];
NTSTATUS status[NSERVERS];
switch (rec->lock_op) {
diff --git a/source3/torture/locktest2.c b/source3/torture/locktest2.c
index 44ef250154..bdf9e51970 100644
--- a/source3/torture/locktest2.c
+++ b/source3/torture/locktest2.c
@@ -23,10 +23,10 @@ static fstring password;
static fstring username;
static int got_pass;
static int numops = 1000;
-static BOOL showall;
-static BOOL analyze;
-static BOOL hide_unlock_fails;
-static BOOL use_oplocks;
+static bool showall;
+static bool analyze;
+static bool hide_unlock_fails;
+static bool use_oplocks;
extern char *optarg;
extern int optind;
@@ -79,7 +79,7 @@ static int try_open(struct cli_state *c, char *nfs, int fstype, const char *fnam
return -1;
}
-static BOOL try_close(struct cli_state *c, int fstype, int fd)
+static bool try_close(struct cli_state *c, int fstype, int fd)
{
switch (fstype) {
case FSTYPE_SMB:
@@ -92,7 +92,7 @@ static BOOL try_close(struct cli_state *c, int fstype, int fd)
return False;
}
-static BOOL try_lock(struct cli_state *c, int fstype,
+static bool try_lock(struct cli_state *c, int fstype,
int fd, unsigned start, unsigned len,
enum brl_type op)
{
@@ -114,7 +114,7 @@ static BOOL try_lock(struct cli_state *c, int fstype,
return False;
}
-static BOOL try_unlock(struct cli_state *c, int fstype,
+static bool try_unlock(struct cli_state *c, int fstype,
int fd, unsigned start, unsigned len)
{
struct flock lock;
@@ -223,7 +223,7 @@ static void reconnect(struct cli_state *cli[NSERVERS][NCONNECTIONS],
-static BOOL test_one(struct cli_state *cli[NSERVERS][NCONNECTIONS],
+static bool test_one(struct cli_state *cli[NSERVERS][NCONNECTIONS],
char *nfs[NSERVERS],
int fnum[NSERVERS][NUMFSTYPES][NCONNECTIONS][NFILES],
struct record *rec)
@@ -237,7 +237,7 @@ static BOOL test_one(struct cli_state *cli[NSERVERS][NCONNECTIONS],
unsigned r2 = rec->r2;
enum brl_type op;
int server;
- BOOL ret[NSERVERS];
+ bool ret[NSERVERS];
if (r1 < READ_PCT) {
op = READ_LOCK;
diff --git a/source3/torture/mangle_test.c b/source3/torture/mangle_test.c
index 0bcddd6ebd..00457719a8 100644
--- a/source3/torture/mangle_test.c
+++ b/source3/torture/mangle_test.c
@@ -27,7 +27,7 @@ static TDB_CONTEXT *tdb;
static unsigned total, collisions, failures;
-static BOOL test_one(struct cli_state *cli, const char *name)
+static bool test_one(struct cli_state *cli, const char *name)
{
int fnum;
fstring shortname;
@@ -158,11 +158,11 @@ static void gen_name(char *name)
}
-BOOL torture_mangle(int dummy)
+bool torture_mangle(int dummy)
{
static struct cli_state *cli;
int i;
- BOOL ret = True;
+ bool ret = True;
printf("starting mangle test\n");
diff --git a/source3/torture/masktest.c b/source3/torture/masktest.c
index bab488f7bb..84c6e1c3a4 100644
--- a/source3/torture/masktest.c
+++ b/source3/torture/masktest.c
@@ -23,8 +23,8 @@ static fstring password;
static fstring username;
static int got_pass;
static int max_protocol = PROTOCOL_NT1;
-static BOOL showall = False;
-static BOOL old_list = False;
+static bool showall = False;
+static bool old_list = False;
static const char *maskchars = "<>\"?*abc.";
static const char *filechars = "abcdefghijklm.";
static int verbose;
@@ -34,7 +34,7 @@ static int ignore_dot_errors = 0;
extern char *optarg;
extern int optind;
-extern BOOL AllowDebugChange;
+extern bool AllowDebugChange;
/* a test fn for LANMAN mask support */
static int ms_fnmatch_lanman_core(const char *pattern, const char *string)
@@ -128,7 +128,7 @@ static int ms_fnmatch_lanman(const char *pattern, const char *string)
return ms_fnmatch_lanman_core(pattern, string);
}
-static BOOL reg_match_one(struct cli_state *cli, const char *pattern, const char *file)
+static bool reg_match_one(struct cli_state *cli, const char *pattern, const char *file)
{
/* oh what a weird world this is */
if (old_list && strcmp(pattern, "*.*") == 0) return True;
diff --git a/source3/torture/pdbtest.c b/source3/torture/pdbtest.c
index 150a01fc38..a5b7075b4c 100644
--- a/source3/torture/pdbtest.c
+++ b/source3/torture/pdbtest.c
@@ -22,9 +22,9 @@
#include "includes.h"
-static BOOL samu_correct(struct samu *s1, struct samu *s2)
+static bool samu_correct(struct samu *s1, struct samu *s2)
{
- BOOL ret = True;
+ bool ret = True;
uint32 s1_len, s2_len;
const char *s1_buf, *s2_buf;
const uint8 *d1_buf, *d2_buf;
@@ -229,7 +229,7 @@ int main(int argc, char **argv)
NTSTATUS rv;
int i;
struct timeval tv;
- BOOL error = False;
+ bool error = False;
struct passwd *pwd;
uint8 *buf;
uint32 expire, min_age, history;
diff --git a/source3/torture/rpctorture.c b/source3/torture/rpctorture.c
index 1c5f68cbdd..af8d6effdb 100644
--- a/source3/torture/rpctorture.c
+++ b/source3/torture/rpctorture.c
@@ -53,7 +53,7 @@ void rpcclient_init(void)
/****************************************************************************
make smb client connection
****************************************************************************/
-static BOOL rpcclient_connect(struct client_info *info)
+static bool rpcclient_connect(struct client_info *info)
{
struct nmb_name calling;
struct nmb_name called;
@@ -222,7 +222,7 @@ enum client_action
extern char *optarg;
extern int optind;
pstring term_code;
- BOOL got_pass = False;
+ bool got_pass = False;
char *cmd_str="";
enum client_action cli_action = CLIENT_NONE;
int nprocs = 1;
diff --git a/source3/torture/scanner.c b/source3/torture/scanner.c
index 19f021bd10..4f52a5812c 100644
--- a/source3/torture/scanner.c
+++ b/source3/torture/scanner.c
@@ -109,7 +109,7 @@ static NTSTATUS try_trans2_len(struct cli_state *cli,
/****************************************************************************
check for existance of a trans2 call
****************************************************************************/
-static BOOL scan_trans2(struct cli_state *cli, int op, int level,
+static bool scan_trans2(struct cli_state *cli, int op, int level,
int fnum, int dnum, const char *fname)
{
int data_len = 0;
@@ -186,7 +186,7 @@ static BOOL scan_trans2(struct cli_state *cli, int op, int level,
}
-BOOL torture_trans2_scan(int dummy)
+bool torture_trans2_scan(int dummy)
{
static struct cli_state *cli;
int op, level;
@@ -311,7 +311,7 @@ static NTSTATUS try_nttrans_len(struct cli_state *cli,
/****************************************************************************
check for existance of a nttrans call
****************************************************************************/
-static BOOL scan_nttrans(struct cli_state *cli, int op, int level,
+static bool scan_nttrans(struct cli_state *cli, int op, int level,
int fnum, int dnum, const char *fname)
{
int data_len = 0;
@@ -388,7 +388,7 @@ static BOOL scan_nttrans(struct cli_state *cli, int op, int level,
}
-BOOL torture_nttrans_scan(int dummy)
+bool torture_nttrans_scan(int dummy)
{
static struct cli_state *cli;
int op, level;
diff --git a/source3/torture/t_asn1.c b/source3/torture/t_asn1.c
index 98ee7baf92..5862742bc1 100644
--- a/source3/torture/t_asn1.c
+++ b/source3/torture/t_asn1.c
@@ -28,7 +28,7 @@ int main(void)
{
int i = 0;
int val;
- BOOL ok = True;
+ bool ok = True;
for (i=0; tests[i].data != NULL; i++) {
ASN1_DATA data;
diff --git a/source3/torture/torture.c b/source3/torture/torture.c
index a0167e8aab..d684216232 100644
--- a/source3/torture/torture.c
+++ b/source3/torture/torture.c
@@ -31,16 +31,16 @@ int torture_numops=100;
static int procnum; /* records process count number when forking */
static struct cli_state *current_cli;
static fstring randomfname;
-static BOOL use_oplocks;
-static BOOL use_level_II_oplocks;
+static bool use_oplocks;
+static bool use_level_II_oplocks;
static const char *client_txt = "client_oplocks.txt";
-static BOOL use_kerberos;
+static bool use_kerberos;
static fstring multishare_conn_fname;
-static BOOL use_multishare_conn = False;
+static bool use_multishare_conn = False;
-BOOL torture_showall = False;
+bool torture_showall = False;
-static double create_procs(BOOL (*fn)(int), BOOL *result);
+static double create_procs(bool (*fn)(int), bool *result);
static struct timeval tp1,tp2;
@@ -180,7 +180,7 @@ terminate_path_at_separator(char * path)
/*
parse a //server/share type UNC name
*/
-BOOL smbcli_parse_unc(const char *unc_name, TALLOC_CTX *mem_ctx,
+bool smbcli_parse_unc(const char *unc_name, TALLOC_CTX *mem_ctx,
char **hostname, char **sharename)
{
char *p;
@@ -209,11 +209,11 @@ BOOL smbcli_parse_unc(const char *unc_name, TALLOC_CTX *mem_ctx,
return False;
}
-static BOOL torture_open_connection_share(struct cli_state **c,
+static bool torture_open_connection_share(struct cli_state **c,
const char *hostname,
const char *sharename)
{
- BOOL retry;
+ bool retry;
int flags = 0;
NTSTATUS status;
@@ -247,11 +247,11 @@ void torture_open_connection_free_unclist(char **unc_list)
}
}
-BOOL torture_open_connection(struct cli_state **c, int conn_index)
+bool torture_open_connection(struct cli_state **c, int conn_index)
{
char **unc_list = NULL;
int num_unc_names = 0;
- BOOL result;
+ bool result;
if (use_multishare_conn==True) {
char *h, *s;
@@ -279,12 +279,12 @@ BOOL torture_open_connection(struct cli_state **c, int conn_index)
return torture_open_connection_share(c, host, share);
}
-BOOL torture_cli_session_setup2(struct cli_state *cli, uint16 *new_vuid)
+bool torture_cli_session_setup2(struct cli_state *cli, uint16 *new_vuid)
{
uint16 old_vuid = cli->vuid;
fstring old_user_name;
size_t passlen = strlen(password);
- BOOL ret;
+ bool ret;
fstrcpy(old_user_name, cli->user_name);
cli->vuid = 0;
@@ -299,9 +299,9 @@ BOOL torture_cli_session_setup2(struct cli_state *cli, uint16 *new_vuid)
}
-BOOL torture_close_connection(struct cli_state *c)
+bool torture_close_connection(struct cli_state *c)
{
- BOOL ret = True;
+ bool ret = True;
if (!cli_tdis(c)) {
printf("tdis failed (%s)\n", cli_errstr(c));
ret = False;
@@ -314,7 +314,7 @@ BOOL torture_close_connection(struct cli_state *c)
/* check if the server produced the expected error code */
-static BOOL check_error(int line, struct cli_state *c,
+static bool check_error(int line, struct cli_state *c,
uint8 eclass, uint32 ecode, NTSTATUS nterr)
{
if (cli_is_dos_error(c)) {
@@ -351,7 +351,7 @@ static BOOL check_error(int line, struct cli_state *c,
}
-static BOOL wait_lock(struct cli_state *c, int fnum, uint32 offset, uint32 len)
+static bool wait_lock(struct cli_state *c, int fnum, uint32 offset, uint32 len)
{
while (!cli_lock(c, fnum, offset, len, -1, WRITE_LOCK)) {
if (!check_error(__LINE__, c, ERRDOS, ERRlock, NT_STATUS_LOCK_NOT_GRANTED)) return False;
@@ -360,7 +360,7 @@ static BOOL wait_lock(struct cli_state *c, int fnum, uint32 offset, uint32 len)
}
-static BOOL rw_torture(struct cli_state *c)
+static bool rw_torture(struct cli_state *c)
{
const char *lockfname = "\\torture.lck";
fstring fname;
@@ -369,7 +369,7 @@ static BOOL rw_torture(struct cli_state *c)
pid_t pid2, pid = getpid();
int i, j;
char buf[1024];
- BOOL correct = True;
+ bool correct = True;
memset(buf, '\0', sizeof(buf));
@@ -451,10 +451,10 @@ static BOOL rw_torture(struct cli_state *c)
return correct;
}
-static BOOL run_torture(int dummy)
+static bool run_torture(int dummy)
{
struct cli_state *cli;
- BOOL ret;
+ bool ret;
cli = current_cli;
@@ -469,7 +469,7 @@ static BOOL run_torture(int dummy)
return ret;
}
-static BOOL rw_torture3(struct cli_state *c, char *lockfname)
+static bool rw_torture3(struct cli_state *c, char *lockfname)
{
int fnum = -1;
unsigned int i = 0;
@@ -478,7 +478,7 @@ static BOOL rw_torture3(struct cli_state *c, char *lockfname)
unsigned count;
unsigned countprev = 0;
ssize_t sent = 0;
- BOOL correct = True;
+ bool correct = True;
srandom(1);
for (i = 0; i < sizeof(buf); i += sizeof(uint32))
@@ -568,7 +568,7 @@ static BOOL rw_torture3(struct cli_state *c, char *lockfname)
return correct;
}
-static BOOL rw_torture2(struct cli_state *c1, struct cli_state *c2)
+static bool rw_torture2(struct cli_state *c1, struct cli_state *c2)
{
const char *lockfname = "\\torture2.lck";
int fnum1;
@@ -576,7 +576,7 @@ static BOOL rw_torture2(struct cli_state *c1, struct cli_state *c2)
int i;
char buf[131072];
char buf_rd[131072];
- BOOL correct = True;
+ bool correct = True;
ssize_t bytes_read;
if (!cli_unlink(c1, lockfname)) {
@@ -647,10 +647,10 @@ static BOOL rw_torture2(struct cli_state *c1, struct cli_state *c2)
return correct;
}
-static BOOL run_readwritetest(int dummy)
+static bool run_readwritetest(int dummy)
{
static struct cli_state *cli1, *cli2;
- BOOL test1, test2 = False;
+ bool test1, test2 = False;
if (!torture_open_connection(&cli1, 0) || !torture_open_connection(&cli2, 1)) {
return False;
@@ -679,10 +679,10 @@ static BOOL run_readwritetest(int dummy)
return (test1 && test2);
}
-static BOOL run_readwritemulti(int dummy)
+static bool run_readwritemulti(int dummy)
{
struct cli_state *cli;
- BOOL test;
+ bool test;
cli = current_cli;
@@ -698,14 +698,14 @@ static BOOL run_readwritemulti(int dummy)
return test;
}
-static BOOL run_readwritelarge(int dummy)
+static bool run_readwritelarge(int dummy)
{
static struct cli_state *cli1;
int fnum1;
const char *lockfname = "\\large.dat";
SMB_OFF_T fsize;
char buf[126*1024];
- BOOL correct = True;
+ bool correct = True;
if (!torture_open_connection(&cli1, 0)) {
return False;
@@ -806,7 +806,7 @@ int nbio_id;
#define ival(s) strtol(s, NULL, 0)
/* run a test that simulates an approximate netbench client load */
-static BOOL run_netbench(int client)
+static bool run_netbench(int client)
{
struct cli_state *cli;
int i;
@@ -814,7 +814,7 @@ static BOOL run_netbench(int client)
char cname[20];
FILE *f;
const char *params[20];
- BOOL correct = True;
+ bool correct = True;
cli = current_cli;
@@ -903,10 +903,10 @@ static BOOL run_netbench(int client)
/* run a test that simulates an approximate netbench client load */
-static BOOL run_nbench(int dummy)
+static bool run_nbench(int dummy)
{
double t;
- BOOL correct = True;
+ bool correct = True;
nbio_shmem(nprocs);
@@ -930,7 +930,7 @@ static BOOL run_nbench(int dummy)
must not use posix semantics)
2) support for lock timeouts
*/
-static BOOL run_locktest1(int dummy)
+static bool run_locktest1(int dummy)
{
struct cli_state *cli1, *cli2;
const char *fname = "\\lockt1.lck";
@@ -1043,7 +1043,7 @@ static BOOL run_locktest1(int dummy)
this checks to see if a secondary tconx can use open files from an
earlier tconx
*/
-static BOOL run_tcon_test(int dummy)
+static bool run_tcon_test(int dummy)
{
static struct cli_state *cli;
const char *fname = "\\tcontest.tmp";
@@ -1051,7 +1051,7 @@ static BOOL run_tcon_test(int dummy)
uint16 cnum1, cnum2, cnum3;
uint16 vuid1, vuid2;
char buf[4];
- BOOL ret = True;
+ bool ret = True;
memset(buf, '\0', sizeof(buf));
@@ -1150,7 +1150,7 @@ static BOOL run_tcon_test(int dummy)
/*
checks for old style tcon support
*/
-static BOOL run_tcon2_test(int dummy)
+static bool run_tcon2_test(int dummy)
{
static struct cli_state *cli;
uint16 cnum, max_xmit;
@@ -1183,13 +1183,13 @@ static BOOL run_tcon2_test(int dummy)
return True;
}
-static BOOL tcon_devtest(struct cli_state *cli,
+static bool tcon_devtest(struct cli_state *cli,
const char *myshare, const char *devtype,
const char *return_devtype,
NTSTATUS expected_error)
{
- BOOL status;
- BOOL ret;
+ bool status;
+ bool ret;
status = cli_send_tconX(cli, myshare, devtype,
password, strlen(password)+1);
@@ -1234,13 +1234,13 @@ static BOOL tcon_devtest(struct cli_state *cli,
/*
checks for correct tconX support
*/
-static BOOL run_tcon_devtype_test(int dummy)
+static bool run_tcon_devtype_test(int dummy)
{
static struct cli_state *cli1 = NULL;
- BOOL retry;
+ bool retry;
int flags = 0;
NTSTATUS status;
- BOOL ret = True;
+ bool ret = True;
status = cli_full_connection(&cli1, myname,
host, NULL, port_to_use,
@@ -1303,12 +1303,12 @@ static BOOL run_tcon_devtype_test(int dummy)
3) the server denies unlock requests by an incorrect client PID
*/
-static BOOL run_locktest2(int dummy)
+static bool run_locktest2(int dummy)
{
static struct cli_state *cli;
const char *fname = "\\lockt2.lck";
int fnum1, fnum2, fnum3;
- BOOL correct = True;
+ bool correct = True;
if (!torture_open_connection(&cli, 0)) {
return False;
@@ -1439,13 +1439,13 @@ static BOOL run_locktest2(int dummy)
1) the server supports the full offset range in lock requests
*/
-static BOOL run_locktest3(int dummy)
+static bool run_locktest3(int dummy)
{
static struct cli_state *cli1, *cli2;
const char *fname = "\\lockt3.lck";
int fnum1, fnum2, i;
uint32 offset;
- BOOL correct = True;
+ bool correct = True;
#define NEXT_OFFSET offset += (~(uint32)0) / torture_numops
@@ -1564,14 +1564,14 @@ static BOOL run_locktest3(int dummy)
/*
looks at overlapping locks
*/
-static BOOL run_locktest4(int dummy)
+static bool run_locktest4(int dummy)
{
static struct cli_state *cli1, *cli2;
const char *fname = "\\lockt4.lck";
int fnum1, fnum2, f;
- BOOL ret;
+ bool ret;
char buf[1000];
- BOOL correct = True;
+ bool correct = True;
if (!torture_open_connection(&cli1, 0) || !torture_open_connection(&cli2, 1)) {
return False;
@@ -1735,14 +1735,14 @@ static BOOL run_locktest4(int dummy)
/*
looks at lock upgrade/downgrade.
*/
-static BOOL run_locktest5(int dummy)
+static bool run_locktest5(int dummy)
{
static struct cli_state *cli1, *cli2;
const char *fname = "\\lockt5.lck";
int fnum1, fnum2, fnum3;
- BOOL ret;
+ bool ret;
char buf[1000];
- BOOL correct = True;
+ bool correct = True;
if (!torture_open_connection(&cli1, 0) || !torture_open_connection(&cli2, 1)) {
return False;
@@ -1859,7 +1859,7 @@ static BOOL run_locktest5(int dummy)
/*
tries the unusual lockingX locktype bits
*/
-static BOOL run_locktest6(int dummy)
+static bool run_locktest6(int dummy)
{
static struct cli_state *cli;
const char *fname[1] = { "\\lock6.txt" };
@@ -1899,13 +1899,13 @@ static BOOL run_locktest6(int dummy)
return True;
}
-static BOOL run_locktest7(int dummy)
+static bool run_locktest7(int dummy)
{
struct cli_state *cli1;
const char *fname = "\\lockt7.lck";
int fnum1;
char buf[200];
- BOOL correct = False;
+ bool correct = False;
if (!torture_open_connection(&cli1, 0)) {
return False;
@@ -2036,7 +2036,7 @@ fail:
test whether fnums and tids open on one VC are available on another (a major
security hole)
*/
-static BOOL run_fdpasstest(int dummy)
+static bool run_fdpasstest(int dummy)
{
struct cli_state *cli1, *cli2;
const char *fname = "\\fdpass.tst";
@@ -2084,7 +2084,7 @@ static BOOL run_fdpasstest(int dummy)
return True;
}
-static BOOL run_fdsesstest(int dummy)
+static bool run_fdsesstest(int dummy)
{
struct cli_state *cli;
uint16 new_vuid;
@@ -2096,7 +2096,7 @@ static BOOL run_fdsesstest(int dummy)
int fnum1;
int fnum2;
pstring buf;
- BOOL ret = True;
+ bool ret = True;
if (!torture_open_connection(&cli, 0))
return False;
@@ -2173,12 +2173,12 @@ static BOOL run_fdsesstest(int dummy)
1) the server does not allow an unlink on a file that is open
*/
-static BOOL run_unlinktest(int dummy)
+static bool run_unlinktest(int dummy)
{
struct cli_state *cli;
const char *fname = "\\unlink.tst";
int fnum;
- BOOL correct = True;
+ bool correct = True;
if (!torture_open_connection(&cli, 0)) {
return False;
@@ -2222,14 +2222,14 @@ static BOOL run_unlinktest(int dummy)
/*
test how many open files this server supports on the one socket
*/
-static BOOL run_maxfidtest(int dummy)
+static bool run_maxfidtest(int dummy)
{
struct cli_state *cli;
const char *ftemplate = "\\maxfid.%d.%d";
fstring fname;
int fnums[0x11000], i;
int retries=4;
- BOOL correct = True;
+ bool correct = True;
cli = current_cli;
@@ -2285,11 +2285,11 @@ static void rand_buf(char *buf, int len)
}
/* send smb negprot commands, not reading the response */
-static BOOL run_negprot_nowait(int dummy)
+static bool run_negprot_nowait(int dummy)
{
int i;
static struct cli_state *cli;
- BOOL correct = True;
+ bool correct = True;
printf("starting negprot nowait test\n");
@@ -2312,7 +2312,7 @@ static BOOL run_negprot_nowait(int dummy)
/* send random IPC commands */
-static BOOL run_randomipc(int dummy)
+static bool run_randomipc(int dummy)
{
char *rparam = NULL;
char *rdata = NULL;
@@ -2320,7 +2320,7 @@ static BOOL run_randomipc(int dummy)
pstring param;
int api, param_len, i;
struct cli_state *cli;
- BOOL correct = True;
+ bool correct = True;
int count = 50000;
printf("starting random ipc test\n");
@@ -2371,10 +2371,10 @@ static void browse_callback(const char *sname, uint32 stype,
This test checks the browse list code
*/
-static BOOL run_browsetest(int dummy)
+static bool run_browsetest(int dummy)
{
static struct cli_state *cli;
- BOOL correct = True;
+ bool correct = True;
printf("starting browse test\n");
@@ -2406,13 +2406,13 @@ static BOOL run_browsetest(int dummy)
/*
This checks how the getatr calls works
*/
-static BOOL run_attrtest(int dummy)
+static bool run_attrtest(int dummy)
{
struct cli_state *cli;
int fnum;
time_t t, t2;
const char *fname = "\\attrib123456789.tst";
- BOOL correct = True;
+ bool correct = True;
printf("starting attrib test\n");
@@ -2470,7 +2470,7 @@ static BOOL run_attrtest(int dummy)
/*
This checks a couple of trans2 calls
*/
-static BOOL run_trans2test(int dummy)
+static bool run_trans2test(int dummy)
{
struct cli_state *cli;
int fnum;
@@ -2481,7 +2481,7 @@ static BOOL run_trans2test(int dummy)
const char *dname = "\\trans2";
const char *fname2 = "\\trans2\\trans2.tst";
pstring pname;
- BOOL correct = True;
+ bool correct = True;
printf("starting trans2 test\n");
@@ -2607,11 +2607,11 @@ static BOOL run_trans2test(int dummy)
This checks new W2K calls.
*/
-static BOOL new_trans(struct cli_state *pcli, int fnum, int level)
+static bool new_trans(struct cli_state *pcli, int fnum, int level)
{
char *buf = NULL;
uint32 len;
- BOOL correct = True;
+ bool correct = True;
if (!cli_qfileinfo_test(pcli, fnum, level, &buf, &len)) {
printf("ERROR: qfileinfo (%d) failed (%s)\n", level, cli_errstr(pcli));
@@ -2625,13 +2625,13 @@ static BOOL new_trans(struct cli_state *pcli, int fnum, int level)
return correct;
}
-static BOOL run_w2ktest(int dummy)
+static bool run_w2ktest(int dummy)
{
struct cli_state *cli;
int fnum;
const char *fname = "\\w2ktest\\w2k.tst";
int level;
- BOOL correct = True;
+ bool correct = True;
printf("starting w2k test\n");
@@ -2661,12 +2661,12 @@ static BOOL run_w2ktest(int dummy)
/*
this is a harness for some oplock tests
*/
-static BOOL run_oplock1(int dummy)
+static bool run_oplock1(int dummy)
{
struct cli_state *cli1;
const char *fname = "\\lockt1.lck";
int fnum1;
- BOOL correct = True;
+ bool correct = True;
printf("starting oplock test 1\n");
@@ -2710,17 +2710,17 @@ static BOOL run_oplock1(int dummy)
return correct;
}
-static BOOL run_oplock2(int dummy)
+static bool run_oplock2(int dummy)
{
struct cli_state *cli1, *cli2;
const char *fname = "\\lockt2.lck";
int fnum1, fnum2;
int saved_use_oplocks = use_oplocks;
char buf[4];
- BOOL correct = True;
- volatile BOOL *shared_correct;
+ bool correct = True;
+ volatile bool *shared_correct;
- shared_correct = (volatile BOOL *)shm_setup(sizeof(BOOL));
+ shared_correct = (volatile bool *)shm_setup(sizeof(bool));
*shared_correct = True;
use_level_II_oplocks = True;
@@ -2846,23 +2846,23 @@ static BOOL run_oplock2(int dummy)
}
/* handler for oplock 3 tests */
-static BOOL oplock3_handler(struct cli_state *cli, int fnum, unsigned char level)
+static bool oplock3_handler(struct cli_state *cli, int fnum, unsigned char level)
{
printf("got oplock break fnum=%d level=%d\n",
fnum, level);
return cli_oplock_ack(cli, fnum, level);
}
-static BOOL run_oplock3(int dummy)
+static bool run_oplock3(int dummy)
{
struct cli_state *cli;
const char *fname = "\\oplockt3.dat";
int fnum;
char buf[4] = "abcd";
- BOOL correct = True;
- volatile BOOL *shared_correct;
+ bool correct = True;
+ volatile bool *shared_correct;
- shared_correct = (volatile BOOL *)shm_setup(sizeof(BOOL));
+ shared_correct = (volatile bool *)shm_setup(sizeof(bool));
*shared_correct = True;
printf("starting oplock test 3\n");
@@ -2907,14 +2907,14 @@ static BOOL run_oplock3(int dummy)
/*
Test delete on close semantics.
*/
-static BOOL run_deletetest(int dummy)
+static bool run_deletetest(int dummy)
{
struct cli_state *cli1 = NULL;
struct cli_state *cli2 = NULL;
const char *fname = "\\delete.file";
int fnum1 = -1;
int fnum2 = -1;
- BOOL correct = True;
+ bool correct = True;
printf("starting delete test\n");
@@ -3390,10 +3390,10 @@ static BOOL run_deletetest(int dummy)
/*
print out server properties
*/
-static BOOL run_properties(int dummy)
+static bool run_properties(int dummy)
{
static struct cli_state *cli;
- BOOL correct = True;
+ bool correct = True;
printf("starting properties test\n");
@@ -3438,11 +3438,11 @@ static BOOL run_properties(int dummy)
/*
Test ntcreate calls made by xcopy
*/
-static BOOL run_xcopy(int dummy)
+static bool run_xcopy(int dummy)
{
static struct cli_state *cli1;
const char *fname = "\\test.txt";
- BOOL correct = True;
+ bool correct = True;
int fnum1, fnum2;
printf("starting xcopy test\n");
@@ -3480,12 +3480,12 @@ static BOOL run_xcopy(int dummy)
/*
Test rename on files open with share delete and no share delete.
*/
-static BOOL run_rename(int dummy)
+static bool run_rename(int dummy)
{
static struct cli_state *cli1;
const char *fname = "\\test.txt";
const char *fname1 = "\\test1.txt";
- BOOL correct = True;
+ bool correct = True;
int fnum1;
printf("starting rename test\n");
@@ -3668,7 +3668,7 @@ static BOOL run_rename(int dummy)
return correct;
}
-static BOOL run_pipe_number(int dummy)
+static bool run_pipe_number(int dummy)
{
struct cli_state *cli1;
const char *pipe_name = "\\SPOOLSS";
@@ -3701,7 +3701,7 @@ static BOOL run_pipe_number(int dummy)
/*
Test open mode returns on read-only files.
*/
-static BOOL run_opentest(int dummy)
+static bool run_opentest(int dummy)
{
static struct cli_state *cli1;
static struct cli_state *cli2;
@@ -3709,7 +3709,7 @@ static BOOL run_opentest(int dummy)
int fnum1, fnum2;
char buf[20];
SMB_OFF_T fsize;
- BOOL correct = True;
+ bool correct = True;
char *tmp_path;
printf("starting open test\n");
@@ -4151,12 +4151,12 @@ static struct trunc_open_results attr_results[] = {
{ 249, FILE_ATTRIBUTE_SYSTEM, FILE_ATTRIBUTE_ARCHIVE|FILE_ATTRIBUTE_READONLY|FILE_ATTRIBUTE_SYSTEM, FILE_ATTRIBUTE_ARCHIVE|FILE_ATTRIBUTE_READONLY|FILE_ATTRIBUTE_SYSTEM }
};
-static BOOL run_openattrtest(int dummy)
+static bool run_openattrtest(int dummy)
{
static struct cli_state *cli1;
const char *fname = "\\openattr.file";
int fnum1;
- BOOL correct = True;
+ bool correct = True;
uint16 attr;
unsigned int i, j, k, l;
@@ -4264,13 +4264,13 @@ static void list_fn(const char *mnt, file_info *finfo, const char *name, void *s
/*
test directory listing speed
*/
-static BOOL run_dirtest(int dummy)
+static bool run_dirtest(int dummy)
{
int i;
static struct cli_state *cli;
int fnum;
double t1;
- BOOL correct = True;
+ bool correct = True;
printf("starting directory test\n");
@@ -4338,7 +4338,7 @@ static void del_fn(const char *mnt, file_info *finfo, const char *mask, void *st
/*
sees what IOCTLs are supported
*/
-BOOL torture_ioctl_test(int dummy)
+bool torture_ioctl_test(int dummy)
{
static struct cli_state *cli;
uint16 device, function;
@@ -4393,11 +4393,11 @@ BOOL torture_ioctl_test(int dummy)
/*
tries varients of chkpath
*/
-BOOL torture_chkpath_test(int dummy)
+bool torture_chkpath_test(int dummy)
{
static struct cli_state *cli;
int fnum;
- BOOL ret;
+ bool ret;
if (!torture_open_connection(&cli, 0)) {
return False;
@@ -4472,11 +4472,11 @@ BOOL torture_chkpath_test(int dummy)
return ret;
}
-static BOOL run_eatest(int dummy)
+static bool run_eatest(int dummy)
{
static struct cli_state *cli;
const char *fname = "\\eatest.txt";
- BOOL correct = True;
+ bool correct = True;
int fnum, i;
size_t num_eas;
struct ea_struct *ea_list = NULL;
@@ -4592,12 +4592,12 @@ static BOOL run_eatest(int dummy)
return correct;
}
-static BOOL run_dirtest1(int dummy)
+static bool run_dirtest1(int dummy)
{
int i;
static struct cli_state *cli;
int fnum, num_seen;
- BOOL correct = True;
+ bool correct = True;
printf("starting directory test\n");
@@ -4673,7 +4673,7 @@ static BOOL run_dirtest1(int dummy)
return correct;
}
-static BOOL run_error_map_extract(int dummy) {
+static bool run_error_map_extract(int dummy) {
static struct cli_state *c_dos;
static struct cli_state *c_nt;
@@ -4799,7 +4799,7 @@ static bool subst_test(const char *str, const char *user, const char *domain,
return result;
}
-static BOOL run_local_substitute(int dummy)
+static bool run_local_substitute(int dummy)
{
bool ok = true;
@@ -4820,7 +4820,7 @@ static BOOL run_local_substitute(int dummy)
return ok;
}
-static BOOL run_local_gencache(int dummy)
+static bool run_local_gencache(int dummy)
{
char *val;
time_t tm;
@@ -4920,11 +4920,11 @@ static BOOL run_local_gencache(int dummy)
return True;
}
-static double create_procs(BOOL (*fn)(int), BOOL *result)
+static double create_procs(bool (*fn)(int), bool *result)
{
int i, status;
volatile pid_t *child_status;
- volatile BOOL *child_status_out;
+ volatile bool *child_status_out;
int synccount;
int tries = 8;
@@ -4936,7 +4936,7 @@ static double create_procs(BOOL (*fn)(int), BOOL *result)
return -1;
}
- child_status_out = (volatile BOOL *)shm_setup(sizeof(BOOL)*nprocs);
+ child_status_out = (volatile bool *)shm_setup(sizeof(bool)*nprocs);
if (!child_status_out) {
printf("Failed to setup result status shared memory\n");
return -1;
@@ -5017,7 +5017,7 @@ static double create_procs(BOOL (*fn)(int), BOOL *result)
static struct {
const char *name;
- BOOL (*fn)(int);
+ bool (*fn)(int);
unsigned flags;
} torture_ops[] = {
{"FDPASS", run_fdpasstest, 0},
@@ -5079,11 +5079,11 @@ static struct {
/****************************************************************************
run a specified test or "ALL"
****************************************************************************/
-static BOOL run_test(const char *name)
+static bool run_test(const char *name)
{
- BOOL ret = True;
- BOOL result = True;
- BOOL found = False;
+ bool ret = True;
+ bool result = True;
+ bool found = False;
int i;
double t;
if (strequal(name,"ALL")) {
@@ -5174,7 +5174,7 @@ static void usage(void)
char *p;
int gotuser = 0;
int gotpass = 0;
- BOOL correct = True;
+ bool correct = True;
dbf = x_stdout;
diff --git a/source3/torture/utable.c b/source3/torture/utable.c
index 0fa48ab45e..7032cea99b 100644
--- a/source3/torture/utable.c
+++ b/source3/torture/utable.c
@@ -19,7 +19,7 @@
#include "includes.h"
-BOOL torture_utable(int dummy)
+bool torture_utable(int dummy)
{
struct cli_state *cli;
fstring fname, alt_name;
@@ -110,7 +110,7 @@ static char *form_name(int c)
return fname;
}
-BOOL torture_casetable(int dummy)
+bool torture_casetable(int dummy)
{
static struct cli_state *cli;
char *fname;
diff --git a/source3/torture/vfstest.c b/source3/torture/vfstest.c
index 5720d662fd..bdbb9511c7 100644
--- a/source3/torture/vfstest.c
+++ b/source3/torture/vfstest.c
@@ -336,7 +336,7 @@ static NTSTATUS do_cmd(struct vfs_state *vfs, struct cmd_set *cmd_entry, char *c
static NTSTATUS process_cmd(struct vfs_state *vfs, char *cmd)
{
struct cmd_list *temp_list;
- BOOL found = False;
+ bool found = False;
pstring buf;
const char *p = cmd;
NTSTATUS result = NT_STATUS_OK;
@@ -431,9 +431,9 @@ void reload_printers(void)
Reload the services file.
**************************************************************************/
-BOOL reload_services(BOOL test)
+bool reload_services(bool test)
{
- BOOL ret;
+ bool ret;
if (lp_loaded()) {
pstring fname;