advapi32/tests: Fixed -Wsign-compare warnings in security tests (try 2)
Marko Nikolic
grkoma at gmail.com
Thu Jun 17 17:11:37 CDT 2010
Fixed test failures in 64-bit build.
---
dlls/advapi32/tests/security.c | 36 ++++++++++++++++++------------------
1 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c
index 029568c..6ceb33e 100644
--- a/dlls/advapi32/tests/security.c
+++ b/dlls/advapi32/tests/security.c
@@ -656,7 +656,7 @@ static void test_lookupPrivilegeValue(void)
{ "SeCreateGlobalPrivilege", SE_CREATE_GLOBAL_PRIVILEGE },
};
BOOL (WINAPI *pLookupPrivilegeValueA)(LPCSTR, LPCSTR, PLUID);
- int i;
+ unsigned int i;
LUID luid;
BOOL ret;
@@ -919,7 +919,7 @@ static void test_AccessCheck(void)
err = GetLastError();
ok(!ret && err == ERROR_INVALID_SECURITY_DESCR, "AccessCheck should have "
"failed with ERROR_INVALID_SECURITY_DESCR, instead of %d\n", err);
- ok(Access == 0xdeadbeef && AccessStatus == 0xdeadbeef,
+ ok(Access == 0xdeadbeef && (unsigned)AccessStatus == 0xdeadbeef,
"Access and/or AccessStatus were changed!\n");
/* Set owner and group */
@@ -936,7 +936,7 @@ static void test_AccessCheck(void)
err = GetLastError();
ok(!ret && err == ERROR_GENERIC_NOT_MAPPED, "AccessCheck should have failed "
"with ERROR_GENERIC_NOT_MAPPED, instead of %d\n", err);
- ok(Access == 0xdeadbeef && AccessStatus == 0xdeadbeef,
+ ok(Access == 0xdeadbeef && (unsigned)AccessStatus == 0xdeadbeef,
"Access and/or AccessStatus were changed!\n");
/* Generic access mask - no privilegeset buffer */
@@ -947,7 +947,7 @@ static void test_AccessCheck(void)
err = GetLastError();
ok(!ret && err == ERROR_NOACCESS, "AccessCheck should have failed "
"with ERROR_NOACCESS, instead of %d\n", err);
- ok(Access == 0xdeadbeef && AccessStatus == 0xdeadbeef,
+ ok(Access == 0xdeadbeef && (unsigned)AccessStatus == 0xdeadbeef,
"Access and/or AccessStatus were changed!\n");
/* Generic access mask - no returnlength */
@@ -958,7 +958,7 @@ static void test_AccessCheck(void)
err = GetLastError();
ok(!ret && err == ERROR_NOACCESS, "AccessCheck should have failed "
"with ERROR_NOACCESS, instead of %d\n", err);
- ok(Access == 0xdeadbeef && AccessStatus == 0xdeadbeef,
+ ok(Access == 0xdeadbeef && (unsigned)AccessStatus == 0xdeadbeef,
"Access and/or AccessStatus were changed!\n");
/* Generic access mask - no privilegeset buffer, no returnlength */
@@ -969,7 +969,7 @@ static void test_AccessCheck(void)
err = GetLastError();
ok(!ret && err == ERROR_NOACCESS, "AccessCheck should have failed "
"with ERROR_NOACCESS, instead of %d\n", err);
- ok(Access == 0xdeadbeef && AccessStatus == 0xdeadbeef,
+ ok(Access == 0xdeadbeef && (unsigned)AccessStatus == 0xdeadbeef,
"Access and/or AccessStatus were changed!\n");
/* sd with no dacl present */
@@ -991,7 +991,7 @@ static void test_AccessCheck(void)
err = GetLastError();
ok(!ret && err == ERROR_NOACCESS, "AccessCheck should have failed "
"with ERROR_NOACCESS, instead of %d\n", err);
- ok(Access == 0xdeadbeef && AccessStatus == 0xdeadbeef,
+ ok(Access == 0xdeadbeef && (unsigned)AccessStatus == 0xdeadbeef,
"Access and/or AccessStatus were changed!\n");
if(pNtAccessCheck)
@@ -1006,7 +1006,7 @@ static void test_AccessCheck(void)
"NtAccessCheck should have failed with STATUS_ACCESS_VIOLATION, got %x\n", ntret);
ok(err == 0xdeadbeef,
"NtAccessCheck shouldn't set last error, got %d\n", err);
- ok(Access == 0xdeadbeef && ntAccessStatus == 0xdeadbeef,
+ ok(Access == 0xdeadbeef && (unsigned)ntAccessStatus == 0xdeadbeef,
"Access and/or AccessStatus were changed!\n");
/* Generic access mask - no returnlength */
@@ -1019,7 +1019,7 @@ static void test_AccessCheck(void)
"NtAccessCheck should have failed with STATUS_ACCESS_VIOLATION, got %x\n", ntret);
ok(err == 0xdeadbeef,
"NtAccessCheck shouldn't set last error, got %d\n", err);
- ok(Access == 0xdeadbeef && ntAccessStatus == 0xdeadbeef,
+ ok(Access == 0xdeadbeef && (unsigned)ntAccessStatus == 0xdeadbeef,
"Access and/or AccessStatus were changed!\n");
/* Generic access mask - no privilegeset buffer, no returnlength */
@@ -1032,7 +1032,7 @@ static void test_AccessCheck(void)
"NtAccessCheck should have failed with STATUS_ACCESS_VIOLATION, got %x\n", ntret);
ok(err == 0xdeadbeef,
"NtAccessCheck shouldn't set last error, got %d\n", err);
- ok(Access == 0xdeadbeef && ntAccessStatus == 0xdeadbeef,
+ ok(Access == 0xdeadbeef && (unsigned)ntAccessStatus == 0xdeadbeef,
"Access and/or AccessStatus were changed!\n");
}
else
@@ -1420,7 +1420,7 @@ static void test_CreateWellKnownSid(void)
PSID domainsid, sid;
DWORD size, error;
BOOL ret;
- int i;
+ unsigned int i;
if (!pCreateWellKnownSid)
{
@@ -1466,13 +1466,13 @@ static void test_CreateWellKnownSid(void)
cb = sizeof(sid_buffer);
if (!pCreateWellKnownSid(i, domainsid, sid_buffer, &cb))
{
- skip("Well known SIDs starting from %d are not implemented\n", i);
+ skip("Well known SIDs starting from %u are not implemented\n", i);
break;
}
}
cb = sizeof(sid_buffer);
- ok(pCreateWellKnownSid(i, value->without_domain ? NULL : domainsid, sid_buffer, &cb), "Couldn't create well known sid %d\n", i);
+ ok(pCreateWellKnownSid(i, value->without_domain ? NULL : domainsid, sid_buffer, &cb), "Couldn't create well known sid %u\n", i);
expect_eq(GetSidLengthRequired(*GetSidSubAuthorityCount(sid_buffer)), cb, DWORD, "%d");
ok(IsValidSid(sid_buffer), "The sid is not valid\n");
ok(pConvertSidToStringSidA(sid_buffer, &str), "Couldn't convert SID to string\n");
@@ -1484,9 +1484,9 @@ static void test_CreateWellKnownSid(void)
{
char buf2[SECURITY_MAX_SID_SIZE];
cb = sizeof(buf2);
- ok(pCreateWellKnownSid(i, domainsid, buf2, &cb), "Couldn't create well known sid %d with optional domain\n", i);
+ ok(pCreateWellKnownSid(i, domainsid, buf2, &cb), "Couldn't create well known sid %u with optional domain\n", i);
expect_eq(GetSidLengthRequired(*GetSidSubAuthorityCount(sid_buffer)), cb, DWORD, "%d");
- ok(memcmp(buf2, sid_buffer, cb) == 0, "SID create with domain is different than without (%d)\n", i);
+ ok(memcmp(buf2, sid_buffer, cb) == 0, "SID create with domain is different than without (%u)\n", i);
}
}
@@ -2674,7 +2674,7 @@ static void test_ConvertStringSecurityDescriptor(void)
BOOL ret;
PSECURITY_DESCRIPTOR pSD;
static const WCHAR Blank[] = { 0 };
- int i;
+ unsigned int i;
static const struct
{
const char *sidstring;
@@ -2733,11 +2733,11 @@ static void test_ConvertStringSecurityDescriptor(void)
ret = pConvertStringSecurityDescriptorToSecurityDescriptorA(
cssd[i].sidstring, cssd[i].revision, &pSD, NULL);
GLE = GetLastError();
- ok(ret == cssd[i].ret, "(%02d) Expected %s (%d)\n", i, cssd[i].ret ? "success" : "failure", GLE);
+ ok(ret == cssd[i].ret, "(%02u) Expected %s (%d)\n", i, cssd[i].ret ? "success" : "failure", GLE);
if (!cssd[i].ret)
ok(GLE == cssd[i].GLE ||
(cssd[i].altGLE && GLE == cssd[i].altGLE),
- "(%02d) Unexpected last error %d\n", i, GLE);
+ "(%02u) Unexpected last error %d\n", i, GLE);
if (ret)
LocalFree(pSD);
}
--
1.7.0.4
More information about the wine-patches
mailing list