summaryrefslogtreecommitdiffstats
path: root/test/x509_time_test.c
diff options
context:
space:
mode:
authorPauli <paul.dale@oracle.com>2017-03-22 05:27:55 +0100
committerPauli <paul.dale@oracle.com>2017-03-29 00:51:43 +0200
commit2fae041d6c507315a619e2f29bff86e44cc1d0a1 (patch)
tree916c82cafe8b198da5ca777b29ea4fab3f036f5b /test/x509_time_test.c
parentFix 0 -> NULL, indentation (diff)
downloadopenssl-2fae041d6c507315a619e2f29bff86e44cc1d0a1.tar.xz
openssl-2fae041d6c507315a619e2f29bff86e44cc1d0a1.zip
Test infrastructure additions.
Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Emilia Käsper <emilia@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3011)
Diffstat (limited to 'test/x509_time_test.c')
-rw-r--r--test/x509_time_test.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/test/x509_time_test.c b/test/x509_time_test.c
index 5f69ebdf41..d9a7f50877 100644
--- a/test/x509_time_test.c
+++ b/test/x509_time_test.c
@@ -156,8 +156,8 @@ static int test_x509_cmp_time(int idx)
t.length = strlen(x509_cmp_tests[idx].data);
result = X509_cmp_time(&t, &x509_cmp_tests[idx].cmp_time);
- if (result != x509_cmp_tests[idx].expected) {
- fprintf(stderr, "test_x509_cmp_time(%d) failed: expected %d, got %d\n",
+ if (!TEST_int_eq(result, x509_cmp_tests[idx].expected)) {
+ TEST_info("test_x509_cmp_time(%d) failed: expected %d, got %d\n",
idx, x509_cmp_tests[idx].expected, result);
return 0;
}
@@ -175,18 +175,12 @@ static int test_x509_cmp_time_current()
asn1_after = ASN1_TIME_adj(NULL, now, 1, 0);
cmp_result = X509_cmp_time(asn1_before, NULL);
- if (cmp_result != -1) {
- fprintf(stderr, "test_x509_cmp_time_current failed: expected -1, got %d\n",
- cmp_result);
+ if (!TEST_int_eq(cmp_result, -1))
failed = 1;
- }
cmp_result = X509_cmp_time(asn1_after, NULL);
- if (cmp_result != 1) {
- fprintf(stderr, "test_x509_cmp_time_current failed: expected 1, got %d\n",
- cmp_result);
+ if (!TEST_int_eq(cmp_result, 1))
failed = 1;
- }
ASN1_TIME_free(asn1_before);
ASN1_TIME_free(asn1_after);