summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-08-24 11:12:16 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:34:30 -0500
commit26bae69bb973853fd98d30e9fef9a76cb0146262 (patch)
treebe76637203100af3ac1c49c9b8177329cb71cb6e
parent3eb52c6cd61ae8117f3380050c0ef3be8ff841b4 (diff)
downloadsamba-26bae69bb973853fd98d30e9fef9a76cb0146262.tar.gz
samba-26bae69bb973853fd98d30e9fef9a76cb0146262.tar.bz2
samba-26bae69bb973853fd98d30e9fef9a76cb0146262.zip
r9575: more automatic cleanup code in winreg test
(This used to be commit 0e30c80a53af45ee9112513c02a6a231e8b1a133)
-rw-r--r--source4/torture/rpc/winreg.c9
1 files changed, 7 insertions, 2 deletions
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;
}