Author: tridge
Date: 2005-08-24 11:12:16 +0000 (Wed, 24 Aug 2005)
New Revision: 9575

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=9575

Log:

more automatic cleanup code in winreg test

Modified:
   branches/SAMBA_4_0/source/torture/rpc/winreg.c


Changeset:
Modified: branches/SAMBA_4_0/source/torture/rpc/winreg.c
===================================================================
--- branches/SAMBA_4_0/source/torture/rpc/winreg.c      2005-08-24 11:01:10 UTC 
(rev 9574)
+++ branches/SAMBA_4_0/source/torture/rpc/winreg.c      2005-08-24 11:12:16 UTC 
(rev 9575)
@@ -329,8 +329,8 @@
        struct winreg_DeleteKey r;
 
        r.in.handle = handle;
+
        init_winreg_String(&r.in.key, key);
-
        dcerpc_winreg_DeleteKey(p, mem_ctx, &r);
 
        return True;
@@ -700,6 +700,8 @@
                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 @@
                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 @@
                ret = False;
        }
 
+       test_Cleanup(p, mem_ctx, &handle, TEST_KEY_BASE);
+
        return ret;
 }
 

Reply via email to