Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
8fbcad75
Commit
8fbcad75
authored
Oct 06, 2010
by
Juan Lang
Committed by
Alexandre Julliard
Oct 06, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32/tests: Add name to test to help identify test failures.
parent
d8fcffc7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
33 deletions
+37
-33
chain.c
dlls/crypt32/tests/chain.c
+37
-33
No files found.
dlls/crypt32/tests/chain.c
View file @
8fbcad75
...
@@ -2655,62 +2655,64 @@ typedef struct _SimpleChainStatusCheck
...
@@ -2655,62 +2655,64 @@ typedef struct _SimpleChainStatusCheck
static
void
checkElementStatus
(
const
CERT_TRUST_STATUS
*
expected
,
static
void
checkElementStatus
(
const
CERT_TRUST_STATUS
*
expected
,
const
CERT_TRUST_STATUS
*
got
,
const
CERT_TRUST_STATUS
*
ignore
,
const
CERT_TRUST_STATUS
*
got
,
const
CERT_TRUST_STATUS
*
ignore
,
DWORD
todo
,
DWORD
testIndex
,
DWORD
chainIndex
,
DWORD
elementIndex
)
DWORD
todo
,
LPCSTR
testName
,
DWORD
testIndex
,
DWORD
chainIndex
,
DWORD
elementIndex
)
{
{
if
(
got
->
dwErrorStatus
==
expected
->
dwErrorStatus
)
if
(
got
->
dwErrorStatus
==
expected
->
dwErrorStatus
)
ok
(
got
->
dwErrorStatus
==
expected
->
dwErrorStatus
,
ok
(
got
->
dwErrorStatus
==
expected
->
dwErrorStatus
,
"
Chain %d
, element [%d,%d]: expected error %08x, got %08x
\n
"
,
"
%s[%d]
, element [%d,%d]: expected error %08x, got %08x
\n
"
,
testIndex
,
chainIndex
,
elementIndex
,
expected
->
dwErrorStatus
,
test
Name
,
test
Index
,
chainIndex
,
elementIndex
,
expected
->
dwErrorStatus
,
got
->
dwErrorStatus
);
got
->
dwErrorStatus
);
else
if
(
todo
&
TODO_ERROR
)
else
if
(
todo
&
TODO_ERROR
)
todo_wine
todo_wine
ok
(
got
->
dwErrorStatus
==
expected
->
dwErrorStatus
||
ok
(
got
->
dwErrorStatus
==
expected
->
dwErrorStatus
||
broken
((
got
->
dwErrorStatus
&
~
ignore
->
dwErrorStatus
)
==
broken
((
got
->
dwErrorStatus
&
~
ignore
->
dwErrorStatus
)
==
(
expected
->
dwErrorStatus
&
~
ignore
->
dwErrorStatus
)),
(
expected
->
dwErrorStatus
&
~
ignore
->
dwErrorStatus
)),
"
Chain %d
, element [%d,%d]: expected error %08x, got %08x
\n
"
,
"
%s[%d]
, element [%d,%d]: expected error %08x, got %08x
\n
"
,
testIndex
,
chainIndex
,
elementIndex
,
expected
->
dwErrorStatus
,
test
Name
,
test
Index
,
chainIndex
,
elementIndex
,
expected
->
dwErrorStatus
,
got
->
dwErrorStatus
);
got
->
dwErrorStatus
);
else
else
ok
(
got
->
dwErrorStatus
==
expected
->
dwErrorStatus
||
ok
(
got
->
dwErrorStatus
==
expected
->
dwErrorStatus
||
broken
((
got
->
dwErrorStatus
&
~
ignore
->
dwErrorStatus
)
==
broken
((
got
->
dwErrorStatus
&
~
ignore
->
dwErrorStatus
)
==
(
expected
->
dwErrorStatus
&
~
ignore
->
dwErrorStatus
)),
(
expected
->
dwErrorStatus
&
~
ignore
->
dwErrorStatus
)),
"
Chain %d
, element [%d,%d]: expected error %08x, got %08x. %08x is "
"
%s[%d]
, element [%d,%d]: expected error %08x, got %08x. %08x is "
"expected if no valid Verisign root certificate is available.
\n
"
,
"expected if no valid Verisign root certificate is available.
\n
"
,
testIndex
,
chainIndex
,
elementIndex
,
expected
->
dwErrorStatus
,
test
Name
,
test
Index
,
chainIndex
,
elementIndex
,
expected
->
dwErrorStatus
,
got
->
dwErrorStatus
,
CERT_TRUST_IS_UNTRUSTED_ROOT
);
got
->
dwErrorStatus
,
CERT_TRUST_IS_UNTRUSTED_ROOT
);
if
(
got
->
dwInfoStatus
==
expected
->
dwInfoStatus
)
if
(
got
->
dwInfoStatus
==
expected
->
dwInfoStatus
)
ok
(
got
->
dwInfoStatus
==
expected
->
dwInfoStatus
,
ok
(
got
->
dwInfoStatus
==
expected
->
dwInfoStatus
,
"
Chain %d
, element [%d,%d]: expected info %08x, got %08x
\n
"
,
"
%s[%d]
, element [%d,%d]: expected info %08x, got %08x
\n
"
,
testIndex
,
chainIndex
,
elementIndex
,
expected
->
dwInfoStatus
,
test
Name
,
test
Index
,
chainIndex
,
elementIndex
,
expected
->
dwInfoStatus
,
got
->
dwInfoStatus
);
got
->
dwInfoStatus
);
else
if
(
todo
&
TODO_INFO
)
else
if
(
todo
&
TODO_INFO
)
todo_wine
todo_wine
ok
(
got
->
dwInfoStatus
==
expected
->
dwInfoStatus
||
ok
(
got
->
dwInfoStatus
==
expected
->
dwInfoStatus
||
broken
((
got
->
dwInfoStatus
&
~
ignore
->
dwInfoStatus
)
==
broken
((
got
->
dwInfoStatus
&
~
ignore
->
dwInfoStatus
)
==
(
expected
->
dwInfoStatus
&
~
ignore
->
dwInfoStatus
)),
(
expected
->
dwInfoStatus
&
~
ignore
->
dwInfoStatus
)),
"
Chain %d
, element [%d,%d]: expected info %08x, got %08x
\n
"
,
"
%s[%d]
, element [%d,%d]: expected info %08x, got %08x
\n
"
,
testIndex
,
chainIndex
,
elementIndex
,
expected
->
dwInfoStatus
,
test
Name
,
test
Index
,
chainIndex
,
elementIndex
,
expected
->
dwInfoStatus
,
got
->
dwInfoStatus
);
got
->
dwInfoStatus
);
else
else
ok
(
got
->
dwInfoStatus
==
expected
->
dwInfoStatus
||
ok
(
got
->
dwInfoStatus
==
expected
->
dwInfoStatus
||
broken
((
got
->
dwInfoStatus
&
~
ignore
->
dwInfoStatus
)
==
broken
((
got
->
dwInfoStatus
&
~
ignore
->
dwInfoStatus
)
==
(
expected
->
dwInfoStatus
&
~
ignore
->
dwInfoStatus
)),
(
expected
->
dwInfoStatus
&
~
ignore
->
dwInfoStatus
)),
"
Chain %d
, element [%d,%d]: expected info %08x, got %08x
\n
"
,
"
%s[%d]
, element [%d,%d]: expected info %08x, got %08x
\n
"
,
testIndex
,
chainIndex
,
elementIndex
,
expected
->
dwInfoStatus
,
test
Name
,
test
Index
,
chainIndex
,
elementIndex
,
expected
->
dwInfoStatus
,
got
->
dwInfoStatus
);
got
->
dwInfoStatus
);
}
}
static
void
checkSimpleChainStatus
(
const
CERT_SIMPLE_CHAIN
*
simpleChain
,
static
void
checkSimpleChainStatus
(
const
CERT_SIMPLE_CHAIN
*
simpleChain
,
const
SimpleChainStatusCheck
*
simpleChainStatus
,
const
SimpleChainStatusCheck
*
simpleChainStatus
,
const
CERT_TRUST_STATUS
*
ignore
,
DWORD
todo
,
DWORD
testIndex
,
DWORD
chainIndex
)
const
CERT_TRUST_STATUS
*
ignore
,
DWORD
todo
,
LPCSTR
testName
,
DWORD
testIndex
,
DWORD
chainIndex
)
{
{
if
(
todo
&
TODO_ELEMENTS
)
if
(
todo
&
TODO_ELEMENTS
)
todo_wine
ok
(
simpleChain
->
cElement
==
simpleChainStatus
->
cElement
,
todo_wine
ok
(
simpleChain
->
cElement
==
simpleChainStatus
->
cElement
,
"
Chain %d: expected %d elements, got %d
\n
"
,
testIndex
,
"
%s[%d]: expected %d elements, got %d
\n
"
,
testName
,
testIndex
,
simpleChainStatus
->
cElement
,
simpleChain
->
cElement
);
simpleChainStatus
->
cElement
,
simpleChain
->
cElement
);
else
else
ok
(
simpleChain
->
cElement
==
simpleChainStatus
->
cElement
,
ok
(
simpleChain
->
cElement
==
simpleChainStatus
->
cElement
,
"
Chain %d: expected %d elements, got %d
\n
"
,
testIndex
,
"
%s[%d]: expected %d elements, got %d
\n
"
,
testName
,
testIndex
,
simpleChainStatus
->
cElement
,
simpleChain
->
cElement
);
simpleChainStatus
->
cElement
,
simpleChain
->
cElement
);
if
(
simpleChain
->
cElement
==
simpleChainStatus
->
cElement
)
if
(
simpleChain
->
cElement
==
simpleChainStatus
->
cElement
)
{
{
...
@@ -2718,8 +2720,8 @@ static void checkSimpleChainStatus(const CERT_SIMPLE_CHAIN *simpleChain,
...
@@ -2718,8 +2720,8 @@ static void checkSimpleChainStatus(const CERT_SIMPLE_CHAIN *simpleChain,
for
(
i
=
0
;
i
<
simpleChain
->
cElement
;
i
++
)
for
(
i
=
0
;
i
<
simpleChain
->
cElement
;
i
++
)
checkElementStatus
(
&
simpleChainStatus
->
rgElementStatus
[
i
],
checkElementStatus
(
&
simpleChainStatus
->
rgElementStatus
[
i
],
&
simpleChain
->
rgpElement
[
i
]
->
TrustStatus
,
ignore
,
todo
,
test
Index
,
&
simpleChain
->
rgpElement
[
i
]
->
TrustStatus
,
ignore
,
todo
,
test
Name
,
chainIndex
,
i
);
testIndex
,
chainIndex
,
i
);
}
}
}
}
...
@@ -2732,10 +2734,11 @@ typedef struct _ChainStatusCheck
...
@@ -2732,10 +2734,11 @@ typedef struct _ChainStatusCheck
}
ChainStatusCheck
;
}
ChainStatusCheck
;
static
void
checkChainStatus
(
PCCERT_CHAIN_CONTEXT
chain
,
static
void
checkChainStatus
(
PCCERT_CHAIN_CONTEXT
chain
,
const
ChainStatusCheck
*
chainStatus
,
DWORD
todo
,
DWORD
testIndex
)
const
ChainStatusCheck
*
chainStatus
,
DWORD
todo
,
LPCSTR
testName
,
DWORD
testIndex
)
{
{
ok
(
chain
->
cChain
==
chainStatus
->
cChain
,
ok
(
chain
->
cChain
==
chainStatus
->
cChain
,
"
Chain %d: expected %d simple chains, got %d
\n
"
,
testIndex
,
"
%s[%d]: expected %d simple chains, got %d
\n
"
,
testName
,
testIndex
,
chainStatus
->
cChain
,
chain
->
cChain
);
chainStatus
->
cChain
,
chain
->
cChain
);
if
(
todo
&
TODO_ERROR
&&
if
(
todo
&
TODO_ERROR
&&
chain
->
TrustStatus
.
dwErrorStatus
!=
chainStatus
->
status
.
dwErrorStatus
)
chain
->
TrustStatus
.
dwErrorStatus
!=
chainStatus
->
status
.
dwErrorStatus
)
...
@@ -2745,8 +2748,8 @@ static void checkChainStatus(PCCERT_CHAIN_CONTEXT chain,
...
@@ -2745,8 +2748,8 @@ static void checkChainStatus(PCCERT_CHAIN_CONTEXT chain,
~
chainStatus
->
statusToIgnore
.
dwErrorStatus
)
==
~
chainStatus
->
statusToIgnore
.
dwErrorStatus
)
==
(
chainStatus
->
status
.
dwErrorStatus
&
(
chainStatus
->
status
.
dwErrorStatus
&
~
chainStatus
->
statusToIgnore
.
dwErrorStatus
)),
~
chainStatus
->
statusToIgnore
.
dwErrorStatus
)),
"
Chain %d
: expected error %08x, got %08x
\n
"
,
"
%s[%d]
: expected error %08x, got %08x
\n
"
,
testIndex
,
chainStatus
->
status
.
dwErrorStatus
,
test
Name
,
test
Index
,
chainStatus
->
status
.
dwErrorStatus
,
chain
->
TrustStatus
.
dwErrorStatus
);
chain
->
TrustStatus
.
dwErrorStatus
);
else
else
ok
(
chain
->
TrustStatus
.
dwErrorStatus
==
ok
(
chain
->
TrustStatus
.
dwErrorStatus
==
...
@@ -2755,9 +2758,9 @@ static void checkChainStatus(PCCERT_CHAIN_CONTEXT chain,
...
@@ -2755,9 +2758,9 @@ static void checkChainStatus(PCCERT_CHAIN_CONTEXT chain,
~
chainStatus
->
statusToIgnore
.
dwErrorStatus
)
==
~
chainStatus
->
statusToIgnore
.
dwErrorStatus
)
==
(
chainStatus
->
status
.
dwErrorStatus
&
(
chainStatus
->
status
.
dwErrorStatus
&
~
chainStatus
->
statusToIgnore
.
dwErrorStatus
)),
~
chainStatus
->
statusToIgnore
.
dwErrorStatus
)),
"
Chain %d
: expected error %08x, got %08x. %08x is expected if no valid "
"
%s[%d]
: expected error %08x, got %08x. %08x is expected if no valid "
"Verisign root certificate is available.
\n
"
,
"Verisign root certificate is available.
\n
"
,
testIndex
,
chainStatus
->
status
.
dwErrorStatus
,
test
Name
,
test
Index
,
chainStatus
->
status
.
dwErrorStatus
,
chain
->
TrustStatus
.
dwErrorStatus
,
CERT_TRUST_IS_UNTRUSTED_ROOT
);
chain
->
TrustStatus
.
dwErrorStatus
,
CERT_TRUST_IS_UNTRUSTED_ROOT
);
if
(
todo
&
TODO_INFO
&&
if
(
todo
&
TODO_INFO
&&
chain
->
TrustStatus
.
dwInfoStatus
!=
chainStatus
->
status
.
dwInfoStatus
)
chain
->
TrustStatus
.
dwInfoStatus
!=
chainStatus
->
status
.
dwInfoStatus
)
...
@@ -2767,8 +2770,8 @@ static void checkChainStatus(PCCERT_CHAIN_CONTEXT chain,
...
@@ -2767,8 +2770,8 @@ static void checkChainStatus(PCCERT_CHAIN_CONTEXT chain,
~
chainStatus
->
statusToIgnore
.
dwInfoStatus
)
==
~
chainStatus
->
statusToIgnore
.
dwInfoStatus
)
==
(
chainStatus
->
status
.
dwInfoStatus
&
(
chainStatus
->
status
.
dwInfoStatus
&
~
chainStatus
->
statusToIgnore
.
dwInfoStatus
)),
~
chainStatus
->
statusToIgnore
.
dwInfoStatus
)),
"
Chain %d
: expected info %08x, got %08x
\n
"
,
"
%s[%d]
: expected info %08x, got %08x
\n
"
,
testIndex
,
chainStatus
->
status
.
dwInfoStatus
,
test
Name
,
test
Index
,
chainStatus
->
status
.
dwInfoStatus
,
chain
->
TrustStatus
.
dwInfoStatus
);
chain
->
TrustStatus
.
dwInfoStatus
);
else
else
ok
(
chain
->
TrustStatus
.
dwInfoStatus
==
ok
(
chain
->
TrustStatus
.
dwInfoStatus
==
...
@@ -2777,8 +2780,8 @@ static void checkChainStatus(PCCERT_CHAIN_CONTEXT chain,
...
@@ -2777,8 +2780,8 @@ static void checkChainStatus(PCCERT_CHAIN_CONTEXT chain,
~
chainStatus
->
statusToIgnore
.
dwInfoStatus
)
==
~
chainStatus
->
statusToIgnore
.
dwInfoStatus
)
==
(
chainStatus
->
status
.
dwInfoStatus
&
(
chainStatus
->
status
.
dwInfoStatus
&
~
chainStatus
->
statusToIgnore
.
dwInfoStatus
)),
~
chainStatus
->
statusToIgnore
.
dwInfoStatus
)),
"
Chain %d
: expected info %08x, got %08x
\n
"
,
"
%s[%d]
: expected info %08x, got %08x
\n
"
,
testIndex
,
chainStatus
->
status
.
dwInfoStatus
,
test
Name
,
test
Index
,
chainStatus
->
status
.
dwInfoStatus
,
chain
->
TrustStatus
.
dwInfoStatus
);
chain
->
TrustStatus
.
dwInfoStatus
);
if
(
chain
->
cChain
==
chainStatus
->
cChain
)
if
(
chain
->
cChain
==
chainStatus
->
cChain
)
{
{
...
@@ -2787,7 +2790,7 @@ static void checkChainStatus(PCCERT_CHAIN_CONTEXT chain,
...
@@ -2787,7 +2790,7 @@ static void checkChainStatus(PCCERT_CHAIN_CONTEXT chain,
for
(
i
=
0
;
i
<
chain
->
cChain
;
i
++
)
for
(
i
=
0
;
i
<
chain
->
cChain
;
i
++
)
checkSimpleChainStatus
(
chain
->
rgpChain
[
i
],
checkSimpleChainStatus
(
chain
->
rgpChain
[
i
],
&
chainStatus
->
rgChainStatus
[
i
],
&
chainStatus
->
statusToIgnore
,
&
chainStatus
->
rgChainStatus
[
i
],
&
chainStatus
->
statusToIgnore
,
todo
,
testIndex
,
i
);
todo
,
test
Name
,
test
Index
,
i
);
}
}
}
}
...
@@ -3712,7 +3715,7 @@ static void testGetCertChain(void)
...
@@ -3712,7 +3715,7 @@ static void testGetCertChain(void)
if
(
chain
)
if
(
chain
)
{
{
checkChainStatus
(
chain
,
&
chainCheck
[
i
].
status
,
chainCheck
[
i
].
todo
,
checkChainStatus
(
chain
,
&
chainCheck
[
i
].
status
,
chainCheck
[
i
].
todo
,
i
);
"chainCheck"
,
i
);
pCertFreeCertificateChain
(
chain
);
pCertFreeCertificateChain
(
chain
);
}
}
}
}
...
@@ -3724,7 +3727,7 @@ static void testGetCertChain(void)
...
@@ -3724,7 +3727,7 @@ static void testGetCertChain(void)
if
(
chain
)
if
(
chain
)
{
{
checkChainStatus
(
chain
,
&
chainCheckNoStore
[
i
].
status
,
checkChainStatus
(
chain
,
&
chainCheckNoStore
[
i
].
status
,
chainCheckNoStore
[
i
].
todo
,
i
);
chainCheckNoStore
[
i
].
todo
,
"chainCheckNoStore"
,
i
);
pCertFreeCertificateChain
(
chain
);
pCertFreeCertificateChain
(
chain
);
}
}
}
}
...
@@ -3743,10 +3746,11 @@ static void testGetCertChain(void)
...
@@ -3743,10 +3746,11 @@ static void testGetCertChain(void)
if
(
chainCheckEmbeddedNull
.
status
.
status
.
dwErrorStatus
==
if
(
chainCheckEmbeddedNull
.
status
.
status
.
dwErrorStatus
==
chain
->
TrustStatus
.
dwErrorStatus
)
chain
->
TrustStatus
.
dwErrorStatus
)
checkChainStatus
(
chain
,
&
chainCheckEmbeddedNull
.
status
,
checkChainStatus
(
chain
,
&
chainCheckEmbeddedNull
.
status
,
chainCheckEmbeddedNull
.
todo
,
0
);
chainCheckEmbeddedNull
.
todo
,
"chainCheckEmbeddedNull"
,
0
);
else
else
checkChainStatus
(
chain
,
&
chainCheckEmbeddedNullBroken
.
status
,
checkChainStatus
(
chain
,
&
chainCheckEmbeddedNullBroken
.
status
,
chainCheckEmbeddedNullBroken
.
todo
,
0
);
chainCheckEmbeddedNullBroken
.
todo
,
"chainCheckEmbeddedNullBroken"
,
0
);
pCertFreeCertificateChain
(
chain
);
pCertFreeCertificateChain
(
chain
);
}
}
}
}
...
...
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