From 763c4bc9acc0e9162bcb7c8e487522fa62aedae6 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 14 Apr 2004 01:09:41 +0000 Subject: r204: Turns out that the string in the SEARCH unix_info level is that rare thing, a non-length string (ie. not a WIRE_STRING) but a null terminated char string. There wasn't a good interface to pull that out of a blob (all the string interfaces assumed WIRE_STRINGS). Added a new one, only used for this call. Sucks, I know - but the alternatives suck more. Added tests for some of the unix info returned. Jeremy. (This used to be commit 4d0ed04c54b105789ffd32334c3b0e544f02418c) --- source4/torture/raw/search.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'source4/torture/raw/search.c') diff --git a/source4/torture/raw/search.c b/source4/torture/raw/search.c index 7308533fda..57c6eb2bb9 100644 --- a/source4/torture/raw/search.c +++ b/source4/torture/raw/search.c @@ -257,6 +257,19 @@ static BOOL test_one_file(struct cli_state *cli, TALLOC_CTX *mem_ctx) ret = False; \ } \ }} while (0) + +#define CHECK_UNIX_NAME(name, sname1, field1, fname, flags) do { \ + s = find(name); \ + if (s) { \ + if (!s->sname1.field1 || \ + strcmp(s->sname1.field1, fname)) { \ + printf("(%d) %s/%s [%s] != %s\n", \ + __LINE__, \ + #sname1, #field1, s->sname1.field1, \ + fname); \ + ret = False; \ + } \ + }} while (0) /* check that all the results are as expected */ CHECK_VAL("SEARCH", search, attrib, all_info, all_info, attrib); @@ -336,6 +349,7 @@ static BOOL test_one_file(struct cli_state *cli, TALLOC_CTX *mem_ctx) CHECK_NAME("BOTH_DIRECTORY_INFO", both_directory_info, name, fname+1, STR_TERMINATE_ASCII); CHECK_NAME("ID_FULL_DIRECTORY_INFO", id_full_directory_info, name, fname+1, STR_TERMINATE_ASCII); CHECK_NAME("ID_BOTH_DIRECTORY_INFO", id_both_directory_info, name, fname+1, STR_TERMINATE_ASCII); + CHECK_UNIX_NAME("UNIX_INFO", unix_info, name, fname+1, STR_TERMINATE_ASCII); CHECK_VAL("ID_FULL_DIRECTORY_INFO", id_full_directory_info, file_id, internal_info, internal_information, file_id); CHECK_VAL("ID_BOTH_DIRECTORY_INFO", id_both_directory_info, file_id, internal_info, internal_information, file_id); -- cgit