Skip to content

Commit 1799ace

Browse files
committed
Fix intermittent config store tests failures
Make the journal object in cfstore_test_startup static since the call to FlashJournal_initialize keep a copy of this for future use. This fixes an intermittent crash start started showing up when optimizations were set to "-os".
1 parent bf1ac0d commit 1799ace

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

features/storage/FEATURE_STORAGE/TESTS/cfstore/example1/example1.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ static int32_t cfstore_test_startup(void)
273273
#ifdef CFSTORE_CONFIG_BACKEND_FLASH_ENABLED
274274

275275
int32_t ret = ARM_DRIVER_ERROR;
276-
FlashJournal_t jrnl;
276+
static FlashJournal_t jrnl;
277277
extern ARM_DRIVER_STORAGE ARM_Driver_Storage_(0);
278278
const ARM_DRIVER_STORAGE *drv = &ARM_Driver_Storage_(0);
279279

features/storage/FEATURE_STORAGE/TESTS/cfstore/example5/example5.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ int32_t cfstore_test_startup(void)
166166

167167
#ifdef CFSTORE_CONFIG_BACKEND_FLASH_ENABLED
168168
int32_t ret = ARM_DRIVER_ERROR;
169-
FlashJournal_t jrnl;
169+
static FlashJournal_t jrnl;
170170
extern ARM_DRIVER_STORAGE ARM_Driver_Storage_(0);
171171
const ARM_DRIVER_STORAGE *drv = &ARM_Driver_Storage_(0);
172172

features/storage/FEATURE_STORAGE/cfstore/source/cfstore_test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ int32_t cfstore_test_startup(void)
256256

257257
#ifdef CFSTORE_CONFIG_BACKEND_FLASH_ENABLED
258258

259-
FlashJournal_t jrnl;
259+
static FlashJournal_t jrnl;
260260
extern ARM_DRIVER_STORAGE ARM_Driver_Storage_(0);
261261
const ARM_DRIVER_STORAGE *drv = &ARM_Driver_Storage_(0);
262262

0 commit comments

Comments
 (0)