Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
52d6077f
Commit
52d6077f
authored
Jun 13, 2006
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32/tests: Don't use sizeof in ok() to avoid printf format warnings.
parent
68e4cf4a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
37 deletions
+19
-37
cert.c
dlls/crypt32/tests/cert.c
+3
-5
encode.c
dlls/crypt32/tests/encode.c
+0
-0
store.c
dlls/crypt32/tests/store.c
+16
-32
No files found.
dlls/crypt32/tests/cert.c
View file @
52d6077f
...
...
@@ -71,8 +71,7 @@ static void testCryptHashCert(void)
ret
=
CryptHashCertificate
(
0
,
0
,
0
,
toHash
,
sizeof
(
toHash
),
NULL
,
&
hashLen
);
ok
(
ret
,
"CryptHashCertificate failed: %08lx
\n
"
,
GetLastError
());
ok
(
hashLen
==
sizeof
(
hash
),
"Got unexpected size of hash %ld, expected %d
\n
"
,
hashLen
,
sizeof
(
hash
));
ok
(
hashLen
==
sizeof
(
hash
),
"Got unexpected size of hash %ld
\n
"
,
hashLen
);
/* Test with empty buffer */
ret
=
CryptHashCertificate
(
0
,
0
,
0
,
NULL
,
0
,
hash
,
&
hashLen
);
ok
(
ret
,
"CryptHashCertificate failed: %08lx
\n
"
,
GetLastError
());
...
...
@@ -89,7 +88,7 @@ static const WCHAR cspNameW[] = { 'W','i','n','e','C','r','y','p','t','T','e',
'm'
,
'p'
,
0
};
static
void
verifySig
(
HCRYPTPROV
csp
,
const
BYTE
*
toSign
,
size_t
toSignLen
,
const
BYTE
*
sig
,
size_
t
sigLen
)
const
BYTE
*
sig
,
unsigned
in
t
sigLen
)
{
HCRYPTHASH
hash
;
BOOL
ret
=
CryptCreateHash
(
csp
,
CALG_SHA1
,
0
,
0
,
&
hash
);
...
...
@@ -451,8 +450,7 @@ static void testKeyUsage(void)
*/
ok
(
GetLastError
()
==
CRYPT_E_NOT_FOUND
,
"Expected CRYPT_E_NOT_FOUND, got %08lx
\n
"
,
GetLastError
());
ok
(
size
==
sizeof
(
CERT_ENHKEY_USAGE
),
"Expected size %d, got %ld
\n
"
,
sizeof
(
CERT_ENHKEY_USAGE
),
size
);
ok
(
size
==
sizeof
(
CERT_ENHKEY_USAGE
),
"Wrong size %ld
\n
"
,
size
);
ret
=
CertGetEnhancedKeyUsage
(
context
,
0
,
pUsage
,
&
size
);
ok
(
ret
,
"CertGetEnhancedKeyUsage failed: %08lx
\n
"
,
GetLastError
());
ok
(
pUsage
->
cUsageIdentifier
==
0
,
"Expected 0 usages, got %ld
\n
"
,
...
...
dlls/crypt32/tests/encode.c
View file @
52d6077f
This diff is collapsed.
Click to expand it.
dlls/crypt32/tests/store.c
View file @
52d6077f
...
...
@@ -331,8 +331,7 @@ static void testDupCert(void)
if
(
context
)
{
ok
(
context
->
cbCertEncoded
==
sizeof
(
bigCert
),
"Expected cert of %d bytes, got %ld
\n
"
,
sizeof
(
bigCert
),
context
->
cbCertEncoded
);
"Wrong cert size %ld
\n
"
,
context
->
cbCertEncoded
);
ok
(
!
memcmp
(
context
->
pbCertEncoded
,
bigCert
,
sizeof
(
bigCert
)),
"Unexpected encoded cert in context
\n
"
);
ok
(
context
->
hCertStore
==
store
,
"Unexpected store
\n
"
);
...
...
@@ -685,8 +684,7 @@ static void testMemStore(void)
if
(
context
)
{
ok
(
context
->
cbCertEncoded
==
sizeof
(
signedBigCert
),
"Expected cert of %d bytes, got %ld
\n
"
,
sizeof
(
signedBigCert
),
context
->
cbCertEncoded
);
"Wrong cert size %ld
\n
"
,
context
->
cbCertEncoded
);
ok
(
!
memcmp
(
context
->
pbCertEncoded
,
signedBigCert
,
sizeof
(
signedBigCert
)),
"Unexpected encoded cert in context
\n
"
);
/* remove it, the rest of the tests will work on an unsigned cert */
...
...
@@ -712,8 +710,7 @@ static void testMemStore(void)
BYTE
*
buf
;
ok
(
context
->
cbCertEncoded
==
sizeof
(
bigCert
),
"Expected cert of %d bytes, got %ld
\n
"
,
sizeof
(
bigCert
),
context
->
cbCertEncoded
);
"Wrong cert size %ld
\n
"
,
context
->
cbCertEncoded
);
ok
(
!
memcmp
(
context
->
pbCertEncoded
,
bigCert
,
sizeof
(
bigCert
)),
"Unexpected encoded cert in context
\n
"
);
ok
(
context
->
hCertStore
==
store1
,
"Unexpected store
\n
"
);
...
...
@@ -732,8 +729,7 @@ static void testMemStore(void)
if
(
buf
)
{
ret
=
CertSerializeCertificateStoreElement
(
context
,
0
,
buf
,
&
size
);
ok
(
size
==
sizeof
(
serializedCert
),
"Expected size %d, got %ld
\n
"
,
sizeof
(
serializedCert
),
size
);
ok
(
size
==
sizeof
(
serializedCert
),
"Wrong size %ld
\n
"
,
size
);
ok
(
!
memcmp
(
serializedCert
,
buf
,
size
),
"Unexpected serialized cert
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
buf
);
...
...
@@ -800,8 +796,7 @@ static void testMemStore(void)
if
(
context
)
{
ok
(
context
->
cbCertEncoded
==
sizeof
(
bigCert
),
"Expected cert of %d bytes, got %ld
\n
"
,
sizeof
(
bigCert
),
context
->
cbCertEncoded
);
"Wrong cert size %ld
\n
"
,
context
->
cbCertEncoded
);
ok
(
!
memcmp
(
context
->
pbCertEncoded
,
bigCert
,
sizeof
(
bigCert
)),
"Unexpected encoded cert in context
\n
"
);
ok
(
context
->
hCertStore
==
store1
,
"Unexpected store
\n
"
);
...
...
@@ -897,8 +892,7 @@ static void testCollectionStore(void)
{
ok
(
context
->
hCertStore
==
collection
,
"Unexpected store
\n
"
);
ok
(
context
->
cbCertEncoded
==
sizeof
(
bigCert
),
"Expected size %d, got %ld
\n
"
,
sizeof
(
bigCert
),
context
->
cbCertEncoded
);
"Wrong size %ld
\n
"
,
context
->
cbCertEncoded
);
ok
(
!
memcmp
(
context
->
pbCertEncoded
,
bigCert
,
context
->
cbCertEncoded
),
"Unexpected cert
\n
"
);
context
=
CertEnumCertificatesInStore
(
collection
,
context
);
...
...
@@ -907,8 +901,7 @@ static void testCollectionStore(void)
{
ok
(
context
->
hCertStore
==
collection
,
"Unexpected store
\n
"
);
ok
(
context
->
cbCertEncoded
==
sizeof
(
bigCert2
),
"Expected size %d, got %ld
\n
"
,
sizeof
(
bigCert2
),
context
->
cbCertEncoded
);
"Wrong size %ld
\n
"
,
context
->
cbCertEncoded
);
ok
(
!
memcmp
(
context
->
pbCertEncoded
,
bigCert2
,
context
->
cbCertEncoded
),
"Unexpected cert
\n
"
);
context
=
CertEnumCertificatesInStore
(
collection
,
context
);
...
...
@@ -923,8 +916,7 @@ static void testCollectionStore(void)
{
ok
(
context
->
hCertStore
==
collection
,
"Unexpected store
\n
"
);
ok
(
context
->
cbCertEncoded
==
sizeof
(
bigCert
),
"Expected size %d, got %ld
\n
"
,
sizeof
(
bigCert
),
context
->
cbCertEncoded
);
"Wrong size %ld
\n
"
,
context
->
cbCertEncoded
);
ok
(
!
memcmp
(
context
->
pbCertEncoded
,
bigCert
,
context
->
cbCertEncoded
),
"Unexpected cert
\n
"
);
context
=
CertEnumCertificatesInStore
(
collection
,
context
);
...
...
@@ -933,8 +925,7 @@ static void testCollectionStore(void)
{
ok
(
context
->
hCertStore
==
collection
,
"Unexpected store
\n
"
);
ok
(
context
->
cbCertEncoded
==
sizeof
(
bigCert2
),
"Expected size %d, got %ld
\n
"
,
sizeof
(
bigCert2
),
context
->
cbCertEncoded
);
"Wrong size %ld
\n
"
,
context
->
cbCertEncoded
);
ok
(
!
memcmp
(
context
->
pbCertEncoded
,
bigCert2
,
context
->
cbCertEncoded
),
"Unexpected cert
\n
"
);
context
=
CertEnumCertificatesInStore
(
collection
,
context
);
...
...
@@ -955,8 +946,7 @@ static void testCollectionStore(void)
{
ok
(
context
->
hCertStore
==
collection2
,
"Unexpected store
\n
"
);
ok
(
context
->
cbCertEncoded
==
sizeof
(
bigCert
),
"Expected size %d, got %ld
\n
"
,
sizeof
(
bigCert
),
context
->
cbCertEncoded
);
"Wrong size %ld
\n
"
,
context
->
cbCertEncoded
);
ok
(
!
memcmp
(
context
->
pbCertEncoded
,
bigCert
,
context
->
cbCertEncoded
),
"Unexpected cert
\n
"
);
context
=
CertEnumCertificatesInStore
(
collection2
,
context
);
...
...
@@ -965,8 +955,7 @@ static void testCollectionStore(void)
{
ok
(
context
->
hCertStore
==
collection2
,
"Unexpected store
\n
"
);
ok
(
context
->
cbCertEncoded
==
sizeof
(
bigCert2
),
"Expected size %d, got %ld
\n
"
,
sizeof
(
bigCert2
),
context
->
cbCertEncoded
);
"Wrong size %ld
\n
"
,
context
->
cbCertEncoded
);
ok
(
!
memcmp
(
context
->
pbCertEncoded
,
bigCert2
,
context
->
cbCertEncoded
),
"Unexpected cert
\n
"
);
context
=
CertEnumCertificatesInStore
(
collection2
,
context
);
...
...
@@ -1021,8 +1010,7 @@ static void testCollectionStore(void)
{
ok
(
context
->
hCertStore
==
collection
,
"Unexpected store
\n
"
);
ok
(
context
->
cbCertEncoded
==
sizeof
(
bigCert
),
"Expected size %d, got %ld
\n
"
,
sizeof
(
bigCert
),
context
->
cbCertEncoded
);
"Wrong size %ld
\n
"
,
context
->
cbCertEncoded
);
ok
(
!
memcmp
(
context
->
pbCertEncoded
,
bigCert
,
context
->
cbCertEncoded
),
"Unexpected cert
\n
"
);
context
=
CertEnumCertificatesInStore
(
collection
,
context
);
...
...
@@ -1031,8 +1019,7 @@ static void testCollectionStore(void)
{
ok
(
context
->
hCertStore
==
collection
,
"Unexpected store
\n
"
);
ok
(
context
->
cbCertEncoded
==
sizeof
(
bigCert
),
"Expected size %d, got %ld
\n
"
,
sizeof
(
bigCert
),
context
->
cbCertEncoded
);
"Wrong size %ld
\n
"
,
context
->
cbCertEncoded
);
ok
(
!
memcmp
(
context
->
pbCertEncoded
,
bigCert
,
context
->
cbCertEncoded
),
"Unexpected cert
\n
"
);
context
=
CertEnumCertificatesInStore
(
collection
,
context
);
...
...
@@ -1072,8 +1059,7 @@ static void testCollectionStore(void)
{
ok
(
context
->
hCertStore
==
collection
,
"Unexpected store
\n
"
);
ok
(
context
->
cbCertEncoded
==
sizeof
(
bigCert
),
"Expected size %d, got %ld
\n
"
,
sizeof
(
bigCert
),
context
->
cbCertEncoded
);
"Wrong size %ld
\n
"
,
context
->
cbCertEncoded
);
ok
(
!
memcmp
(
context
->
pbCertEncoded
,
bigCert
,
context
->
cbCertEncoded
),
"Unexpected cert
\n
"
);
}
...
...
@@ -1223,8 +1209,7 @@ static void testRegStore(void)
if
(
hdr
)
{
ok
(
hdr
->
cb
==
sizeof
(
bigCert2
),
"Unexpected size %ld of cert property, expected %d
\n
"
,
hdr
->
cb
,
sizeof
(
bigCert2
));
"Wrong size %ld of cert property
\n
"
,
hdr
->
cb
);
ok
(
!
memcmp
((
BYTE
*
)
hdr
+
sizeof
(
*
hdr
),
bigCert2
,
hdr
->
cb
),
"Unexpected cert in cert property
\n
"
);
}
...
...
@@ -1233,8 +1218,7 @@ static void testRegStore(void)
if
(
hdr
)
{
ok
(
hdr
->
cb
==
sizeof
(
hash
),
"Unexpected size %ld of hash property, expected %d
\n
"
,
hdr
->
cb
,
sizeof
(
hash
));
"Wrong size %ld of hash property
\n
"
,
hdr
->
cb
);
ok
(
!
memcmp
((
BYTE
*
)
hdr
+
sizeof
(
*
hdr
),
hash
,
hdr
->
cb
),
"Unexpected hash in cert property
\n
"
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment