advapi32/tests: Skip tests for ACL file info if ACL info not stored (try 2)

Austin Lund austin.lund at gmail.com
Wed Nov 18 02:54:29 CST 2009


-------------- next part --------------
From 29e1a4b9babccaf28575b8ae982ddb405e687b4d Mon Sep 17 00:00:00 2001
From: Austin Lund <austin.lund at gmail.com>
Date: Wed, 18 Nov 2009 18:51:21 +1000
Subject: [PATCH] advapi32/tests: Skip tests for ACL file info if ACL info not stored

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

diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c
index a327c53..959dfdf 100644
--- a/dlls/advapi32/tests/security.c
+++ b/dlls/advapi32/tests/security.c
@@ -3127,6 +3127,9 @@ static void test_GetSecurityInfo(void)
     PSID owner, group;
     PACL dacl;
     DWORD ret;
+    TCHAR volumepathname[50];
+    BOOL testacl = FALSE;
+    DWORD filesystemflags;
 
     if (!pGetSecurityInfo)
     {
@@ -3143,6 +3146,13 @@ static void test_GetSecurityInfo(void)
         return;
     }
 
+    if (GetVolumePathName(myARGV[0], volumepathname, 50) &&
+        GetVolumeInformation(volumepathname, NULL, 0, NULL, NULL, &filesystemflags, NULL, 0) &&
+        (filesystemflags & FILE_PERSISTENT_ACLS))
+    {
+        testacl = TRUE;
+    }
+
     ret = pGetSecurityInfo(obj, SE_FILE_OBJECT,
                           OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION,
                           &owner, &group, &dacl, NULL, &sd);
@@ -3156,8 +3166,10 @@ 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 (testacl) {
+        ok(dacl != NULL, "GetSecurityInfo\n");
+        ok(IsValidAcl(dacl), "GetSecurityInfo\n");
+    }
 
     LocalFree(sd);
 
@@ -3176,8 +3188,10 @@ 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 (testacl) {
+        ok(dacl != NULL, "GetSecurityInfo\n");
+        ok(IsValidAcl(dacl), "GetSecurityInfo\n");
+    }
 
     CloseHandle(obj);
 }
-- 
1.6.3.3


More information about the wine-patches mailing list