mirror of
https://github.com/Mbed-TLS/mbedtls-framework.git
synced 2026-10-18 22:47:56 +00:00
Sort out inclusions of <test/build_info.h> vs "test_common.h"
Include `"test_common.h"` as the first thing in C files, and `<test/build_info.h>` as the first thing in header files. This requires moving `<test/test_common.h>` to its intended location `"test_common.h"`. Signed-off-by: Gilles Peskine <[email protected]>
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
#ifndef TEST_ARGUMENTS_H
|
||||
#define TEST_ARGUMENTS_H
|
||||
|
||||
#include "test_common.h"
|
||||
#include "build_info.h"
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#ifndef ASN1_HELPERS_H
|
||||
#define ASN1_HELPERS_H
|
||||
|
||||
#include "test_common.h"
|
||||
#include "build_info.h"
|
||||
#include "test/helpers.h"
|
||||
|
||||
/** Skip past an INTEGER in an ASN.1 buffer.
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
#ifndef BIGNUM_CODEPATH_CHECK_H
|
||||
#define BIGNUM_CODEPATH_CHECK_H
|
||||
|
||||
#include "test_common.h"
|
||||
#include "build_info.h"
|
||||
|
||||
#include "bignum_core.h"
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#ifndef TEST_BIGNUM_HELPERS_H
|
||||
#define TEST_BIGNUM_HELPERS_H
|
||||
|
||||
#include "test_common.h"
|
||||
#include "build_info.h"
|
||||
|
||||
#if defined(MBEDTLS_BIGNUM_C)
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#ifndef TEST_CONSTANT_FLOW_H
|
||||
#define TEST_CONSTANT_FLOW_H
|
||||
|
||||
#include "test_common.h"
|
||||
#include "build_info.h"
|
||||
|
||||
/*
|
||||
* This file defines the two macros
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#ifndef FAKE_EXTERNAL_RNG_FOR_TEST_H
|
||||
#define FAKE_EXTERNAL_RNG_FOR_TEST_H
|
||||
|
||||
#include "test_common.h"
|
||||
#include "build_info.h"
|
||||
|
||||
#if defined(MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG)
|
||||
/** Enable the insecure implementation of mbedtls_psa_external_get_random().
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#ifndef TEST_HELPERS_H
|
||||
#define TEST_HELPERS_H
|
||||
|
||||
#include "test_common.h"
|
||||
#include "build_info.h"
|
||||
|
||||
#if defined(__SANITIZE_ADDRESS__) /* gcc -fsanitize=address */
|
||||
# define MBEDTLS_TEST_HAVE_ASAN
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#ifndef TEST_MACROS_H
|
||||
#define TEST_MACROS_H
|
||||
|
||||
#include "test_common.h"
|
||||
#include "build_info.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#ifndef TEST_MEMORY_H
|
||||
#define TEST_MEMORY_H
|
||||
|
||||
#include "test_common.h"
|
||||
#include "build_info.h"
|
||||
|
||||
#include "mbedtls/platform.h"
|
||||
#include "test/helpers.h"
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#ifndef PK_HELPERS_H
|
||||
#define PK_HELPERS_H
|
||||
|
||||
#include "test_common.h"
|
||||
#include "build_info.h"
|
||||
|
||||
#if defined(MBEDTLS_PK_C)
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#ifndef PSA_CRYPTO_HELPERS_H
|
||||
#define PSA_CRYPTO_HELPERS_H
|
||||
|
||||
#include "test_common.h"
|
||||
#include "build_info.h"
|
||||
#include "test/helpers.h"
|
||||
|
||||
#if (MBEDTLS_VERSION_MAJOR < 4 && defined(MBEDTLS_PSA_CRYPTO_C)) || \
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#ifndef PSA_EXERCISE_KEY_H
|
||||
#define PSA_EXERCISE_KEY_H
|
||||
|
||||
#include "test_common.h"
|
||||
#include "build_info.h"
|
||||
#include "test/helpers.h"
|
||||
#include "test/psa_crypto_helpers.h"
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#ifndef PSA_HELPERS_H
|
||||
#define PSA_HELPERS_H
|
||||
|
||||
#include "test_common.h"
|
||||
#include "build_info.h"
|
||||
|
||||
#if defined(MBEDTLS_PSA_CRYPTO_SPM)
|
||||
#include "spm/psa_defs.h"
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#ifndef PSA_MEMORY_POISONING_WRAPPERS_H
|
||||
#define PSA_MEMORY_POISONING_WRAPPERS_H
|
||||
|
||||
#include "test_common.h"
|
||||
#include "build_info.h"
|
||||
|
||||
#include "psa/crypto.h"
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#ifndef TEST_RANDOM_H
|
||||
#define TEST_RANDOM_H
|
||||
|
||||
#include "test_common.h"
|
||||
#include "build_info.h"
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
/**
|
||||
* \file test_common.h
|
||||
*
|
||||
* \brief Common things for all Mbed TLS and TF-PSA-Crypto test code.
|
||||
*
|
||||
* Include this header first in all test C files.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright The Mbed TLS Contributors
|
||||
* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#ifndef TEST_TEST_COMMON_H
|
||||
#define TEST_TEST_COMMON_H
|
||||
|
||||
/* On Mingw-w64, force the use of a C99-compliant printf() and friends.
|
||||
* This is necessary on older versions of Mingw and/or Windows runtimes
|
||||
* where snprintf does not always zero-terminate the buffer, and does
|
||||
* not support formats such as "%zu" for size_t and "%lld" for long long.
|
||||
*/
|
||||
#if !defined(__USE_MINGW_ANSI_STDIO)
|
||||
#define __USE_MINGW_ANSI_STDIO 1
|
||||
#endif
|
||||
|
||||
/* Make sure we have the library configuration, and anything else that
|
||||
* is deemed necessary in test headers. */
|
||||
#include <test/build_info.h>
|
||||
|
||||
#endif /* TEST_TEST_COMMON_H */
|
||||
@@ -13,7 +13,7 @@
|
||||
#ifndef THREADING_HELPERS_H
|
||||
#define THREADING_HELPERS_H
|
||||
|
||||
#include "test_common.h"
|
||||
#include "build_info.h"
|
||||
|
||||
#if defined MBEDTLS_THREADING_C
|
||||
|
||||
|
||||
Reference in New Issue
Block a user