mirror of https://github.com/ARMmbed/mbed-os.git
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.pull/9244/head
parent
cc89c20abc
commit
9a5841ad00
|
@ -38,7 +38,11 @@ static const int heap_alloc_threshold_size = 4096;
|
||||||
using namespace utest::v1;
|
using namespace utest::v1;
|
||||||
using namespace mbed;
|
using namespace mbed;
|
||||||
|
|
||||||
BlockDevice *bd = BlockDevice::get_default_instance();
|
BlockDevice *bd = NULL;
|
||||||
|
|
||||||
|
#if defined(TARGET_K64F)
|
||||||
|
bd = BlockDevice::get_default_instance();
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int thread_num;
|
int thread_num;
|
||||||
|
|
|
@ -73,6 +73,11 @@ static const int heap_alloc_threshold_size = 4096;
|
||||||
//init the blockdevice
|
//init the blockdevice
|
||||||
static void kvstore_init()
|
static void kvstore_init()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
#if !defined(TARGET_K64F)
|
||||||
|
TEST_SKIP_MESSAGE("Kvstore API tests run only on K64F devices");
|
||||||
|
#endif
|
||||||
|
|
||||||
int res;
|
int res;
|
||||||
|
|
||||||
res = bd->init();
|
res = bd->init();
|
||||||
|
|
|
@ -73,6 +73,11 @@ static const int heap_alloc_threshold_size = 4096;
|
||||||
//init the blockdevice
|
//init the blockdevice
|
||||||
static void kvstore_init()
|
static void kvstore_init()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
#if !defined(TARGET_K64F)
|
||||||
|
TEST_SKIP_MESSAGE("Kvstore API tests run only on K64F devices");
|
||||||
|
#endif
|
||||||
|
|
||||||
int res;
|
int res;
|
||||||
|
|
||||||
res = bd->init();
|
res = bd->init();
|
||||||
|
|
|
@ -92,6 +92,11 @@ static const char *const key7_val1 = "7 is a lucky number";
|
||||||
|
|
||||||
static void white_box_test()
|
static void white_box_test()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
#if !defined(TARGET_K64F)
|
||||||
|
TEST_SKIP_MESSAGE("Kvstore API tests run only on K64F devices");
|
||||||
|
#endif
|
||||||
|
|
||||||
uint8_t get_buf[256];
|
uint8_t get_buf[256];
|
||||||
size_t actual_data_size;
|
size_t actual_data_size;
|
||||||
int result;
|
int result;
|
||||||
|
|
|
@ -95,6 +95,11 @@ static const char *const res_val2 = "This should surely not be saved as the res
|
||||||
|
|
||||||
static void white_box_test()
|
static void white_box_test()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
#if !defined(TARGET_K64F)
|
||||||
|
TEST_SKIP_MESSAGE("Kvstore API tests run only on K64F devices");
|
||||||
|
#endif
|
||||||
|
|
||||||
bd_params_t bd_params[] = {
|
bd_params_t bd_params[] = {
|
||||||
{8192, 1, 16, 4096}, // Standard
|
{8192, 1, 16, 4096}, // Standard
|
||||||
{4096 * 4, 1, 1, 4096}, // K82F like
|
{4096 * 4, 1, 1, 4096}, // K82F like
|
||||||
|
@ -332,6 +337,11 @@ static void white_box_test()
|
||||||
|
|
||||||
static void multi_set_test()
|
static void multi_set_test()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
#if !defined(TARGET_K64F)
|
||||||
|
TEST_SKIP_MESSAGE("Kvstore API tests run only on K64F devices");
|
||||||
|
#endif
|
||||||
|
|
||||||
char *key;
|
char *key;
|
||||||
uint8_t *get_buf, *set_buf;
|
uint8_t *get_buf, *set_buf;
|
||||||
size_t key_size = 32;
|
size_t key_size = 32;
|
||||||
|
@ -451,6 +461,11 @@ static void multi_set_test()
|
||||||
|
|
||||||
static void error_inject_test()
|
static void error_inject_test()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
#if !defined(TARGET_K64F)
|
||||||
|
TEST_SKIP_MESSAGE("Kvstore API tests run only on K64F devices");
|
||||||
|
#endif
|
||||||
|
|
||||||
char *key;
|
char *key;
|
||||||
uint8_t *get_buf, *set_buf, *exists;
|
uint8_t *get_buf, *set_buf, *exists;
|
||||||
size_t key_size = 8;
|
size_t key_size = 8;
|
||||||
|
|
Loading…
Reference in New Issue