Skip to content

Commit 9a5841a

Browse files
committed
Kvstore tests api change to run on K64F only
Change KVStore API tests to run only on K64F, these tests check the KVStore functionality without actually testing the board's storage, Thus they should produce the same results for each device they run on. K64F was selected for no special technical reason but only because of it being available and convenient to use.
1 parent cc89c20 commit 9a5841a

File tree

5 files changed

+35
-1
lines changed

5 files changed

+35
-1
lines changed

features/storage/TESTS/kvstore/filesystemstore_tests/main.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,11 @@ static const int heap_alloc_threshold_size = 4096;
3838
using namespace utest::v1;
3939
using namespace mbed;
4040

41-
BlockDevice *bd = BlockDevice::get_default_instance();
41+
BlockDevice *bd = NULL;
42+
43+
#if defined(TARGET_K64F)
44+
bd = BlockDevice::get_default_instance();
45+
#endif
4246

4347
typedef struct {
4448
int thread_num;

features/storage/TESTS/kvstore/general_tests_phase_1/main.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,11 @@ static const int heap_alloc_threshold_size = 4096;
7373
//init the blockdevice
7474
static void kvstore_init()
7575
{
76+
77+
#if !defined(TARGET_K64F)
78+
TEST_SKIP_MESSAGE("Kvstore API tests run only on K64F devices");
79+
#endif
80+
7681
int res;
7782

7883
res = bd->init();

features/storage/TESTS/kvstore/general_tests_phase_2/main.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,11 @@ static const int heap_alloc_threshold_size = 4096;
7373
//init the blockdevice
7474
static void kvstore_init()
7575
{
76+
77+
#if !defined(TARGET_K64F)
78+
TEST_SKIP_MESSAGE("Kvstore API tests run only on K64F devices");
79+
#endif
80+
7681
int res;
7782

7883
res = bd->init();

features/storage/TESTS/kvstore/securestore_whitebox/main.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,11 @@ static const char *const key7_val1 = "7 is a lucky number";
9292

9393
static void white_box_test()
9494
{
95+
96+
#if !defined(TARGET_K64F)
97+
TEST_SKIP_MESSAGE("Kvstore API tests run only on K64F devices");
98+
#endif
99+
95100
uint8_t get_buf[256];
96101
size_t actual_data_size;
97102
int result;

features/storage/TESTS/kvstore/tdbstore_whitebox/main.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,11 @@ static const char *const res_val2 = "This should surely not be saved as the res
9595

9696
static void white_box_test()
9797
{
98+
99+
#if !defined(TARGET_K64F)
100+
TEST_SKIP_MESSAGE("Kvstore API tests run only on K64F devices");
101+
#endif
102+
98103
bd_params_t bd_params[] = {
99104
{8192, 1, 16, 4096}, // Standard
100105
{4096 * 4, 1, 1, 4096}, // K82F like
@@ -332,6 +337,11 @@ static void white_box_test()
332337

333338
static void multi_set_test()
334339
{
340+
341+
#if !defined(TARGET_K64F)
342+
TEST_SKIP_MESSAGE("Kvstore API tests run only on K64F devices");
343+
#endif
344+
335345
char *key;
336346
uint8_t *get_buf, *set_buf;
337347
size_t key_size = 32;
@@ -451,6 +461,11 @@ static void multi_set_test()
451461

452462
static void error_inject_test()
453463
{
464+
465+
#if !defined(TARGET_K64F)
466+
TEST_SKIP_MESSAGE("Kvstore API tests run only on K64F devices");
467+
#endif
468+
454469
char *key;
455470
uint8_t *get_buf, *set_buf, *exists;
456471
size_t key_size = 8;

0 commit comments

Comments
 (0)