Move `MBEDTLS_ERR_ADD` macro and function to `common.*`
`error.c` is a file generated from `error.h` and thus cannot contain the code
that was previously added. This commit fixes that issue by moving the
`MBEDTLS_ERR_ADD` macro and associated function and function pointer into
`common.h` and `common.c`.
Also fix a typo in `tests/include/test/helpers.h` where tabs were accidentally
used instead of spaces.
Signed-off-by: Chris Jones <christopher.jones@arm.com>
diff --git a/tests/include/test/helpers.h b/tests/include/test/helpers.h
index 1fe25d8..a26f1ee 100644
--- a/tests/include/test/helpers.h
+++ b/tests/include/test/helpers.h
@@ -280,9 +280,9 @@
#if defined(MBEDTLS_TEST_HOOKS)
/**
- * \brief Check that a pure high-level error code is being combined with a
- * pure low-level error code as otherwise the resultant error code
- * would be corrupted.
+ * \brief Check that a pure high-level error code is being combined with a
+ * pure low-level error code as otherwise the resultant error code
+ * would be corrupted.
*/
void mbedtls_test_err_add_check( int high, int low,
const char *file, int line);
diff --git a/tests/suites/main_test.function b/tests/suites/main_test.function
index 6a4758a..b35b143 100644
--- a/tests/suites/main_test.function
+++ b/tests/suites/main_test.function
@@ -33,10 +33,6 @@
#include "psa/crypto.h"
#endif /* MBEDTLS_USE_PSA_CRYPTO */
-#if defined(MBEDTLS_TEST_HOOKS)
-#include "mbedtls/error.h"
-#endif
-
/* Test code may use deprecated identifiers only if the preprocessor symbol
* MBEDTLS_TEST_DEPRECATED is defined. When building tests, set
* MBEDTLS_TEST_DEPRECATED explicitly if MBEDTLS_DEPRECATED_WARNING is