Skip to content

Commit 1bde5e0

Browse files
committed
Add num-blocks and max-test-size as configuration options in mbed_lib
1 parent e76368c commit 1bde5e0

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

components/storage/blockdevice/COMPONENT_FLASHIAP/TESTS/filesystem/fopen/fopen.cpp

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,7 @@ static char fslittle_fopen_utest_msg_g[FSLITTLE_UTEST_MSG_BUF_SIZE];
8888
#define FSLITTLE_FOPEN_TEST_MOUNT_PT_PATH "/" FSLITTLE_FOPEN_TEST_MOUNT_PT_NAME
8989
#define FSLITTLE_FOPEN_TEST_WORK_BUF_SIZE_1 64
9090
#define FSLITTLE_FOPEN_TEST_FILEPATH_MAX_DEPTH 20
91-
#ifdef TARGET_SAML21J18A
92-
static const int MAX_TEST_SIZE = 64 * 1024;
93-
#else
94-
static const int MAX_TEST_SIZE = 256 * 1024 * 2;
95-
#endif
91+
static const int MAX_TEST_SIZE = MBED_CONF_FLASHIAP_BLOCK_DEVICE_MAX_TEST_SIZE;
9692
static const char *sd_badfile_path = "/sd/badfile.txt";
9793
static const char *sd_testfile_path = "/sd/test.txt";
9894

@@ -1431,11 +1427,7 @@ control_t fslittle_fopen_test_15(const size_t call_count)
14311427
{
14321428
int32_t ret = 0;
14331429
fslittle_kv_data_t *node = fslittle_fopen_test_15_kv_data;
1434-
#ifdef TARGET_SAML21J18A
1435-
const int32_t num_blocks = 3; /* each file 768b */
1436-
#else
1437-
const int32_t num_blocks = 100; /* each file ~25kB */
1438-
#endif
1430+
const int32_t num_blocks = MBED_CONF_FLASHIAP_BLOCK_DEVICE_NUM_BLOCKS;
14391431

14401432
FSLITTLE_DBGLOG("%s:entered\n", __func__);
14411433
(void) call_count;

components/storage/blockdevice/COMPONENT_FLASHIAP/mbed_lib.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@
88
"size": {
99
"help": "Memory allocated for block device.",
1010
"value": "0"
11+
},
12+
"num-blocks": {
13+
"help": "Number of 256 byte blocks to use per file in the stress test",
14+
"value": 100
15+
},
16+
"max-test-size": {
17+
"help": "Maximum size of the FlashIAP block device",
18+
"value": "256 * 1024 * 2"
1119
}
1220
},
1321
"target_overrides": {
@@ -17,7 +25,9 @@
1725
},
1826
"SAML21J18A": {
1927
"base-address": "0x30000",
20-
"size": "0x10000"
28+
"size": "0x10000",
29+
"num-blocks": 3,
30+
"max-test-size": "64 * 1024"
2131
}
2232
}
2333
}

0 commit comments

Comments
 (0)