crypt32: Use helper function and broken() macro to make expected chain status results a little more clear.
This commit is contained in:
parent
439f5e0de9
commit
3454e94d94
|
@ -1163,6 +1163,38 @@ typedef struct _SimpleChainStatusCheck
|
||||||
const CERT_TRUST_STATUS *rgElementStatus;
|
const CERT_TRUST_STATUS *rgElementStatus;
|
||||||
} SimpleChainStatusCheck;
|
} SimpleChainStatusCheck;
|
||||||
|
|
||||||
|
static void checkElementStatus(const CERT_TRUST_STATUS *expected,
|
||||||
|
const CERT_TRUST_STATUS *got, const CERT_TRUST_STATUS *ignore,
|
||||||
|
DWORD todo, DWORD testIndex, DWORD chainIndex, DWORD elementIndex)
|
||||||
|
{
|
||||||
|
if (todo & TODO_ERROR && got->dwErrorStatus != expected->dwErrorStatus)
|
||||||
|
todo_wine
|
||||||
|
ok(got->dwErrorStatus == expected->dwErrorStatus,
|
||||||
|
"Chain %d, element [%d,%d]: expected error %08x, got %08x\n",
|
||||||
|
testIndex, chainIndex, elementIndex, expected->dwErrorStatus,
|
||||||
|
got->dwErrorStatus);
|
||||||
|
else
|
||||||
|
ok(got->dwErrorStatus == expected->dwErrorStatus ||
|
||||||
|
broken((got->dwErrorStatus & ~ignore->dwErrorStatus) ==
|
||||||
|
expected->dwErrorStatus),
|
||||||
|
"Chain %d, element [%d,%d]: expected error %08x, got %08x\n",
|
||||||
|
testIndex, chainIndex, elementIndex, expected->dwErrorStatus,
|
||||||
|
got->dwErrorStatus);
|
||||||
|
if (todo & TODO_INFO && got->dwInfoStatus != expected->dwInfoStatus)
|
||||||
|
todo_wine
|
||||||
|
ok(got->dwInfoStatus == expected->dwInfoStatus,
|
||||||
|
"Chain %d, element [%d,%d]: expected info %08x, got %08x\n",
|
||||||
|
testIndex, chainIndex, elementIndex, expected->dwInfoStatus,
|
||||||
|
got->dwInfoStatus);
|
||||||
|
else
|
||||||
|
ok(got->dwInfoStatus == expected->dwInfoStatus ||
|
||||||
|
broken((got->dwInfoStatus & ~ignore->dwInfoStatus) ==
|
||||||
|
expected->dwInfoStatus),
|
||||||
|
"Chain %d, element [%d,%d]: expected info %08x, got %08x\n",
|
||||||
|
testIndex, chainIndex, elementIndex, expected->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, DWORD testIndex, DWORD chainIndex)
|
||||||
|
@ -1180,41 +1212,9 @@ static void checkSimpleChainStatus(const CERT_SIMPLE_CHAIN *simpleChain,
|
||||||
DWORD i;
|
DWORD i;
|
||||||
|
|
||||||
for (i = 0; i < simpleChain->cElement; i++)
|
for (i = 0; i < simpleChain->cElement; i++)
|
||||||
{
|
checkElementStatus(&simpleChain->rgpElement[i]->TrustStatus,
|
||||||
DWORD error =
|
&simpleChainStatus->rgElementStatus[i], ignore, todo, testIndex,
|
||||||
simpleChain->rgpElement[i]->TrustStatus.dwErrorStatus &
|
chainIndex, i);
|
||||||
~ignore->dwErrorStatus;
|
|
||||||
DWORD info =
|
|
||||||
simpleChain->rgpElement[i]->TrustStatus.dwInfoStatus &
|
|
||||||
~ignore->dwInfoStatus;
|
|
||||||
|
|
||||||
if (todo & TODO_ERROR && error !=
|
|
||||||
simpleChainStatus->rgElementStatus[i].dwErrorStatus)
|
|
||||||
todo_wine ok(error ==
|
|
||||||
simpleChainStatus->rgElementStatus[i].dwErrorStatus,
|
|
||||||
"Chain %d, element [%d,%d]: expected error %08x, got %08x\n",
|
|
||||||
testIndex, chainIndex, i,
|
|
||||||
simpleChainStatus->rgElementStatus[i].dwErrorStatus, error);
|
|
||||||
else
|
|
||||||
ok(error ==
|
|
||||||
simpleChainStatus->rgElementStatus[i].dwErrorStatus,
|
|
||||||
"Chain %d, element [%d,%d]: expected error %08x, got %08x\n",
|
|
||||||
testIndex, chainIndex, i,
|
|
||||||
simpleChainStatus->rgElementStatus[i].dwErrorStatus, error);
|
|
||||||
if (todo & TODO_INFO && info !=
|
|
||||||
simpleChainStatus->rgElementStatus[i].dwInfoStatus)
|
|
||||||
todo_wine ok(info ==
|
|
||||||
simpleChainStatus->rgElementStatus[i].dwInfoStatus,
|
|
||||||
"Chain %d, element [%d,%d]: expected info %08x, got %08x\n",
|
|
||||||
testIndex, chainIndex, i,
|
|
||||||
simpleChainStatus->rgElementStatus[i].dwInfoStatus, info);
|
|
||||||
else
|
|
||||||
ok(info ==
|
|
||||||
simpleChainStatus->rgElementStatus[i].dwInfoStatus,
|
|
||||||
"Chain %d, element [%d,%d]: expected info %08x, got %08x\n",
|
|
||||||
testIndex, chainIndex, i,
|
|
||||||
simpleChainStatus->rgElementStatus[i].dwInfoStatus, info);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue