Test infrastructure additions.
[oweals/openssl.git] / test / x509_time_test.c
index 5f69ebdf41f6c8cab928187da65a5b9f85659587..d9a7f508776cd44dce54eae3b4a2d672675e504a 100644 (file)
@@ -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);