Skip to content

Commit

Permalink
Merge pull request #8059 from douzzer/20241010-WOLFCRYPT_TEST_LINT
Browse files Browse the repository at this point in the history
20241010-WOLFCRYPT_TEST_LINT
  • Loading branch information
JacobBarthelmeh authored Oct 10, 2024
2 parents 8b2a26a + bcc65a0 commit c49f571
Showing 1 changed file with 28 additions and 10 deletions.
38 changes: 28 additions & 10 deletions wolfcrypt/test/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -491,12 +491,16 @@ typedef struct testVector {
size_t outLen;
} testVector;

#ifndef WOLFSSL_TEST_SUBROUTINE
#define WOLFSSL_TEST_SUBROUTINE
#ifdef WOLFCRYPT_TEST_LINT
#define WOLFSSL_TEST_SUBROUTINE static
#else
PRAGMA_GCC("GCC diagnostic ignored \"-Wunused-function\"")
PRAGMA_CLANG("clang diagnostic ignored \"-Wunused-function\"")
#endif

PRAGMA_GCC("GCC diagnostic ignored \"-Wunused-function\"")
PRAGMA_CLANG("clang diagnostic ignored \"-Wunused-function\"")
#ifndef WOLFSSL_TEST_SUBROUTINE
#define WOLFSSL_TEST_SUBROUTINE
#endif

WOLFSSL_TEST_SUBROUTINE wc_test_ret_t error_test(void);
WOLFSSL_TEST_SUBROUTINE wc_test_ret_t base64_test(void);
Expand All @@ -521,7 +525,9 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t sha384_test(void);
WOLFSSL_TEST_SUBROUTINE wc_test_ret_t sha3_test(void);
WOLFSSL_TEST_SUBROUTINE wc_test_ret_t shake128_test(void);
WOLFSSL_TEST_SUBROUTINE wc_test_ret_t shake256_test(void);
#ifdef WOLFSSL_SM3
WOLFSSL_TEST_SUBROUTINE wc_test_ret_t sm3_test(void);
#endif
WOLFSSL_TEST_SUBROUTINE wc_test_ret_t hash_test(void);
WOLFSSL_TEST_SUBROUTINE wc_test_ret_t hmac_md5_test(void);
WOLFSSL_TEST_SUBROUTINE wc_test_ret_t hmac_sha_test(void);
Expand Down Expand Up @@ -555,7 +561,9 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t sshkdf_test(void);
WOLFSSL_TEST_SUBROUTINE wc_test_ret_t tls13_kdf_test(void);
#endif
WOLFSSL_TEST_SUBROUTINE wc_test_ret_t x963kdf_test(void);
#if defined(HAVE_HPKE) && defined(HAVE_ECC) && defined(HAVE_AESGCM)
WOLFSSL_TEST_SUBROUTINE wc_test_ret_t hpke_test(void);
#endif
#ifdef WC_SRTP_KDF
WOLFSSL_TEST_SUBROUTINE wc_test_ret_t srtpkdf_test(void);
#endif
Expand Down Expand Up @@ -606,7 +614,12 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t srp_test(void);
WOLFSSL_TEST_SUBROUTINE wc_test_ret_t random_test(void);
#endif /* WC_NO_RNG */
WOLFSSL_TEST_SUBROUTINE wc_test_ret_t pwdbased_test(void);
#if defined(USE_CERT_BUFFERS_2048) && \
defined(HAVE_PKCS12) && \
!defined(NO_ASN) && !defined(NO_PWDBASED) && !defined(NO_HMAC) && \
!defined(NO_CERTS) && !defined(NO_DES3)
WOLFSSL_TEST_SUBROUTINE wc_test_ret_t pkcs12_test(void);
#endif
WOLFSSL_TEST_SUBROUTINE wc_test_ret_t ripemd_test(void);
#if defined(OPENSSL_EXTRA) && !defined(WOLFCRYPT_ONLY)
WOLFSSL_TEST_SUBROUTINE wc_test_ret_t openssl_test(void); /* test mini api */
Expand Down Expand Up @@ -711,7 +724,7 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t scrypt_test(void);
WOLFSSL_TEST_SUBROUTINE wc_test_ret_t cert_test(void);
#endif
#if defined(WOLFSSL_CERT_EXT) && defined(WOLFSSL_TEST_CERT) && \
!defined(NO_FILESYSTEM) && defined(WOLFSSL_CERT_GEN)
!defined(NO_FILESYSTEM) && !defined(NO_RSA) && defined(WOLFSSL_GEN_CERT)
WOLFSSL_TEST_SUBROUTINE wc_test_ret_t certext_test(void);
#endif
#if defined(WOLFSSL_CERT_GEN_CACHE) && defined(WOLFSSL_TEST_CERT) && \
Expand All @@ -727,7 +740,9 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t mp_test(void);
#if defined(WOLFSSL_PUBLIC_MP) && defined(WOLFSSL_KEY_GEN)
WOLFSSL_TEST_SUBROUTINE wc_test_ret_t prime_test(void);
#endif
#ifdef ASN_BER_TO_DER
#if defined(ASN_BER_TO_DER) && \
(defined(WOLFSSL_TEST_CERT) || defined(OPENSSL_EXTRA) || \
defined(OPENSSL_EXTRA_X509_SMALL))
WOLFSSL_TEST_SUBROUTINE wc_test_ret_t berder_test(void);
#endif
WOLFSSL_TEST_SUBROUTINE wc_test_ret_t logging_test(void);
Expand Down Expand Up @@ -18638,7 +18653,7 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t cert_test(void)
#endif /* WOLFSSL_TEST_CERT */

