ndr_push_flags_fn_t push_fn,
ndr_print_fn_t print_fn,
ndr_print_function_t print_function,
+ const char *db_name,
DATA_BLOB db,
size_t struct_size,
int ndr_flags,
int flags,
+ const char *check_fn_name,
bool (*check_fn) (struct torture_context *ctx, void *data))
{
struct torture_test *test;
test = talloc(tcase, struct torture_test);
- test->name = talloc_strdup(test, name);
- test->description = NULL;
+ test->name = talloc_strdup(test, check_fn_name);
+ test->description = talloc_asprintf(test, "db:%s",
+ db_name);
test->run = wrap_ndr_pullpush_test;
data = talloc_zero(test, struct ndr_pull_test_data);
const char *name,
ndr_pull_flags_fn_t pull_fn,
ndr_print_function_t print_function,
+ const char *db_in_name,
DATA_BLOB db_in,
+ const char *db_out_name,
DATA_BLOB db_out,
size_t struct_size,
int flags,
+ const char *check_fn_name,
bool (*check_fn) (struct torture_context *ctx, void *data))
{
struct torture_test *test;
test = talloc(tcase, struct torture_test);
- test->name = talloc_strdup(test, name);
- test->description = NULL;
+ test->name = talloc_strdup(test, check_fn_name);
+ test->description = talloc_asprintf(test, "db_in:%s db_out:%s",
+ db_in_name,
+ db_out_name);
test->run = wrap_ndr_inout_pull_test;
data = talloc_zero(test, struct ndr_pull_test_data);
data->data = db_out;
struct torture_suite *suite,
const char *name,
ndr_pull_flags_fn_t pull_fn,
+ const char *db_name,
DATA_BLOB db,
size_t struct_size,
int ndr_flags,
test = talloc(tcase, struct torture_test);
- test->name = talloc_strdup(test, name);
+ test->name = talloc_strdup(test, db_name);
test->description = NULL;
test->run = wrap_ndr_pull_invalid_data_test;
ndr_push_flags_fn_t push_fn,
ndr_print_fn_t print_fn,
ndr_print_function_t print_function,
+ const char *db_name,
DATA_BLOB db,
size_t struct_size,
int ndr_flags,
int flags,
+ const char *check_fn_name,
bool (*check_fn) (struct torture_context *, void *data));
_PUBLIC_ struct torture_test *_torture_suite_add_ndr_pull_inout_test(
const char *name,
ndr_pull_flags_fn_t pull_fn,
ndr_print_function_t print_fn,
+ const char *db_in_name,
DATA_BLOB db_in,
+ const char *db_out_name,
DATA_BLOB db_out,
size_t struct_size,
int flags,
+ const char *check_fn_name,
bool (*check_fn) (struct torture_context *ctx, void *data));
_PUBLIC_ struct torture_test *_torture_suite_add_ndr_pull_invalid_data_test(
struct torture_suite *suite,
const char *name,
ndr_pull_flags_fn_t pull_fn,
+ const char *db_name,
DATA_BLOB db,
size_t struct_size,
int ndr_flags,
NULL, \
(ndr_print_fn_t)ndr_print_ ## name, \
NULL, \
+ #data, \
data_blob_const(data, sizeof(data)), \
sizeof(struct name), \
NDR_SCALARS|NDR_BUFFERS, 0, \
+ #check_fn, \
check_fn_anon); \
} while(0)
suite, \
#name, \
(ndr_pull_flags_fn_t)ndr_pull_ ## name, \
+ #data, \
data_blob_const(data, sizeof(data)), \
sizeof(struct name), \
NDR_SCALARS|NDR_BUFFERS, 0, \
NULL, \
NULL, \
(ndr_print_function_t)ndr_print_ ## name, \
+ #data, \
data_blob_const(data, sizeof(data)), \
sizeof(struct name), \
flags, 0, \
+ #check_fn, \
check_fn_anon); \
} while(0)
NULL, \
NULL, \
(ndr_print_function_t)ndr_print_ ## name, \
+ #data, \
data_blob_const(data, sizeof(data)), \
sizeof(struct name), \
flags, flags2, \
+ #check_fn, \
check_fn_anon); \
} while(0)
(ndr_push_flags_fn_t)ndr_push_ ## name, \
(ndr_print_fn_t)ndr_print_ ## name, \
NULL, \
+ #data, \
data_blob_const(data, sizeof(data)), \
sizeof(struct name), \
NDR_SCALARS|NDR_BUFFERS, 0, \
+ #check_fn, \
check_fn_anon); \
} while(0)
(ndr_push_flags_fn_t)ndr_push_ ## name, \
(ndr_print_fn_t)ndr_print_ ## name, \
NULL, \
+ #data_blob, \
data_blob, \
sizeof(struct name), \
NDR_SCALARS|NDR_BUFFERS, 0, \
+ #check_fn, \
check_fn_anon); \
} while(0)
(ndr_push_flags_fn_t)ndr_push_ ## name, \
(ndr_print_fn_t)ndr_print_ ## name, \
NULL, \
+ #b64, \
base64_decode_data_blob_talloc(suite, b64), \
sizeof(struct name), \
NDR_SCALARS|NDR_BUFFERS, 0, \
+ #check_fn, \
check_fn_anon); \
} while(0)
(ndr_push_flags_fn_t)ndr_push_ ## name, \
NULL, \
(ndr_print_function_t)ndr_print_ ## name, \
+ #data, \
data_blob_const(data, sizeof(data)), \
sizeof(struct name), \
flags, flags2, \
+ #check_fn, \
check_fn_anon); \
} while(0)
_torture_suite_add_ndr_pull_inout_test(suite, #name "_INOUT", \
(ndr_pull_flags_fn_t)ndr_pull_ ## name, \
(ndr_print_function_t)ndr_print_ ## name, \
+ #data_in, \
data_blob_const(data_in, sizeof(data_in)), \
+ #data_out, \
data_blob_const(data_out, sizeof(data_out)), \
sizeof(struct name), \
0, \
+ #check_fn_out, \
check_fn_anon); \
} while(0)
_torture_suite_add_ndr_pull_inout_test(suite, #name "_INOUT_" #flags, \
(ndr_pull_flags_fn_t)ndr_pull_ ## name, \
(ndr_print_function_t)ndr_print_ ## name, \
+ #data_in, \
data_blob_const(data_in, sizeof(data_in)), \
+ #data_out, \
data_blob_const(data_out, sizeof(data_out)), \
sizeof(struct name), \
flags, \
+ #check_fn_out, \
check_fn_anon); \
} while(0)