From 26bae69bb973853fd98d30e9fef9a76cb0146262 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 24 Aug 2005 11:12:16 +0000 Subject: r9575: more automatic cleanup code in winreg test (This used to be commit 0e30c80a53af45ee9112513c02a6a231e8b1a133) --- source4/torture/rpc/winreg.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'source4/torture/rpc/winreg.c') diff --git a/source4/torture/rpc/winreg.c b/source4/torture/rpc/winreg.c index 798a069558..404b90a1a9 100644 --- a/source4/torture/rpc/winreg.c +++ b/source4/torture/rpc/winreg.c @@ -329,8 +329,8 @@ static BOOL test_Cleanup(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct winreg_DeleteKey r; r.in.handle = handle; - init_winreg_String(&r.in.key, key); + init_winreg_String(&r.in.key, key); dcerpc_winreg_DeleteKey(p, mem_ctx, &r); return True; @@ -700,6 +700,8 @@ static BOOL test_Open(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, winreg_open_fn return False; } + test_Cleanup(p, mem_ctx, &handle, TEST_KEY1); + test_Cleanup(p, mem_ctx, &handle, TEST_KEY2); test_Cleanup(p, mem_ctx, &handle, TEST_KEY_BASE); if (!test_CreateKey(p, mem_ctx, &handle, TEST_KEY1, NULL)) { @@ -730,7 +732,8 @@ static BOOL test_Open(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, winreg_open_fn ret = False; } - if (deleted && test_OpenKey(p, mem_ctx, &handle, TEST_KEY1, &newhandle)) { + if (created && deleted && + test_OpenKey(p, mem_ctx, &handle, TEST_KEY1, &newhandle)) { printf("DeleteKey failed (OpenKey after Delete didn't work)\n"); ret = False; } @@ -775,6 +778,8 @@ static BOOL test_Open(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, winreg_open_fn ret = False; } + test_Cleanup(p, mem_ctx, &handle, TEST_KEY_BASE); + return ret; } -- cgit