#if defined(WOLFSSL_CERT_EXT) && defined(WOLFSSL_TEST_CERT) && \
!defined(NO_FILESYSTEM) && defined(WOLFSSL_CERT_GEN)
!defined(NO_FILESYSTEM) && !defined(NO_RSA) && defined(WOLFSSL_GEN_CERT)
WOLFSSL_TEST_SUBROUTINE wc_test_ret_t certext_test(void)
{
DecodedCert cert;
Expand Down Expand Up @@ -18836,7 +18851,7 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t certext_test(void)
return 0;
}
#endif /* WOLFSSL_CERT_EXT && WOLFSSL_TEST_CERT &&
!NO_FILESYSTEM && WOLFSSL_CERT_GEN */
!NO_FILESYSTEM && !NO_RSA && WOLFSSL_CERT_GEN */

#if defined(WOLFSSL_CERT_GEN_CACHE) && defined(WOLFSSL_TEST_CERT) && \
defined(WOLFSSL_CERT_EXT) && defined(WOLFSSL_CERT_GEN)
Expand Down Expand Up @@ -56949,7 +56964,9 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t prime_test(void)
#endif /* WOLFSSL_PUBLIC_MP */


#ifdef ASN_BER_TO_DER
#if defined(ASN_BER_TO_DER) && \
(defined(WOLFSSL_TEST_CERT) || defined(OPENSSL_EXTRA) || \
defined(OPENSSL_EXTRA_X509_SMALL))
/* wc_BerToDer is only public facing in the case of test cert or opensslextra */
typedef struct berDerTestData {
const byte *in;
Expand Down Expand Up @@ -57065,7 +57082,8 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t berder_test(void)

return 0;
}
#endif /* ASN_BER_TO_DER */
#endif /* ASN_BER_TO_DER && (WOLFSSL_TEST_CERT || OPENSSL_EXTRA ||
OPENSSL_EXTRA_X509_SMALL */

#ifdef DEBUG_WOLFSSL
static THREAD_LS_T int log_cnt = 0;
Expand Down

0 comments on commit c49f571

Please sign in to comment.