mirror of
https://github.com/samba-team/samba.git
synced 2025-01-10 01:18:15 +03:00
Fix number of arguments for file_load() functions.
This commit is contained in:
parent
99fba0ca69
commit
3994c42f19
@ -42,7 +42,7 @@ static bool test_file_load_save(struct torture_context *tctx)
|
||||
torture_assert_file_contains_text(tctx, TEST_FILENAME, TEST_DATA,
|
||||
"file contents");
|
||||
|
||||
data = file_load(TEST_FILENAME, &len, mem_ctx);
|
||||
data = file_load(TEST_FILENAME, &len, 0, mem_ctx);
|
||||
torture_assert(tctx, data, "loading file");
|
||||
|
||||
torture_assert_int_equal(tctx, len, strlen(TEST_DATA), "Length");
|
||||
|
@ -267,7 +267,7 @@ void torture_result(struct torture_context *test,
|
||||
char *__got; \
|
||||
const char *__expected = (expected); \
|
||||
size_t __size; \
|
||||
__got = file_load(filename, &__size, torture_ctx); \
|
||||
__got = file_load(filename, &__size, 0, torture_ctx); \
|
||||
if (__got == NULL) { \
|
||||
torture_result(torture_ctx, TORTURE_FAIL, \
|
||||
__location__": unable to open %s: %s\n", \
|
||||
@ -288,7 +288,7 @@ void torture_result(struct torture_context *test,
|
||||
#define torture_assert_file_contains(torture_ctx,filename,expected,cmt)\
|
||||
do { const char *__got, *__expected = (expected); \
|
||||
size_t __size; \
|
||||
__got = file_load(filename, *size, torture_ctx); \
|
||||
__got = file_load(filename, *size, 0, torture_ctx); \
|
||||
if (strcmp_safe(__got, __expected) != 0) { \
|
||||
torture_result(torture_ctx, TORTURE_FAIL, \
|
||||
__location__": %s contained:\n%sExpected: %s%s\n", \
|
||||
|
@ -291,11 +291,7 @@ static void ndrdump_data(uint8_t *d, uint32_t l, bool force)
|
||||
exit(1);
|
||||
}
|
||||
|
||||
#if (_SAMBA_BUILD_ >= 4)
|
||||
data = (uint8_t *)file_load(ctx_filename, &size, mem_ctx);
|
||||
#else
|
||||
data = (uint8_t *)file_load(ctx_filename, &size, 0);
|
||||
#endif
|
||||
data = (uint8_t *)file_load(ctx_filename, &size, 0, mem_ctx);
|
||||
if (!data) {
|
||||
perror(ctx_filename);
|
||||
exit(1);
|
||||
@ -322,11 +318,7 @@ static void ndrdump_data(uint8_t *d, uint32_t l, bool force)
|
||||
}
|
||||
|
||||
if (filename)
|
||||
#if (_SAMBA_BUILD_ >= 4)
|
||||
data = (uint8_t *)file_load(filename, &size, mem_ctx);
|
||||
#else
|
||||
data = (uint8_t *)file_load(filename, &size, 0);
|
||||
#endif
|
||||
data = (uint8_t *)file_load(filename, &size, 0, mem_ctx);
|
||||
else
|
||||
data = (uint8_t *)stdin_load(mem_ctx, &size);
|
||||
|
||||
|
@ -379,7 +379,7 @@ static bool torture_pac_saved_check(struct torture_context *tctx)
|
||||
|
||||
pac_file = torture_setting_string(tctx, "pac_file", NULL);
|
||||
if (pac_file) {
|
||||
tmp_blob.data = (uint8_t *)file_load(pac_file, &tmp_blob.length, mem_ctx);
|
||||
tmp_blob.data = (uint8_t *)file_load(pac_file, &tmp_blob.length, 0, mem_ctx);
|
||||
torture_comment(tctx, "(saved test) Loaded pac of size %ld from %s\n", (long)tmp_blob.length, pac_file);
|
||||
} else {
|
||||
tmp_blob = data_blob_talloc(mem_ctx, saved_pac, sizeof(saved_pac));
|
||||
|
@ -448,7 +448,7 @@ static int init_benchrw_params(struct torture_context *tctx,
|
||||
p = torture_setting_string(tctx, "unclist", NULL);
|
||||
if (p) {
|
||||
char *h, *s;
|
||||
unc_list = file_lines_load(p, &num_unc_names, NULL);
|
||||
unc_list = file_lines_load(p, &num_unc_names, 0, NULL);
|
||||
if (!unc_list || num_unc_names <= 0) {
|
||||
torture_comment(tctx, "Failed to load unc names list "
|
||||
"from '%s'\n", p);
|
||||
|
@ -137,7 +137,7 @@ static struct smbcli_state *connect_one(struct event_context *ev,
|
||||
p = lp_parm_string(lp_ctx, NULL, "torture", "unclist");
|
||||
if (p) {
|
||||
char *h, *s;
|
||||
unc_list = file_lines_load(p, &num_unc_names, NULL);
|
||||
unc_list = file_lines_load(p, &num_unc_names, 0, NULL);
|
||||
if (!unc_list || num_unc_names <= 0) {
|
||||
printf("Failed to load unc names list from '%s'\n", p);
|
||||
exit(1);
|
||||
|
@ -514,7 +514,7 @@ _PUBLIC_ bool torture_get_conn_index(int conn_index,
|
||||
return true;
|
||||
}
|
||||
|
||||
unc_list = file_lines_load(p, &num_unc_names, NULL);
|
||||
unc_list = file_lines_load(p, &num_unc_names, 0, NULL);
|
||||
if (!unc_list || num_unc_names <= 0) {
|
||||
DEBUG(0,("Failed to load unc names list from '%s'\n", p));
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user