From a428af8c9f5adcd33b0c12439a9430e5a3393615 Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Thu, 4 May 2017 16:42:22 +0800 Subject: [PATCH] =?UTF-8?q?unit=20tests:=20change=20type=20of=20flash=5Fte?= =?UTF-8?q?st=20partition=20to=20=E2=80=98fat=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This change makes the spi_flash test partition usable for WL and FATFS tests. --- components/partition_table/test/test_partition.c | 2 +- tools/unit-test-app/components/unity/test_utils.c | 6 +++--- tools/unit-test-app/partition_table_unit_test_app.csv | 6 ++++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/components/partition_table/test/test_partition.c b/components/partition_table/test/test_partition.c index 6cb13bd9a7..64ead9692c 100644 --- a/components/partition_table/test/test_partition.c +++ b/components/partition_table/test/test_partition.c @@ -27,7 +27,7 @@ TEST_CASE("Can read partition table", "[partition]") ++count; } esp_partition_iterator_release(it); - TEST_ASSERT_EQUAL(3, count); + TEST_ASSERT_EQUAL(4, count); } TEST_CASE("Can write, read, mmap partition", "[partition][ignore]") diff --git a/tools/unit-test-app/components/unity/test_utils.c b/tools/unit-test-app/components/unity/test_utils.c index 416853a7f3..08826d319d 100644 --- a/tools/unit-test-app/components/unity/test_utils.c +++ b/tools/unit-test-app/components/unity/test_utils.c @@ -17,9 +17,9 @@ const esp_partition_t *get_test_data_partition() { - /* This user type/subtype (0x55) is set in - partition_table_unit_test_app.csv */ - const esp_partition_t *result = esp_partition_find_first(0x55, 0x55, NULL); + /* This finds "flash_test" partition defined in partition_table_unit_test_app.csv */ + const esp_partition_t *result = esp_partition_find_first(ESP_PARTITION_TYPE_DATA, + ESP_PARTITION_SUBTYPE_ANY, "flash_test"); TEST_ASSERT_NOT_NULL(result); /* means partition table set wrong */ return result; } diff --git a/tools/unit-test-app/partition_table_unit_test_app.csv b/tools/unit-test-app/partition_table_unit_test_app.csv index 129d0d3f64..279f5b69de 100644 --- a/tools/unit-test-app/partition_table_unit_test_app.csv +++ b/tools/unit-test-app/partition_table_unit_test_app.csv @@ -10,5 +10,7 @@ factory, 0, 0, 0x10000, 1M # (done this way so tests can run in 2MB of flash.) ota_0, 0, ota_0, , 128K ota_1, 0, ota_1, , 128K -# flash_test partition used for SPI flash tests -flash_test, 0x55, 0x55, , 512K +# flash_test partition used for SPI flash tests and WL FAT partition +# 528K is the minimal size needed to create a FAT partition +# (128 sectors for FAT + 4 sectors for WL) +flash_test, data, fat, , 528K