Skip to content

Commit e807051

Browse files
committed
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.
1 parent 6b5e467 commit e807051

File tree

1 file changed

+0
-15
lines changed
  • storage/kvstore/filesystemstore/tests/UNITTESTS/FileSystemStore

1 file changed

+0
-15
lines changed

storage/kvstore/filesystemstore/tests/UNITTESTS/FileSystemStore/moduletest.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -67,21 +67,6 @@ TEST_F(FileSystemStoreModuleTest, set_get)
6767
EXPECT_STREQ("data", buf);
6868
}
6969

70-
TEST_F(FileSystemStoreModuleTest, erased_set_get)
71-
{
72-
EXPECT_EQ(store->deinit(), MBED_SUCCESS);
73-
EXPECT_EQ(heap.init(), MBED_SUCCESS);
74-
EXPECT_EQ(heap.erase(0, heap.size()), MBED_SUCCESS);
75-
EXPECT_EQ(heap.deinit(), MBED_SUCCESS);
76-
EXPECT_EQ(store->init(), MBED_SUCCESS);
77-
char buf[100];
78-
size_t size;
79-
EXPECT_EQ(store->set("key", "data", 5, 0), MBED_SUCCESS);
80-
EXPECT_EQ(store->get("key", buf, 100, &size), MBED_SUCCESS);
81-
EXPECT_EQ(size, 5);
82-
EXPECT_STREQ("data", buf);
83-
}
84-
8570
TEST_F(FileSystemStoreModuleTest, set_deinit_init_get)
8671
{
8772
char buf[100];

0 commit comments

Comments
 (0)