From 7588a01cb6d387440d778e3bd77225b287cf48bc Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 4 Jan 2005 23:27:12 +0000 Subject: r4520: added a enum test function to the echo pipe (This used to be commit f9e0aa1ab1faac039893db241819907c9c4bb510) --- source4/torture/rpc/echo.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'source4/torture/rpc') diff --git a/source4/torture/rpc/echo.c b/source4/torture/rpc/echo.c index c141d4be9c..5db438afd0 100644 --- a/source4/torture/rpc/echo.c +++ b/source4/torture/rpc/echo.c @@ -262,6 +262,41 @@ static BOOL test_sleep(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) } #endif + +/* + test enum handling +*/ +static BOOL test_enum(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) +{ + NTSTATUS status; + struct echo_TestEnum r; + BOOL ret = True; + enum echo_Enum1 v = ECHO_ENUM1; + struct echo_Enum2 e2; + union echo_Enum3 e3; + + r.in.foo1 = &v; + r.in.foo2 = &e2; + r.in.foo3 = &e3; + r.out.foo1 = &v; + r.out.foo2 = &e2; + r.out.foo3 = &e3; + + e2.e1 = 76; + e2.e2 = ECHO_ENUM1_32; + e3.e1 = ECHO_ENUM2; + + printf("\nTesting TestEnum\n"); + status = dcerpc_echo_TestEnum(p, mem_ctx, &r); + if (!NT_STATUS_IS_OK(status)) { + printf("TestEnum failed - %s\n", nt_errstr(status)); + ret = False; + } + + return ret; +} + + BOOL torture_rpc_echo(void) { NTSTATUS status; @@ -303,6 +338,10 @@ BOOL torture_rpc_echo(void) ret = False; } + if (!test_enum(p, mem_ctx)) { + ret = False; + } + /* if (!test_sleep(p, mem_ctx)) { ret = False; -- cgit