vfs, spi_flash: re-enable unit tests for C2

pull/9811/merge
Ivan Grokhotkov 2022-09-29 22:37:01 +02:00
rodzic 0b6bc7045e
commit 0a352a6ff2
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 1E050E141B280628
6 zmienionych plików z 23 dodań i 25 usunięć

Wyświetl plik

@ -61,8 +61,6 @@ TEST_CASE("Test erase partition", "[spi_flash][esp_flash]")
}
}
#if !TEMPORARY_DISABLED_FOR_TARGETS(ESP32C2)
//IDF-5137
static bool s_test_nonzero_sha_of_partition(const esp_partition_t *part, bool allow_invalid_image)
{
uint8_t sha256[32] = { 0 };
@ -140,4 +138,3 @@ TEST_CASE("Test esp_partition_get_sha256() that it can handle a big partition",
spi_flash_munmap(handle);
}
#endif //!TEMPORARY_DISABLED_FOR_TARGETS(ESP32C2)

Wyświetl plik

@ -89,8 +89,6 @@ static inline void test_fatfs_delete_file(const char *name)
TEST_ASSERT_EQUAL(ret, 0);
}
#if !TEMPORARY_DISABLED_FOR_TARGETS(ESP32C2)
//IDF-5139
TEST_CASE("Can use access() for FATFS", "[vfs][fatfs][wear_levelling]")
{
const char *path = "/spiflash/access.txt";
@ -130,4 +128,3 @@ TEST_CASE("Can use access() for FATFS", "[vfs][fatfs][wear_levelling]")
test_spi_flash_teardown();
}
#endif //!TEMPORARY_DISABLED_FOR_TARGETS(ESP32C2)

Wyświetl plik

@ -78,8 +78,6 @@ static void test_append(const char *path)
TEST_ASSERT_NOT_EQUAL(-1, unlink(path));
}
#if !TEMPORARY_DISABLED_FOR_TARGETS(ESP32C2)
//IDF-5139
TEST_CASE("open() with O_APPEND on FATFS works well", "[vfs][FATFS]")
{
wl_handle_t test_wl_handle;
@ -94,7 +92,6 @@ TEST_CASE("open() with O_APPEND on FATFS works well", "[vfs][FATFS]")
TEST_ESP_OK(esp_vfs_fat_spiflash_unmount_rw_wl("/spiflash", test_wl_handle));
}
#endif //!TEMPORARY_DISABLED_FOR_TARGETS(ESP32C2)
TEST_CASE("open() with O_APPEND on SPIFFS works well", "[vfs][spiffs]")
{

Wyświetl plik

@ -544,8 +544,6 @@ TEST_CASE("concurrent selects work", "[vfs]")
close(dummy_socket_fd);
}
#if !TEMPORARY_DISABLED_FOR_TARGETS(ESP32C2)
//IDF-5139
TEST_CASE("select() works with concurrent mount", "[vfs][fatfs]")
{
wl_handle_t test_wl_handle;
@ -607,4 +605,3 @@ TEST_CASE("select() works with concurrent mount", "[vfs][fatfs]")
deinit(uart_fd, socket_fd);
close(dummy_socket_fd);
}
#endif //!TEMPORARY_DISABLED_FOR_TARGETS(ESP32C2)

Wyświetl plik

