提交 2fa83a50 编写于 作者: C chengjinsong2

Merge branch '1010_API' of https://gitee.com/chneg-jinsong/startup_init_lite_1 into 1010_API

......@@ -56,9 +56,7 @@ ohos_shared_library("systemparameterv9") {
"//third_party/libuv/include",
]
sources = [
"src_v9/native_parameters_js.cpp",
]
sources = [ "src_v9/native_parameters_js.cpp" ]
deps = [
"//base/startup/init/interfaces/innerkits:libbeget_proxy",
......
......@@ -150,7 +150,6 @@ static napi_value Set(napi_env env, napi_callback_info info)
napi_value thisVar = nullptr;
void *data = nullptr;
napi_get_cb_info(env, info, &argc, argv, &thisVar, &data);
PARAM_NAPI_ASSERT(env, argc >= ARGC_NUMBER, SYSPARAM_INVALID_INPUT, "requires 2 parameter");
StorageAsyncContextPtr asyncContext = new StorageAsyncContext();
asyncContext->env = env;
......
......@@ -180,17 +180,17 @@ HWTEST_F(SysparaModuleTest, Syspara_SetParameter_test_005, TestSize.Level0)
char key1[] = "test.param.name.xxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxx";
char value[] = "test.value.xxxx";
int ret = SetParameter(key1, value);
EXPECT_EQ(ret, SYSPARAM_INVALID_INPUT);
EXPECT_EQ(ret, EC_INVALID);
//check param name, Illegal param name
char key2[] = ".test.param.name.xxxxx";
ret = SetParameter(key2, value);
EXPECT_EQ(ret, SYSPARAM_INVALID_INPUT);
EXPECT_EQ(ret, EC_INVALID);
char key3[] = "test..param.name.xxxxx";
ret = SetParameter(key3, value);
EXPECT_EQ(ret, SYSPARAM_INVALID_INPUT);
EXPECT_EQ(ret, EC_INVALID);
char key4[] = "test..param. .name";
ret = SetParameter(key4, value);
EXPECT_EQ(ret, SYSPARAM_INVALID_INPUT);
EXPECT_EQ(ret, EC_INVALID);
//check param name, legal param name
char key5[] = "test.param.name.--__.:::";
ret = SetParameter(key5, value);
......@@ -284,7 +284,7 @@ HWTEST_F(SysparaModuleTest, Syspara_SetParameter_test_007, TestSize.Level0)
}
string value2 = "test.param.value.002";
ret = SetParameter(key1.c_str(), value2.c_str());
EXPECT_EQ(ret, SYSPARAM_INVALID_INPUT);
EXPECT_EQ(ret, EC_INVALID);
string key2 = "ro.param.test";
string value3 = "test.param.value.003";
......@@ -298,7 +298,7 @@ HWTEST_F(SysparaModuleTest, Syspara_SetParameter_test_007, TestSize.Level0)
}
string value4 = "test.param.value.004";
ret = SetParameter(key2.c_str(), value4.c_str());
EXPECT_EQ(ret, SYSPARAM_INVALID_INPUT);
EXPECT_EQ(ret, EC_INVALID);
GTEST_LOG_(INFO) << "Syspara_SetParameter_test_007 end";
}
......
......@@ -264,7 +264,7 @@ HWTEST_F(SysparaUnitTest, parameterTest0012, TestSize.Level0)
ret = GetParameterValue(handle, valueGet1, 32);
EXPECT_EQ(ret, SYSPARAM_NOT_FOUND);
ret = GetParameterName(handle, nameGet1, 32);
EXPECT_EQ(ret, SYSPARAM_SYSTEM_ERROR);
EXPECT_EQ(ret, SYSPARAM_NOT_FOUND);
}
HWTEST_F(SysparaUnitTest, parameterTest0013, TestSize.Level0)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册