summaryrefslogtreecommitdiff
path: root/source4/torture/raw
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2004-04-14 01:09:41 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:51:16 -0500
commit763c4bc9acc0e9162bcb7c8e487522fa62aedae6 (patch)
treeffae228aeff71474e37b484c1cfd61b5213c5a01 /source4/torture/raw
parent6f47ce8b6c2e78d02d08b975488242ba93e52a4b (diff)
downloadsamba-763c4bc9acc0e9162bcb7c8e487522fa62aedae6.tar.gz
samba-763c4bc9acc0e9162bcb7c8e487522fa62aedae6.tar.bz2
samba-763c4bc9acc0e9162bcb7c8e487522fa62aedae6.zip
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)
Diffstat (limited to 'source4/torture/raw')
-rw-r--r--source4/torture/raw/search.c14
1 files changed, 14 insertions, 0 deletions
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);