/*
- * 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
*
* 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];
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)
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;
}