From 975d18154632d80d86cdc9372deae7b696266991 Mon Sep 17 00:00:00 2001 From: dongheng Date: Tue, 25 Feb 2020 14:31:11 +0800 Subject: [PATCH] fix(mbedtls): fix mbedtls unit test compiling error --- components/freertos/Kconfig | 6 ++++++ components/mbedtls/test/test_apb_dport_access.c | 3 ++- components/mbedtls/test/test_mbedtls_mpi.c | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/components/freertos/Kconfig b/components/freertos/Kconfig index 10ec69ac..4842d886 100644 --- a/components/freertos/Kconfig +++ b/components/freertos/Kconfig @@ -7,6 +7,12 @@ config DISABLE_FREERTOS Enable this option, FreeRTOS will not be compiled and linked, and the user can user other OS platform. +config FREERTOS_UNICORE + bool + default y + help + Only for code compatible. + config FREERTOS_ENABLE_REENT bool "Enable \"reent\" function" default n diff --git a/components/mbedtls/test/test_apb_dport_access.c b/components/mbedtls/test/test_apb_dport_access.c index 07203ac1..2a2a119b 100644 --- a/components/mbedtls/test/test_apb_dport_access.c +++ b/components/mbedtls/test/test_apb_dport_access.c @@ -6,12 +6,13 @@ #include "sdkconfig.h" #include "freertos/FreeRTOS.h" #include "freertos/task.h" -#include "soc/uart_periph.h" #include "test_apb_dport_access.h" #include "test_utils.h" #ifndef CONFIG_FREERTOS_UNICORE +#include "soc/uart_periph.h" + static void apb_access_loop_task(void *ignore); static volatile bool apb_access_corrupt; diff --git a/components/mbedtls/test/test_mbedtls_mpi.c b/components/mbedtls/test/test_mbedtls_mpi.c index 084fe348..438ae4e5 100644 --- a/components/mbedtls/test/test_mbedtls_mpi.c +++ b/components/mbedtls/test/test_mbedtls_mpi.c @@ -58,7 +58,7 @@ static void test_bignum_mult(const char *a_str, const char *b_str, const char *e mbedtls_mpi_set_bit(&M, i, 1); } - TEST_ASSERT_FALSE(esp_mpi_mul_mpi_mod(&X, &A, &B, &M)); + TEST_ASSERT_FALSE(mbedtls_mpi_exp_mod(&X, &A, &B, &M, NULL)); mbedtls_mpi_write_string(&X, 16, x_buf, sizeof(x_buf)-1, &x_buf_len); TEST_ASSERT_EQUAL_STRING_MESSAGE(e_str, x_buf, "esp_mpi_mul_mpi_mod result wrong");