]> granicus.if.org Git - esp-idf/commitdiff
Fix a build issue with replacing init_spi_flash() in the host tests
authorAnton Maklakov <anton@espressif.com>
Thu, 1 Aug 2019 04:23:41 +0000 (11:23 +0700)
committerAnton Maklakov <anton@espressif.com>
Thu, 1 Aug 2019 09:28:56 +0000 (16:28 +0700)
components/fatfs/test_fatfs_host/Makefile
components/fatfs/test_fatfs_host/test_fatfs.cpp
components/fatfs/test_fatfs_host/test_utils.c [deleted file]
components/spi_flash/sim/flash_mock_util.c
components/spi_flash/sim/stubs/freertos/include/freertos/FreeRTOS.h
components/spiffs/test_spiffs_host/Makefile
components/spiffs/test_spiffs_host/test_spiffs.cpp
components/spiffs/test_spiffs_host/test_utils.c [deleted file]
components/wear_levelling/test_wl_host/Makefile
components/wear_levelling/test_wl_host/test_utils.c [deleted file]
components/wear_levelling/test_wl_host/test_wl.cpp

index 4c43e16aab31d77e627860c0fd70eb392c8a736c..3d17e5ac1a36ad4c5a640ef42b3e9481bfddd7e9 100644 (file)
@@ -81,7 +81,6 @@ $(foreach cxxfile, $(CPPFILES), $(eval $(call COMPILE_CPP, $(cxxfile))))
 TEST_SOURCE_FILES = \
        test_fatfs.cpp \
        main.cpp \
-       test_utils.c
 
 TEST_OBJ_FILES = $(filter %.o, $(TEST_SOURCE_FILES:.cpp=.o) $(TEST_SOURCE_FILES:.c=.o))
 
index fcbbe5594576d36219028ef4d52bd2cf9af33d59..d1f7119e61cc4b7ffe9f7f139335f3b6d8f50ea3 100644 (file)
@@ -9,11 +9,11 @@
 
 #include "catch.hpp"
 
