Add Docs for EVP_CIPHER-*
[openssl.git] / test / cmp_asn_test.c
index 9a224f3a5613ff459bb3bf8175e50ac3caf1d689..24f6605ce9babc61387651c996ded416470e9477 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2007-2019 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2007-2021 The OpenSSL Project Authors. All Rights Reserved.
  * Copyright Nokia 2007-2019
  * Copyright Siemens AG 2015-2019
  *
@@ -9,7 +9,7 @@
  * https://www.openssl.org/source/license.html
  */
 
-#include "cmp_testlib.h"
+#include "helpers/cmp_testlib.h"
 
 static unsigned char rand_data[OSSL_CMP_TRANSACTIONID_LENGTH];
 
@@ -40,15 +40,17 @@ static void tear_down(CMP_ASN_TEST_FIXTURE *fixture)
     OPENSSL_free(fixture);
 }
 
-static int execute_cmp_asn1_get_int_test(CMP_ASN_TEST_FIXTURE *
-                                                   fixture)
+static int execute_cmp_asn1_get_int_test(CMP_ASN_TEST_FIXTURE *fixture)
 {
+    int res;
     ASN1_INTEGER *asn1integer = ASN1_INTEGER_new();
-    ASN1_INTEGER_set(asn1integer, 77);
-    if (!TEST_int_eq(77, ossl_cmp_asn1_get_int(asn1integer)))
+
+    if (!TEST_ptr(asn1integer))
         return 0;
+    ASN1_INTEGER_set(asn1integer, 77);
+    res = TEST_int_eq(77, ossl_cmp_asn1_get_int(asn1integer));
     ASN1_INTEGER_free(asn1integer);
-    return 1;
+    return res;
 }
 
 static int test_cmp_asn1_get_int(void)
@@ -115,8 +117,10 @@ int setup_tests(void)
     ADD_TEST(test_cmp_asn1_get_int);
     ADD_TEST(test_ASN1_OCTET_STRING_set);
     ADD_TEST(test_ASN1_OCTET_STRING_set_tgt_is_src);
-    /* TODO make sure that total number of tests (here currently 24) is shown,
-     also for other cmp_*text.c. Currently the test drivers always show 1. */
+    /*
+     * TODO make sure that total number of tests (here currently 24) is shown,
+     * also for other cmp_*text.c. Currently the test drivers always show 1.
+     */
 
     return 1;
 }