Alexandre Julliard : advapi32/tests: Use lstrlenA instead of strlen in ok() to avoid printf format warnings.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Jun 14 06:49:51 CDT 2006


Module: wine
Branch: refs/heads/master
Commit: 290ddd8e38da0ee984a39539ac150e6c8630f1a8
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=290ddd8e38da0ee984a39539ac150e6c8630f1a8

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Tue Jun 13 13:56:18 2006 +0200

advapi32/tests: Use lstrlenA instead of strlen in ok() to avoid printf format warnings.

---

 dlls/advapi32/tests/crypt.c    |    2 +-
 dlls/advapi32/tests/registry.c |    8 ++++----
 dlls/advapi32/tests/security.c |    2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/dlls/advapi32/tests/crypt.c b/dlls/advapi32/tests/crypt.c
index b55d54b..6b77630 100644
--- a/dlls/advapi32/tests/crypt.c
+++ b/dlls/advapi32/tests/crypt.c
@@ -764,7 +764,7 @@ static void test_set_provider_ex(void)
 
 	result = pCryptGetDefaultProviderA(PROV_RSA_FULL, NULL, CRYPT_MACHINE_DEFAULT, pszProvName, &cbProvName);
 	ok(result && !strcmp(MS_DEF_PROV, pszProvName), "expected %s, got %s\n", MS_DEF_PROV, pszProvName);
-	ok(result && cbProvName==(strlen(MS_DEF_PROV) + 1), "expected %i, got %ld\n", (strlen(MS_DEF_PROV) + 1), cbProvName);
+	ok(result && cbProvName==(strlen(MS_DEF_PROV) + 1), "expected %i, got %ld\n", (lstrlenA(MS_DEF_PROV) + 1), cbProvName);
 
 	LocalFree(pszProvName);
 }
diff --git a/dlls/advapi32/tests/registry.c b/dlls/advapi32/tests/registry.c
index 9fee593..577838d 100644
--- a/dlls/advapi32/tests/registry.c
+++ b/dlls/advapi32/tests/registry.c
@@ -439,7 +439,7 @@ static void test_get_value(void)
     buf[0] = 0; type = 0xdeadbeef; size = sizeof(buf);
     ret = pRegGetValueA(hkey_main, NULL, "TP1_SZ", RRF_RT_REG_SZ, &type, buf, &size);
     ok(ret == ERROR_SUCCESS, "ret=%ld\n", ret);
-    ok(size == strlen(sTestpath1)+1, "strlen(sTestpath1)=%d size=%ld\n", strlen(sTestpath1), size);
+    ok(size == strlen(sTestpath1)+1, "strlen(sTestpath1)=%d size=%ld\n", lstrlenA(sTestpath1), size);
     ok(type == REG_SZ, "type=%ld\n", type);
     ok(!strcmp(sTestpath1, buf), "sTestpath=\"%s\" buf=\"%s\"\n", sTestpath1, buf);
 
@@ -447,7 +447,7 @@ static void test_get_value(void)
     buf[0] = 0; type = 0xdeadbeef; size = sizeof(buf);
     ret = pRegGetValueA(hkey_main, NULL, "TP1_SZ", RRF_RT_REG_SZ|RRF_NOEXPAND, &type, buf, &size);
     ok(ret == ERROR_SUCCESS, "ret=%ld\n", ret);
-    ok(size == strlen(sTestpath1)+1, "strlen(sTestpath1)=%d size=%ld\n", strlen(sTestpath1), size);
+    ok(size == strlen(sTestpath1)+1, "strlen(sTestpath1)=%d size=%ld\n", lstrlenA(sTestpath1), size);
     ok(type == REG_SZ, "type=%ld\n", type);
     ok(!strcmp(sTestpath1, buf), "sTestpath=\"%s\" buf=\"%s\"\n", sTestpath1, buf);
 
@@ -457,7 +457,7 @@ static void test_get_value(void)
     ok(ret == ERROR_SUCCESS, "ret=%ld\n", ret);
     /* At least v5.2.3790.1830 (2003 SP1) returns the unexpanded sTestpath1 length + 1 here. */
     ok((size == strlen(expanded)+1) || (size == strlen(sTestpath1)+1), 
-        "strlen(expanded)=%d, strlen(sTestpath1)=%d, size=%ld\n", strlen(expanded), strlen(sTestpath1), size);
+        "strlen(expanded)=%d, strlen(sTestpath1)=%d, size=%ld\n", lstrlenA(expanded), lstrlenA(sTestpath1), size);
     ok(type == REG_SZ, "type=%ld\n", type);
     ok(!strcmp(expanded, buf), "expanded=\"%s\" buf=\"%s\"\n", expanded, buf);
     
@@ -465,7 +465,7 @@ static void test_get_value(void)
     buf[0] = 0; type = 0xdeadbeef; size = sizeof(buf);
     ret = pRegGetValueA(hkey_main, NULL, "TP1_EXP_SZ", RRF_RT_REG_EXPAND_SZ|RRF_NOEXPAND, &type, buf, &size);
     ok(ret == ERROR_SUCCESS, "ret=%ld\n", ret);
-    ok(size == strlen(sTestpath1)+1, "strlen(sTestpath1)=%d size=%ld\n", strlen(sTestpath1), size);
+    ok(size == strlen(sTestpath1)+1, "strlen(sTestpath1)=%d size=%ld\n", lstrlenA(sTestpath1), size);
     ok(type == REG_EXPAND_SZ, "type=%ld\n", type);
     ok(!strcmp(sTestpath1, buf), "sTestpath=\"%s\" buf=\"%s\"\n", sTestpath1, buf);
     
diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c
index 62611de..f4b43a1 100644
--- a/dlls/advapi32/tests/security.c
+++ b/dlls/advapi32/tests/security.c
@@ -405,7 +405,7 @@ static void test_lookupPrivilegeName(voi
     ok(cchName == strlen("SeCreateTokenPrivilege") + 1,
      "LookupPrivilegeNameA returned an incorrect required length for\n"
      "SeCreateTokenPrivilege (got %ld, expected %d)\n", cchName,
-     strlen("SeCreateTokenPrivilege") + 1);
+     lstrlenA("SeCreateTokenPrivilege") + 1);
     /* check a known value and its returned length on success */
     cchName = sizeof(buf);
     ok(pLookupPrivilegeNameA(NULL, &luid, buf, &cchName) &&




More information about the wine-cvs mailing list