-extern "C" void init_spi_flash(const char* chip_size, size_t block_size, size_t sector_size, size_t page_size, const char* partition_bin);
+extern "C" void _spi_flash_init(const char* chip_size, size_t block_size, size_t sector_size, size_t page_size, const char* partition_bin);
 
 TEST_CASE("create volume, open file, write and read back data", "[fatfs]")
 {
-    init_spi_flash(CONFIG_ESPTOOLPY_FLASHSIZE, CONFIG_WL_SECTOR_SIZE * 16, CONFIG_WL_SECTOR_SIZE, CONFIG_WL_SECTOR_SIZE, "partition_table.bin");
+    _spi_flash_init(CONFIG_ESPTOOLPY_FLASHSIZE, CONFIG_WL_SECTOR_SIZE * 16, CONFIG_WL_SECTOR_SIZE, CONFIG_WL_SECTOR_SIZE, "partition_table.bin");
 
     FRESULT fr_result;
     BYTE pdrv;
diff --git a/components/fatfs/test_fatfs_host/test_utils.c b/components/fatfs/test_fatfs_host/test_utils.c
deleted file mode 100644 (file)
index 3e4b057..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#include "esp_spi_flash.h"
-#include "esp_partition.h"
-
-void init_spi_flash(const char* chip_size, size_t block_size, size_t sector_size, size_t page_size, const char* partition_bin)
-{
-    spi_flash_init(chip_size, block_size, sector_size, page_size, partition_bin);
-}
index 770600e64289b44b714c1e1475f23554e0903cc9..2db51c58ae408f9524df1b8502e3acf498639261 100644 (file)
@@ -4,13 +4,6 @@
 #include "esp_err.h"
 #include "esp32/rom/spi_flash.h"
 
-extern void _spi_flash_init(const char* chip_size, size_t block_size, size_t sector_size, size_t page_size, const char* partition_bin);
-
-void spi_flash_init(const char* chip_size, size_t block_size, size_t sector_size, size_t page_size, const char* partition_bin)
-{
-    _spi_flash_init(chip_size, block_size, sector_size, page_size, partition_bin);
-}
-
 bool spi_flash_check_and_flush_cache(size_t start_addr, size_t length)
 {
     return true;
index 9abd0dd8bab4bb7fe296750dce28e432a5bd2c9a..5bafa772df646dc1ce565ea7c36a5e005439a747 100644 (file)
@@ -2,7 +2,3 @@
 
 #include "projdefs.h"
 #include "semphr.h"
-
-// Avoid redefinition compile error. Put here since this is included
-// in flash_ops.c.
-#define spi_flash_init()                     overriden_spi_flash_init()
index 4d016f7b4d8e7306c7d4f5baa04f56fcdfe8bfd3..15b327acf14d78f5ebb4092476bf956c31400deb 100644 (file)
@@ -79,7 +79,6 @@ $(foreach cxxfile, $(CPPFILES), $(eval $(call COMPILE_CPP, $(cxxfile))))
 TEST_SOURCE_FILES = \
        test_spiffs.cpp \
        main.cpp \
-       test_utils.c
 
 TEST_OBJ_FILES = $(filter %.o, $(TEST_SOURCE_FILES:.cpp=.o) $(TEST_SOURCE_FILES:.c=.o))
 
index a523f06a734dd64f8c38da09677a857d5dcffcb0..868ce45809a0af56646e91e14256c87bf0d0f138 100644 (file)
@@ -12,7 +12,7 @@
 
 #include "catch.hpp"
 
-extern "C" void init_spi_flash(const char* chip_size, size_t block_size, size_t sector_size, size_t page_size, const char* partition_bin);
+extern "C" void _spi_flash_init(const char* chip_size, size_t block_size, size_t sector_size, size_t page_size, const char* partition_bin);
 
 static void init_spiffs(spiffs *fs, uint32_t max_files)
 {
@@ -152,7 +152,7 @@ static void check_spiffs_files(spiffs *fs, const char *base_path, char* cur_path
 
 TEST_CASE("format disk, open file, write and read file", "[spiffs]")
 {
-    init_spi_flash(CONFIG_ESPTOOLPY_FLASHSIZE, CONFIG_WL_SECTOR_SIZE * 16, CONFIG_WL_SECTOR_SIZE, CONFIG_WL_SECTOR_SIZE, "partition_table.bin");
+    _spi_flash_init(CONFIG_ESPTOOLPY_FLASHSIZE, CONFIG_WL_SECTOR_SIZE * 16, CONFIG_WL_SECTOR_SIZE, CONFIG_WL_SECTOR_SIZE, "partition_table.bin");
 
     spiffs fs;
     s32_t spiffs_res;
@@ -204,7 +204,7 @@ TEST_CASE("format disk, open file, write and read file", "[spiffs]")
 
 TEST_CASE("can read spiffs image", "[spiffs]")
 {
-    init_spi_flash(CONFIG_ESPTOOLPY_FLASHSIZE, CONFIG_WL_SECTOR_SIZE * 16, CONFIG_WL_SECTOR_SIZE, CONFIG_WL_SECTOR_SIZE, "partition_table.bin");
+    _spi_flash_init(CONFIG_ESPTOOLPY_FLASHSIZE, CONFIG_WL_SECTOR_SIZE * 16, CONFIG_WL_SECTOR_SIZE, CONFIG_WL_SECTOR_SIZE, "partition_table.bin");
 
     spiffs fs;
     s32_t spiffs_res;
diff --git a/components/spiffs/test_spiffs_host/test_utils.c b/components/spiffs/test_spiffs_host/test_utils.c
deleted file mode 100644 (file)
index 3e4b057..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#include "esp_spi_flash.h"
-#include "esp_partition.h"
-
-void init_spi_flash(const char* chip_size, size_t block_size, size_t sector_size, size_t page_size, const char* partition_bin)
-{
-    spi_flash_init(chip_size, block_size, sector_size, page_size, partition_bin);
-}
index 5d94990cc26c43819738ee2b55d0db92f248a8a8..40e517445a0baac988c77f45119e109318fd24d2 100644 (file)
@@ -80,7 +80,6 @@ $(foreach cxxfile, $(CPPFILES), $(eval $(call COMPILE_CPP, $(cxxfile))))
 TEST_SOURCE_FILES = \
        test_wl.cpp \
        main.cpp \
-       test_utils.c
 
 TEST_OBJ_FILES = $(filter %.o, $(TEST_SOURCE_FILES:.cpp=.o) $(TEST_SOURCE_FILES:.c=.o))
 
diff --git a/components/wear_levelling/test_wl_host/test_utils.c b/components/wear_levelling/test_wl_host/test_utils.c
deleted file mode 100644 (file)
index 3e4b057..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#include "esp_spi_flash.h"
-#include "esp_partition.h"
-
-void init_spi_flash(const char* chip_size, size_t block_size, size_t sector_size, size_t page_size, const char* partition_bin)
-{
-    spi_flash_init(chip_size, block_size, sector_size, page_size, partition_bin);
-}
index 258902439193965a0f207fda68d700cfb0b3257d..32993876ca9788ca94fed0c32a485049d9effb01 100644 (file)
 
 #include "sdkconfig.h"
 
-extern "C" void init_spi_flash(const char* chip_size, size_t block_size, size_t sector_size, size_t page_size, const char* partition_bin);
+extern "C" void _spi_flash_init(const char* chip_size, size_t block_size, size_t sector_size, size_t page_size, const char* partition_bin);
 extern SpiFlash spiflash;
 
 #define TEST_COUNT_MAX 100
 
 TEST_CASE("write and read back data", "[wear_levelling]")
 {
-    init_spi_flash(CONFIG_ESPTOOLPY_FLASHSIZE, CONFIG_WL_SECTOR_SIZE * 16, CONFIG_WL_SECTOR_SIZE, CONFIG_WL_SECTOR_SIZE, "partition_table.bin");
+    _spi_flash_init(CONFIG_ESPTOOLPY_FLASHSIZE, CONFIG_WL_SECTOR_SIZE * 16, CONFIG_WL_SECTOR_SIZE, CONFIG_WL_SECTOR_SIZE, "partition_table.bin");
 
     esp_err_t result;
     wl_handle_t wl_handle;
@@ -92,7 +92,7 @@ TEST_CASE("write and read back data", "[wear_levelling]")
 
 TEST_CASE("power down test", "[wear_levelling]")
 {
-    init_spi_flash(CONFIG_ESPTOOLPY_FLASHSIZE, CONFIG_WL_SECTOR_SIZE * 16, CONFIG_WL_SECTOR_SIZE, CONFIG_WL_SECTOR_SIZE, "partition_table.bin");
+    _spi_flash_init(CONFIG_ESPTOOLPY_FLASHSIZE, CONFIG_WL_SECTOR_SIZE * 16, CONFIG_WL_SECTOR_SIZE, CONFIG_WL_SECTOR_SIZE, "partition_table.bin");
 
     esp_err_t result;
     wl_handle_t wl_handle;