summaryrefslogtreecommitdiff
path: root/test/cmp_status_test.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/cmp_status_test.c')
-rw-r--r--test/cmp_status_test.c29
1 files changed, 12 insertions, 17 deletions
diff --git a/test/cmp_status_test.c b/test/cmp_status_test.c
index 96f9336b8496..3dc897c46506 100644
--- a/test/cmp_status_test.c
+++ b/test/cmp_status_test.c
@@ -14,7 +14,7 @@
typedef struct test_fixture {
const char *test_case_name;
int pkistatus;
- const char *str; /* Not freed by tear_down */
+ const char *str; /* Not freed by tear_down */
const char *text; /* Not freed by tear_down */
int pkifailure;
} CMP_STATUS_TEST_FIXTURE;
@@ -34,7 +34,6 @@ static void tear_down(CMP_STATUS_TEST_FIXTURE *fixture)
OPENSSL_free(fixture);
}
-
/*
* Tests PKIStatusInfo creation and get-functions
*/
@@ -46,33 +45,32 @@ static int execute_PKISI_test(CMP_STATUS_TEST_FIXTURE *fixture)
int res = 0, i;
if (!TEST_ptr(si = OSSL_CMP_STATUSINFO_new(fixture->pkistatus,
- fixture->pkifailure,
- fixture->text)))
+ fixture->pkifailure,
+ fixture->text)))
goto end;
status = ossl_cmp_pkisi_get_status(si);
if (!TEST_int_eq(fixture->pkistatus, status)
- || !TEST_str_eq(fixture->str, ossl_cmp_PKIStatus_to_string(status)))
+ || !TEST_str_eq(fixture->str, ossl_cmp_PKIStatus_to_string(status)))
goto end;
- if (!TEST_ptr(statusString =
- sk_ASN1_UTF8STRING_value(ossl_cmp_pkisi_get0_statusString(si),
- 0))
- || !TEST_mem_eq(fixture->text, strlen(fixture->text),
- (char *)statusString->data, statusString->length))
+ if (!TEST_ptr(statusString = sk_ASN1_UTF8STRING_value(ossl_cmp_pkisi_get0_statusString(si),
+ 0))
+ || !TEST_mem_eq(fixture->text, strlen(fixture->text),
+ (char *)statusString->data, statusString->length))
goto end;
if (!TEST_int_eq(fixture->pkifailure,
- ossl_cmp_pkisi_get_pkifailureinfo(si)))
+ ossl_cmp_pkisi_get_pkifailureinfo(si)))
goto end;
for (i = 0; i <= OSSL_CMP_PKIFAILUREINFO_MAX; i++)
if (!TEST_int_eq((fixture->pkifailure >> i) & 1,
- ossl_cmp_pkisi_check_pkifailureinfo(si, i)))
+ ossl_cmp_pkisi_check_pkifailureinfo(si, i)))
goto end;
res = 1;
- end:
+end:
OSSL_CMP_PKISI_free(si);
return res;
}
@@ -83,14 +81,11 @@ static int test_PKISI(void)
fixture->pkistatus = OSSL_CMP_PKISTATUS_revocationNotification;
fixture->str = "PKIStatus: revocation notification - a revocation of the cert has occurred";
fixture->text = "this is an additional text describing the failure";
- fixture->pkifailure = OSSL_CMP_CTX_FAILINFO_unsupportedVersion |
- OSSL_CMP_CTX_FAILINFO_badDataFormat;
+ fixture->pkifailure = OSSL_CMP_CTX_FAILINFO_unsupportedVersion | OSSL_CMP_CTX_FAILINFO_badDataFormat;
EXECUTE_TEST(execute_PKISI_test, tear_down);
return result;
}
-
-
void cleanup_tests(void)
{
return;