@ -208,8 +208,6 @@ TEST_CASE("fcntl supported in UART VFS", "[vfs]")
}
#ifdef CONFIG_VFS_SUPPORT_TERMIOS
#if !TEMPORARY_DISABLED_FOR_TARGETS(ESP32C2)
//IDF-5139
TEST_CASE("Can use termios for UART", "[vfs]")
{
uart_config_t uart_config = {
@ -303,31 +301,41 @@ TEST_CASE("Can use termios for UART", "[vfs]")
TEST_ASSERT_EQUAL(0, tcsetattr(uart_fd, TCSANOW, &tios));
TEST_ASSERT_EQUAL(0, tcgetattr(uart_fd, &tios_result));
TEST_ASSERT_EQUAL(CBAUD, tios_result.c_cflag & CBAUD);
TEST_ASSERT_EQUAL(B38400, tios_result.c_ispeed);
TEST_ASSERT_EQUAL(B38400, tios_result.c_ospeed);
TEST_ASSERT_EQUAL(ESP_OK, uart_get_baudrate(UART_NUM_1, &baudrate));
TEST_ASSERT_EQUAL(38400, baudrate);
TEST_ASSERT_INT32_WITHIN(2, 38400, baudrate);
if (APB_CLK_FREQ == 40000000) {
// Setting the speed to 38400 will set it actually to 38401
// Note: can't use TEST_ASSERT_INT32_WITHIN here because B38400 == 15
TEST_ASSERT_EQUAL(38401, tios_result.c_ispeed);
TEST_ASSERT_EQUAL(38401, tios_result.c_ospeed);
} else {
TEST_ASSERT_EQUAL(B38400, tios_result.c_ispeed);
TEST_ASSERT_EQUAL(B38400, tios_result.c_ospeed);
}
tios.c_cflag |= CBAUDEX;
tios.c_ispeed = tios.c_ospeed = B230400;
TEST_ASSERT_EQUAL(0, tcsetattr(uart_fd, TCSANOW, &tios));
TEST_ASSERT_EQUAL(0, tcgetattr(uart_fd, &tios_result));
TEST_ASSERT_EQUAL(BOTHER, tios_result.c_cflag & BOTHER);
// Setting the speed to 230400 will set it actually to 230423
TEST_ASSERT_EQUAL(230423, tios_result.c_ispeed);
TEST_ASSERT_EQUAL(230423, tios_result.c_ospeed);
TEST_ASSERT_EQUAL(ESP_OK, uart_get_baudrate(UART_NUM_1, &baudrate));
TEST_ASSERT_EQUAL(230423, baudrate);
// Setting the speed to 230400 will set it actually to something else,
// depending on the APB clock
TEST_ASSERT_INT32_WITHIN(100, 230400, tios_result.c_ispeed);
TEST_ASSERT_INT32_WITHIN(100, 230400, tios_result.c_ospeed);
TEST_ASSERT_INT32_WITHIN(100, 230400, baudrate);
tios.c_cflag |= BOTHER;
tios.c_ispeed = tios.c_ospeed = 42321;
TEST_ASSERT_EQUAL(0, tcsetattr(uart_fd, TCSANOW, &tios));
TEST_ASSERT_EQUAL(0, tcgetattr(uart_fd, &tios_result));
TEST_ASSERT_EQUAL(BOTHER, tios_result.c_cflag & BOTHER);
TEST_ASSERT_EQUAL(42321, tios_result.c_ispeed);
TEST_ASSERT_EQUAL(42321, tios_result.c_ospeed);
TEST_ASSERT_EQUAL(ESP_OK, uart_get_baudrate(UART_NUM_1, &baudrate));
TEST_ASSERT_EQUAL(42321, baudrate);
// Setting the speed to 230400 will set it actually to something else,
// depending on the APB clock
TEST_ASSERT_INT32_WITHIN(10, 42321, tios_result.c_ispeed);
TEST_ASSERT_INT32_WITHIN(10, 42321, tios_result.c_ospeed);
TEST_ASSERT_INT32_WITHIN(10, 42321, baudrate);
memset(&tios_result, 0xFF, sizeof(struct termios));
}
@ -336,5 +344,4 @@ TEST_CASE("Can use termios for UART", "[vfs]")
close(uart_fd);
uart_driver_delete(UART_NUM_1);
}
#endif //!TEMPORARY_DISABLED_FOR_TARGETS(ESP32C2)
#endif // CONFIG_VFS_SUPPORT_TERMIOS

Wyświetl plik

@ -2,3 +2,6 @@ CONFIG_ESP_SYSTEM_MEMPROT_FEATURE=n
CONFIG_ESPTOOLPY_FLASHSIZE_2MB=y
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partition_table_unit_test_app_2m.csv"
CONFIG_PARTITION_TABLE_FILENAME="partition_table_unit_test_app_2m.csv"
# 2MB partition table has a FAT partition too small for 4k sectors
CONFIG_WL_SECTOR_SIZE_512=y