Skip to content

Commit 8e6b9ee

Browse files
author
Jarno Lamsa
committed
Minor fixes to TDBStore moduletests
1 parent 2a4e481 commit 8e6b9ee

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

UNITTESTS/moduletests/storage/kvstore/TDBStore/moduletest.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ TEST_F(TDBStoreModuleTest, set_get)
6060
EXPECT_STREQ("data", buf);
6161
}
6262

63-
TEST_F(TDBStoreModuleTest, erased_get_set)
63+
TEST_F(TDBStoreModuleTest, erased_set_get)
6464
{
6565
EXPECT_EQ(tdb.deinit(), MBED_SUCCESS);
6666
EXPECT_EQ(flash.init(), MBED_SUCCESS);
@@ -102,11 +102,11 @@ TEST_F(TDBStoreModuleTest, corrupted_set_deinit_init_get)
102102
for (int i = 0; i < 100; ++i) {
103103
EXPECT_EQ(tdb.deinit(), MBED_SUCCESS);
104104
// Corrupt the first part of the storage
105-
for (int i = 0; i < heap.size()/BLOCK_SIZE/2; i++) {
106-
for (int j = 0; j < BLOCK_SIZE; j++) {
107-
block[j] = rand();
105+
for (int j = 0; j < heap.size()/BLOCK_SIZE/2; j++) {
106+
for (int k = 0; k < BLOCK_SIZE; k++) {
107+
block[k] = rand();
108108
}
109-
EXPECT_EQ(heap.program(block, BLOCK_SIZE * i, BLOCK_SIZE), MBED_SUCCESS);
109+
EXPECT_EQ(heap.program(block, BLOCK_SIZE * j, BLOCK_SIZE), MBED_SUCCESS);
110110
}
111111
EXPECT_EQ(tdb.init(), MBED_SUCCESS);
112112
for (int j = 0; j < 100; ++j) {

0 commit comments

Comments
 (0)