mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-03 20:54:32 +02:00
nvs: deinit NVS in nvs_stats unit test
This fixes the failure when this test runs after another test which leaves NVS initialized.
This commit is contained in:
@@ -1267,16 +1267,10 @@ TEST_CASE("nvs page selection takes into account free entries also not just eras
|
|||||||
nvs_close(handle);
|
nvs_close(handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE("dump all performance data", "[nvs]")
|
|
||||||
{
|
|
||||||
std::cout << "====================" << std::endl << "Dumping benchmarks" << std::endl;
|
|
||||||
std::cout << s_perf.str() << std::endl;
|
|
||||||
std::cout << "====================" << std::endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST_CASE("calculate used and free space", "[nvs]")
|
TEST_CASE("calculate used and free space", "[nvs]")
|
||||||
{
|
{
|
||||||
SpiFlashEmulator emu(6);
|
SpiFlashEmulator emu(6);
|
||||||
|
nvs_flash_deinit();
|
||||||
TEST_ESP_ERR(nvs_get_stats(NULL, NULL), ESP_ERR_INVALID_ARG);
|
TEST_ESP_ERR(nvs_get_stats(NULL, NULL), ESP_ERR_INVALID_ARG);
|
||||||
nvs_stats_t stat1;
|
nvs_stats_t stat1;
|
||||||
nvs_stats_t stat2;
|
nvs_stats_t stat2;
|
||||||
@@ -1407,3 +1401,16 @@ TEST_CASE("calculate used and free space", "[nvs]")
|
|||||||
|
|
||||||
nvs_close(handle_3);
|
nvs_close(handle_3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* Add new tests above */
|
||||||
|
/* This test has to be the final one */
|
||||||
|
|
||||||
|
TEST_CASE("dump all performance data", "[nvs]")
|
||||||
|
{
|
||||||
|
std::cout << "====================" << std::endl << "Dumping benchmarks" << std::endl;
|
||||||
|
std::cout << s_perf.str() << std::endl;
|
||||||
|
std::cout << "====================" << std::endl;
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user