From 0ecf01a1377352477a844cbf4fefb5271d0e8a32 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 13 Feb 2014 18:00:36 +0100 Subject: s4:librpc/tests: add more no transport tests Signed-off-by: Stefan Metzmacher Reviewed-by: Andrew Bartlett --- source4/librpc/tests/binding_string.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/source4/librpc/tests/binding_string.c b/source4/librpc/tests/binding_string.c index a790616e7d..bc5d06e47c 100644 --- a/source4/librpc/tests/binding_string.c +++ b/source4/librpc/tests/binding_string.c @@ -218,9 +218,9 @@ static bool test_parse_check_results(struct torture_context *tctx) return true; } -static bool test_no_transport(struct torture_context *tctx) +static bool test_no_transport(struct torture_context *tctx, const void *test_data) { - const char *binding = "somehost"; + const char *binding = test_data; struct dcerpc_binding *b; enum dcerpc_transport_t transport; const char *s; @@ -241,6 +241,15 @@ static bool test_no_transport(struct torture_context *tctx) return true; } +static const char *test_no_strings[] = { + "port75.example.com", + "port75.example.com[75]", + "127.0.0.1", + "127.0.0.1[75]", + "127.0.0.1[,target_hostname=port75.example.com]", + "127.0.0.1[75,target_hostname=port75.example.com]", +}; + struct torture_suite *torture_local_binding_string(TALLOC_CTX *mem_ctx) { int i; @@ -252,7 +261,11 @@ struct torture_suite *torture_local_binding_string(TALLOC_CTX *mem_ctx) test_strings[i]); } - torture_suite_add_simple_test(suite, "no transport",test_no_transport); + for (i = 0; i < ARRAY_SIZE(test_no_strings); i++) { + torture_suite_add_simple_tcase_const(suite, test_no_strings[i], + test_no_transport, + test_no_strings[i]); + } torture_suite_add_simple_test(suite, "parsing results", test_parse_check_results); -- cgit