From 1692d8897a864f3db72ed4ff985fe85103f99b27 Mon Sep 17 00:00:00 2001 From: yangjian Date: Wed, 8 Dec 2021 21:23:45 +0800 Subject: [PATCH] feat: kvstore test add data path Signed-off-by: yangjian Change-Id: I2fcbad13e2bfe3e752ba437c49320fd816b5c5e0 --- utils_lite/kv_store_hal/BUILD.gn | 6 ++++++ utils_lite/kv_store_hal/src/kvstore_func_test.c | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/utils_lite/kv_store_hal/BUILD.gn b/utils_lite/kv_store_hal/BUILD.gn index e2f63672b..0dbaaf553 100755 --- a/utils_lite/kv_store_hal/BUILD.gn +++ b/utils_lite/kv_store_hal/BUILD.gn @@ -13,6 +13,10 @@ import("//test/xts/tools/lite/build/suite_lite.gni") +declare_args() { + config_ohos_xts_acts_utils_lite_kv_store_data_path = "" +} + hctest_suite("ActsKvStoreTest") { suite_name = "acts" sources = [ "src/kvstore_func_test.c" ] @@ -23,4 +27,6 @@ hctest_suite("ActsKvStoreTest") { "//base/iot_hardware/peripheral/interfaces/kits", ] cflags = [ "-Wno-error" ] + defines = + [ "DATA_PATH=\"${config_ohos_xts_acts_utils_lite_kv_store_data_path}\"" ] } diff --git a/utils_lite/kv_store_hal/src/kvstore_func_test.c b/utils_lite/kv_store_hal/src/kvstore_func_test.c index 8357e49db..ddc120404 100755 --- a/utils_lite/kv_store_hal/src/kvstore_func_test.c +++ b/utils_lite/kv_store_hal/src/kvstore_func_test.c @@ -27,6 +27,10 @@ #define MAX_CACHE_NUM_TEST 10 #define INVALID_KEY_NUM 128 +#ifndef DATA_PATH +#define DATA_PATH "/data" +#endif + /** * @tc.desc : register a test suite, this suite is used to test basic flow and interface dependency * @param : subsystem name is utils @@ -41,6 +45,7 @@ LITE_TEST_SUIT(utils, kvStore, KvStoreFuncTestSuite); */ static BOOL KvStoreFuncTestSuiteSetUp(void) { + UtilsSetEnv(DATA_PATH); return TRUE; } -- GitLab