diff options
author | Andrew Tridgell <tridge@samba.org> | 2004-05-25 13:57:39 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:56:14 -0500 |
commit | 579c13da43d5b40ac6d6c1436399fbc1d8dfd054 (patch) | |
tree | 42299570746f2d7f80356b689cb15e3db6c53d3c /source4/torture/raw | |
parent | 81e8de9ca85fe9a6658beb1dab0d231c13cda063 (diff) | |
download | samba-579c13da43d5b40ac6d6c1436399fbc1d8dfd054.tar.gz samba-579c13da43d5b40ac6d6c1436399fbc1d8dfd054.tar.bz2 samba-579c13da43d5b40ac6d6c1436399fbc1d8dfd054.zip |
r873: converted samba4 to use real 64 bit integers instead of
structures. This was suggested by metze recently.
I checked on the build farm and all the machines we have support 64
bit ints, and support the LL suffix for 64 bit constants. I suspect
some won't support strtoll() and related functions, so we will
probably need replacements for those.
(This used to be commit 9a9244a1c66654c12abe4379661cba83a73c4c21)
Diffstat (limited to 'source4/torture/raw')
-rw-r--r-- | source4/torture/raw/close.c | 4 | ||||
-rw-r--r-- | source4/torture/raw/open.c | 8 | ||||
-rw-r--r-- | source4/torture/raw/qfileinfo.c | 36 | ||||
-rw-r--r-- | source4/torture/raw/read.c | 8 | ||||
-rw-r--r-- | source4/torture/raw/search.c | 10 | ||||
-rw-r--r-- | source4/torture/raw/setfileinfo.c | 6 | ||||
-rw-r--r-- | source4/torture/raw/write.c | 12 |
7 files changed, 40 insertions, 44 deletions
diff --git a/source4/torture/raw/close.c b/source4/torture/raw/close.c index 0180f43dd2..e2221946a0 100644 --- a/source4/torture/raw/close.c +++ b/source4/torture/raw/close.c @@ -77,10 +77,10 @@ BOOL torture_raw_close(int dummy) status = smb_raw_pathinfo(cli->tree, mem_ctx, &finfo); CHECK_STATUS(status, NT_STATUS_OK); - if (basetime != nt_time_to_unix(&finfo.all_info.out.write_time)) { + if (basetime != nt_time_to_unix(finfo.all_info.out.write_time)) { printf("Incorrect write time on file - %s - %s\n", timestring(mem_ctx, basetime), - nt_time_string(mem_ctx, &finfo.all_info.out.write_time)); + nt_time_string(mem_ctx, finfo.all_info.out.write_time)); dump_all_info(mem_ctx, &finfo); ret = False; } diff --git a/source4/torture/raw/open.c b/source4/torture/raw/open.c index f559632f23..6b85b243d5 100644 --- a/source4/torture/raw/open.c +++ b/source4/torture/raw/open.c @@ -84,7 +84,7 @@ static const char *rdwr_string(enum rdwr_mode m) status = smb_raw_pathinfo(cli->tree, mem_ctx, &finfo); \ CHECK_STATUS(status, NT_STATUS_OK); \ t1 = t & ~1; \ - t2 = nt_time_to_unix(&finfo.all_info.out.field) & ~1; \ + t2 = nt_time_to_unix(finfo.all_info.out.field) & ~1; \ if (ABS(t1-t2) > 2) { \ printf("(%d) wrong time for field %s %s - %s\n", \ __LINE__, #field, \ @@ -101,11 +101,11 @@ static const char *rdwr_string(enum rdwr_mode m) status = smb_raw_pathinfo(cli->tree, mem_ctx, &finfo); \ CHECK_STATUS(status, NT_STATUS_OK); \ t2 = finfo.all_info.out.field; \ - if (!nt_time_equal(&t, &t2)) { \ + if (t != t2) { \ printf("(%d) wrong time for field %s %s - %s\n", \ __LINE__, #field, \ - nt_time_string(mem_ctx, &t), \ - nt_time_string(mem_ctx, &t2)); \ + nt_time_string(mem_ctx, t), \ + nt_time_string(mem_ctx, t2)); \ dump_all_info(mem_ctx, &finfo); \ ret = False; \ }} while (0) diff --git a/source4/torture/raw/qfileinfo.c b/source4/torture/raw/qfileinfo.c index 9c1c3a9e5c..14f30db97f 100644 --- a/source4/torture/raw/qfileinfo.c +++ b/source4/torture/raw/qfileinfo.c @@ -66,7 +66,7 @@ static struct { /* compare a dos time (2 second resolution) to a nt time */ -static int dos_nt_time_cmp(time_t t, const NTTIME *nt) +static int dos_nt_time_cmp(time_t t, NTTIME nt) { time_t t2 = nt_time_to_unix(nt); if (ABS(t2 - t) <= 2) return 0; @@ -158,7 +158,7 @@ BOOL torture_raw_qfileinfo(int dummy) int fnum; const char *fname = "\\torture_qfileinfo.txt"; NTTIME correct_time; - large_t correct_size; + uint64_t correct_size; uint32 correct_attrib; const char *correct_name; BOOL skip_streams = False; @@ -320,54 +320,54 @@ BOOL torture_raw_qfileinfo(int dummy) s1 = fnum_find(sname); \ if (s1 && memcmp(&s1->stype.out.tfield, &correct_time, sizeof(correct_time)) != 0) { \ printf("(%d) handle %s/%s incorrect - %s should be %s\n", __LINE__, #stype, #tfield, \ - nt_time_string(mem_ctx, &s1->stype.out.tfield), \ - nt_time_string(mem_ctx, &correct_time)); \ + nt_time_string(mem_ctx, s1->stype.out.tfield), \ + nt_time_string(mem_ctx, correct_time)); \ ret = False; \ } \ s1 = fname_find(sname); \ if (s1 && memcmp(&s1->stype.out.tfield, &correct_time, sizeof(correct_time)) != 0) { \ printf("(%d) path %s/%s incorrect - %s should be %s\n", __LINE__, #stype, #tfield, \ - nt_time_string(mem_ctx, &s1->stype.out.tfield), \ - nt_time_string(mem_ctx, &correct_time)); \ + nt_time_string(mem_ctx, s1->stype.out.tfield), \ + nt_time_string(mem_ctx, correct_time)); \ ret = False; \ }} while (0) #define TIME_CHECK_DOS(sname, stype, tfield) do { \ s1 = fnum_find(sname); \ - if (s1 && dos_nt_time_cmp(s1->stype.out.tfield, &correct_time) != 0) { \ + if (s1 && dos_nt_time_cmp(s1->stype.out.tfield, correct_time) != 0) { \ printf("(%d) handle %s/%s incorrect - %s should be %s\n", __LINE__, #stype, #tfield, \ timestring(mem_ctx, s1->stype.out.tfield), \ - nt_time_string(mem_ctx, &correct_time)); \ + nt_time_string(mem_ctx, correct_time)); \ ret = False; \ } \ s1 = fname_find(sname); \ - if (s1 && dos_nt_time_cmp(s1->stype.out.tfield, &correct_time) != 0) { \ + if (s1 && dos_nt_time_cmp(s1->stype.out.tfield, correct_time) != 0) { \ printf("(%d) path %s/%s incorrect - %s should be %s\n", __LINE__, #stype, #tfield, \ timestring(mem_ctx, s1->stype.out.tfield), \ - nt_time_string(mem_ctx, &correct_time)); \ + nt_time_string(mem_ctx, correct_time)); \ ret = False; \ }} while (0) #define TIME_CHECK_UNX(sname, stype, tfield) do { \ s1 = fnum_find(sname); \ - if (s1 && unx_nt_time_cmp(s1->stype.out.tfield, &correct_time) != 0) { \ + if (s1 && unx_nt_time_cmp(s1->stype.out.tfield, correct_time) != 0) { \ printf("(%d) handle %s/%s incorrect - %s should be %s\n", __LINE__, #stype, #tfield, \ timestring(mem_ctx, s1->stype.out.tfield), \ - nt_time_string(mem_ctx, &correct_time)); \ + nt_time_string(mem_ctx, correct_time)); \ ret = False; \ } \ s1 = fname_find(sname); \ - if (s1 && unx_nt_time_cmp(s1->stype.out.tfield, &correct_time) != 0) { \ + if (s1 && unx_nt_time_cmp(s1->stype.out.tfield, correct_time) != 0) { \ printf("(%d) path %s/%s incorrect - %s should be %s\n", __LINE__, #stype, #tfield, \ timestring(mem_ctx, s1->stype.out.tfield), \ - nt_time_string(mem_ctx, &correct_time)); \ + nt_time_string(mem_ctx, correct_time)); \ ret = False; \ }} while (0) /* now check that all the times that are supposed to be equal are correct */ s1 = fnum_find("BASIC_INFO"); correct_time = s1->basic_info.out.create_time; - printf("create_time: %s\n", nt_time_string(mem_ctx, &correct_time)); + printf("create_time: %s\n", nt_time_string(mem_ctx, correct_time)); TIME_CHECK_NT ("BASIC_INFO", basic_info, create_time); TIME_CHECK_NT ("BASIC_INFORMATION", basic_info, create_time); @@ -379,7 +379,7 @@ BOOL torture_raw_qfileinfo(int dummy) s1 = fnum_find("BASIC_INFO"); correct_time = s1->basic_info.out.access_time; - printf("access_time: %s\n", nt_time_string(mem_ctx, &correct_time)); + printf("access_time: %s\n", nt_time_string(mem_ctx, correct_time)); TIME_CHECK_NT ("BASIC_INFO", basic_info, access_time); TIME_CHECK_NT ("BASIC_INFORMATION", basic_info, access_time); @@ -391,7 +391,7 @@ BOOL torture_raw_qfileinfo(int dummy) s1 = fnum_find("BASIC_INFO"); correct_time = s1->basic_info.out.write_time; - printf("write_time : %s\n", nt_time_string(mem_ctx, &correct_time)); + printf("write_time : %s\n", nt_time_string(mem_ctx, correct_time)); TIME_CHECK_NT ("BASIC_INFO", basic_info, write_time); TIME_CHECK_NT ("BASIC_INFORMATION", basic_info, write_time); @@ -404,7 +404,7 @@ BOOL torture_raw_qfileinfo(int dummy) s1 = fnum_find("BASIC_INFO"); correct_time = s1->basic_info.out.change_time; - printf("change_time: %s\n", nt_time_string(mem_ctx, &correct_time)); + printf("change_time: %s\n", nt_time_string(mem_ctx, correct_time)); TIME_CHECK_NT ("BASIC_INFO", basic_info, change_time); TIME_CHECK_NT ("BASIC_INFORMATION", basic_info, change_time); diff --git a/source4/torture/raw/read.c b/source4/torture/raw/read.c index 3e9547856c..5e1d055e22 100644 --- a/source4/torture/raw/read.c +++ b/source4/torture/raw/read.c @@ -502,9 +502,8 @@ static BOOL test_readx(struct cli_state *cli, TALLOC_CTX *mem_ctx) status = smb_raw_read(cli->tree, &io); CHECK_STATUS(status, NT_STATUS_FILE_LOCK_CONFLICT); -#ifdef LARGE_SMB_OFF_T printf("Trying large offset read\n"); - io.readx.in.offset = ((SMB_BIG_UINT)0x2) << 32; + io.readx.in.offset = ((uint64_t)0x2) << 32; io.readx.in.mincnt = 10; io.readx.in.maxcnt = 10; status = smb_raw_read(cli->tree, &io); @@ -520,7 +519,6 @@ static BOOL test_readx(struct cli_state *cli, TALLOC_CTX *mem_ctx) status = smb_raw_read(cli->tree, &io); CHECK_STATUS(status, NT_STATUS_OK); CHECK_VALUE(io.readx.out.nread, 0); -#endif done: cli_close(cli->tree, fnum); @@ -684,16 +682,14 @@ static BOOL test_readbraw(struct cli_state *cli, TALLOC_CTX *mem_ctx) CHECK_STATUS(status, NT_STATUS_OK); CHECK_VALUE(io.readbraw.out.nread, 0); -#ifdef LARGE_SMB_OFF_T printf("Trying large offset read\n"); - io.readbraw.in.offset = ((SMB_BIG_UINT)0x2) << 32; + io.readbraw.in.offset = ((uint64_t)0x2) << 32; io.readbraw.in.mincnt = 10; io.readbraw.in.maxcnt = 10; io.readbraw.in.timeout = 0; status = smb_raw_read(cli->tree, &io); CHECK_STATUS(status, NT_STATUS_OK); CHECK_VALUE(io.readbraw.out.nread, 0); -#endif done: cli_close(cli->tree, fnum); diff --git a/source4/torture/raw/search.c b/source4/torture/raw/search.c index 57c6eb2bb9..ae5d8c34a8 100644 --- a/source4/torture/raw/search.c +++ b/source4/torture/raw/search.c @@ -197,11 +197,11 @@ static BOOL test_one_file(struct cli_state *cli, TALLOC_CTX *mem_ctx) #define CHECK_TIME(name, sname1, field1, v, sname2, field2) do { \ s = find(name); \ if (s) { \ - if (s->sname1.field1 != (~1 & nt_time_to_unix(&v.sname2.out.field2))) { \ + if (s->sname1.field1 != (~1 & nt_time_to_unix(v.sname2.out.field2))) { \ printf("(%d) %s/%s [%s] != %s/%s [%s]\n", \ __LINE__, \ #sname1, #field1, timestring(mem_ctx, s->sname1.field1), \ - #sname2, #field2, nt_time_string(mem_ctx, &v.sname2.out.field2)); \ + #sname2, #field2, nt_time_string(mem_ctx, v.sname2.out.field2)); \ ret = False; \ } \ }} while (0) @@ -209,11 +209,11 @@ static BOOL test_one_file(struct cli_state *cli, TALLOC_CTX *mem_ctx) #define CHECK_NTTIME(name, sname1, field1, v, sname2, field2) do { \ s = find(name); \ if (s) { \ - if (memcmp(&s->sname1.field1, &v.sname2.out.field2, sizeof(NTTIME))) { \ + if (s->sname1.field1 != v.sname2.out.field2) { \ printf("(%d) %s/%s [%s] != %s/%s [%s]\n", \ __LINE__, \ - #sname1, #field1, nt_time_string(mem_ctx, &s->sname1.field1), \ - #sname2, #field2, nt_time_string(mem_ctx, &v.sname2.out.field2)); \ + #sname1, #field1, nt_time_string(mem_ctx, s->sname1.field1), \ + #sname2, #field2, nt_time_string(mem_ctx, v.sname2.out.field2)); \ ret = False; \ } \ }} while (0) diff --git a/source4/torture/raw/setfileinfo.c b/source4/torture/raw/setfileinfo.c index 3a49c8baff..fb2e0633e8 100644 --- a/source4/torture/raw/setfileinfo.c +++ b/source4/torture/raw/setfileinfo.c @@ -152,13 +152,13 @@ BOOL torture_raw_sfileinfo(int dummy) #define CHECK_TIME(call, stype, field, value) do { \ CHECK1(call); \ - if (NT_STATUS_IS_OK(status) && NT_STATUS_IS_OK(status2) && nt_time_to_unix(&finfo2.stype.out.field) != value) { \ + if (NT_STATUS_IS_OK(status) && NT_STATUS_IS_OK(status2) && nt_time_to_unix(finfo2.stype.out.field) != value) { \ printf("(%d) %s - %s/%s should be 0x%x - 0x%x\n", __LINE__, \ call_name, #stype, #field, \ (uint_t)value, \ - (uint_t)nt_time_to_unix(&finfo2.stype.out.field)); \ + (uint_t)nt_time_to_unix(finfo2.stype.out.field)); \ printf("\t%s", timestring(mem_ctx, value)); \ - printf("\t%s\n", nt_time_string(mem_ctx, &finfo2.stype.out.field)); \ + printf("\t%s\n", nt_time_string(mem_ctx, finfo2.stype.out.field)); \ dump_all_info(mem_ctx, &finfo1); \ }} while (0) diff --git a/source4/torture/raw/write.c b/source4/torture/raw/write.c index eb20fe3b84..18c992b8c6 100644 --- a/source4/torture/raw/write.c +++ b/source4/torture/raw/write.c @@ -187,7 +187,7 @@ static BOOL test_write(struct cli_state *cli, TALLOC_CTX *mem_ctx) status = smb_raw_write(cli->tree, &io); CHECK_STATUS(status, NT_STATUS_OK); CHECK_VALUE(io.write.out.nwritten, 4000); - CHECK_ALL_INFO(io.write.in.count + (SMB_BIG_UINT)io.write.in.offset, size); + CHECK_ALL_INFO(io.write.in.count + (uint64_t)io.write.in.offset, size); memset(buf, 0, maxsize); if (cli_read(cli->tree, fnum, buf, io.write.in.offset, 4000) != 4000) { @@ -337,7 +337,7 @@ static BOOL test_writex(struct cli_state *cli, TALLOC_CTX *mem_ctx) status = smb_raw_write(cli->tree, &io); CHECK_STATUS(status, NT_STATUS_OK); CHECK_VALUE(io.writex.out.nwritten, 4000); - CHECK_ALL_INFO(io.writex.in.count + (SMB_BIG_UINT)io.writex.in.offset, size); + CHECK_ALL_INFO(io.writex.in.count + (uint64_t)io.writex.in.offset, size); memset(buf, 0, maxsize); if (cli_read(cli->tree, fnum, buf, io.writex.in.offset, 4000) != 4000) { @@ -352,12 +352,12 @@ static BOOL test_writex(struct cli_state *cli, TALLOC_CTX *mem_ctx) setup_buffer(buf, seed+1, maxsize); io.writex.in.fnum = fnum; io.writex.in.count = 4000; - io.writex.in.offset = ((SMB_BIG_UINT)1) << i; + io.writex.in.offset = ((uint64_t)1) << i; io.writex.in.data = buf; status = smb_raw_write(cli->tree, &io); CHECK_STATUS(status, NT_STATUS_OK); CHECK_VALUE(io.writex.out.nwritten, 4000); - CHECK_ALL_INFO(io.writex.in.count + (SMB_BIG_UINT)io.writex.in.offset, size); + CHECK_ALL_INFO(io.writex.in.count + (uint64_t)io.writex.in.offset, size); memset(buf, 0, maxsize); if (cli_read(cli->tree, fnum, buf, io.writex.in.offset, 4000) != 4000) { @@ -500,7 +500,7 @@ static BOOL test_writeunlock(struct cli_state *cli, TALLOC_CTX *mem_ctx) status = smb_raw_write(cli->tree, &io); CHECK_STATUS(status, NT_STATUS_OK); CHECK_VALUE(io.writeunlock.out.nwritten, 4000); - CHECK_ALL_INFO(io.writeunlock.in.count + (SMB_BIG_UINT)io.writeunlock.in.offset, size); + CHECK_ALL_INFO(io.writeunlock.in.count + (uint64_t)io.writeunlock.in.offset, size); memset(buf, 0, maxsize); if (cli_read(cli->tree, fnum, buf, io.writeunlock.in.offset, 4000) != 4000) { @@ -650,7 +650,7 @@ static BOOL test_writeclose(struct cli_state *cli, TALLOC_CTX *mem_ctx) status = smb_raw_write(cli->tree, &io); CHECK_STATUS(status, NT_STATUS_OK); CHECK_VALUE(io.writeclose.out.nwritten, 4000); - CHECK_ALL_INFO(io.writeclose.in.count + (SMB_BIG_UINT)io.writeclose.in.offset, size); + CHECK_ALL_INFO(io.writeclose.in.count + (uint64_t)io.writeclose.in.offset, size); fnum = cli_open(cli->tree, fname, O_RDWR, DENY_NONE); io.writeclose.in.fnum = fnum; |