mirror of https://github.com/ARMmbed/mbed-os.git
FileSystemStore unit test: remove erased_set_get test
The "erased_set_get" test case deinits `FileSystemStore`, erases the block device, and reinits `FileSystemStore`. This of course fails, because `BlockDevice::erase()` removes all stored data including the format of the `FileSystem` (middle layer), unless the particular type of block device has a no-op erase implementation. Note: Previously `HeapBlockDevice::erase()` was essentially a no-op so this test case did not fail. We recently added the freeing of heap memory and it uncovered the problem.pull/14483/head
parent
6b5e467f96
commit
e8070514b1
|
|
@ -67,21 +67,6 @@ TEST_F(FileSystemStoreModuleTest, set_get)
|
|||
EXPECT_STREQ("data", buf);
|
||||
}
|
||||
|
||||
TEST_F(FileSystemStoreModuleTest, erased_set_get)
|
||||
{
|
||||
EXPECT_EQ(store->deinit(), MBED_SUCCESS);
|
||||
EXPECT_EQ(heap.init(), MBED_SUCCESS);
|
||||
EXPECT_EQ(heap.erase(0, heap.size()), MBED_SUCCESS);
|
||||
EXPECT_EQ(heap.deinit(), MBED_SUCCESS);
|
||||
EXPECT_EQ(store->init(), MBED_SUCCESS);
|
||||
char buf[100];
|
||||
size_t size;
|
||||
EXPECT_EQ(store->set("key", "data", 5, 0), MBED_SUCCESS);
|
||||
EXPECT_EQ(store->get("key", buf, 100, &size), MBED_SUCCESS);
|
||||
EXPECT_EQ(size, 5);
|
||||
EXPECT_STREQ("data", buf);
|
||||
}
|
||||
|
||||
TEST_F(FileSystemStoreModuleTest, set_deinit_init_get)
|
||||
{
|
||||
char buf[100];
|
||||
|
|
|
|||
Loading…
Reference in New Issue