[PATCH] advapi32/tests: Skip tests for ACL file info if ACL info not stored

Austin Lund austin.lund at gmail.com
Fri Nov 13 06:18:05 CST 2009


-------------- next part --------------
From e4e94f505eeb97f26518bb9dff5e2668971f87ee Mon Sep 17 00:00:00 2001
From: Austin Lund <austin.lund at gmail.com>
Date: Fri, 13 Nov 2009 22:13:49 +1000
Subject: [PATCH] advapi32/tests: Skip tests for ACL file info if ACL info not stored

---
 dlls/advapi32/tests/security.c |   19 +++++++++++++++----
 1 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c
index b71d64f..129983f 100644
--- a/dlls/advapi32/tests/security.c
+++ b/dlls/advapi32/tests/security.c
@@ -3119,6 +3119,7 @@ static void test_GetSecurityInfo(void)
     PSID owner, group;
     PACL dacl;
     DWORD ret;
+    DWORD FileSystemFlags;
 
     if (!pGetSecurityInfo)
     {
@@ -3135,6 +3136,8 @@ static void test_GetSecurityInfo(void)
         return;
     }
 
+    GetVolumeInformation(NULL, NULL, 0, NULL, NULL, &FileSystemFlags, NULL, 0);
+
     ret = pGetSecurityInfo(obj, SE_FILE_OBJECT,
                           OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION,
                           &owner, &group, &dacl, NULL, &sd);
@@ -3148,8 +3151,12 @@ static void test_GetSecurityInfo(void)
     ok(sd != NULL, "GetSecurityInfo\n");
     ok(owner != NULL, "GetSecurityInfo\n");
     ok(group != NULL, "GetSecurityInfo\n");
-    ok(dacl != NULL, "GetSecurityInfo\n");
-    ok(IsValidAcl(dacl), "GetSecurityInfo\n");
+    if (FileSystemFlags & FILE_PERSISTENT_ACLS) {
+        ok(dacl != NULL, "GetSecurityInfo\n");
+        ok(IsValidAcl(dacl), "GetSecurityInfo\n");
+    }
+    else
+        skip("ACLs not stored - skipping tests\n");
 
     LocalFree(sd);
 
@@ -3168,8 +3175,12 @@ static void test_GetSecurityInfo(void)
     ok(ret == ERROR_SUCCESS, "GetSecurityInfo returned %d\n", ret);
     ok(owner != NULL, "GetSecurityInfo\n");
     ok(group != NULL, "GetSecurityInfo\n");
-    ok(dacl != NULL, "GetSecurityInfo\n");
-    ok(IsValidAcl(dacl), "GetSecurityInfo\n");
+    if (FileSystemFlags & FILE_PERSISTENT_ACLS) {
+        ok(dacl != NULL, "GetSecurityInfo\n");
+        ok(IsValidAcl(dacl), "GetSecurityInfo\n");
+    }
+    else
+        skip("ACLs not stored - skipping tests\n");
 
     CloseHandle(obj);
 }
-- 
1.6.3.3


More information about the wine-patches mailing list