提交 fdc42c6c 编写于 作者: L limeng151

修改代码参数格式

Signed-off-by: Nlimeng151 <limeng151@huawei.com>
Change-Id: I0306d2897f877a4ae86ad16024f9731ae4856856
上级 76b5c553
...@@ -45,8 +45,8 @@ describe('SystemParameterTest', function () { ...@@ -45,8 +45,8 @@ describe('SystemParameterTest', function () {
} }
}); });
done(); done();
} catch (e) { } catch (err) {
console.info('system_parameter_test_0100 set callback hw_sc.build.os.version unexpect err:' + e); console.info('system_parameter_test_0100 set callback hw_sc.build.os.version unexpect err:' + err);
} }
setTimeout(function(){ setTimeout(function(){
expect(ret).assertTrue(); expect(ret).assertTrue();
...@@ -63,18 +63,18 @@ describe('SystemParameterTest', function () { ...@@ -63,18 +63,18 @@ describe('SystemParameterTest', function () {
console.info('system_parameter_test_0110 start'); console.info('system_parameter_test_0110 start');
let ret = false; let ret = false;
try { try {
systemparameter.set('hw_sc.build.os.version', 111, function (e) { systemparameter.set('hw_sc.build.os.version', 111, function (err) {
if (err == undefined) { if (err == undefined) {
console.info('system_parameter_test_0110 set callback hw_sc.build.os.version value success'); console.info('system_parameter_test_0110 set callback hw_sc.build.os.version value success');
} else { } else {
console.info('system_parameter_test_0110 set callback hw_sc.build.os.version value err:' console.info('system_parameter_test_0110 set callback hw_sc.build.os.version value err:'
+ e.code) + err.code)
} }
}); });
} catch (e) { } catch (err) {
ret = true; ret = true;
console.info('system_parameter_test_0110 set callback hw_sc.build.os.version unexpect err:' + e) console.info('system_parameter_test_0110 set callback hw_sc.build.os.version unexpect err:' + err)
done(); done();
} }
setTimeout(function(){ setTimeout(function(){
...@@ -92,19 +92,19 @@ describe('SystemParameterTest', function () { ...@@ -92,19 +92,19 @@ describe('SystemParameterTest', function () {
console.info('system_parameter_test_0120 start'); console.info('system_parameter_test_0120 start');
let ret = false; let ret = false;
try { try {
systemparameter.set('hw_sc.build.os.version', PROPERTY_MAX_VALUE, function (e) { systemparameter.set('hw_sc.build.os.version', PROPERTY_MAX_VALUE, function (err) {
if (e == undefined) { if (e == undefined) {
console.info('system_parameter_test_0120 set callback hw_sc.build.os.version value success'); console.info('system_parameter_test_0120 set callback hw_sc.build.os.version value success');
} else { } else {
ret = true; ret = true;
console.info('system_parameter_test_0120 set callback hw_sc.build.os.version value err:' + console.info('system_parameter_test_0120 set callback hw_sc.build.os.version value err:' +
e.code); err.code);
done(); done();
} }
}); });
} catch (e) { } catch (err) {
console.info('system_parameter_test_0120 set callback hw_sc.build.os.version unexpect err:' + e); console.info('system_parameter_test_0120 set callback hw_sc.build.os.version unexpect err:' + err);
} }
setTimeout(function(){ setTimeout(function(){
expect(ret).assertTrue(); expect(ret).assertTrue();
...@@ -129,8 +129,8 @@ describe('SystemParameterTest', function () { ...@@ -129,8 +129,8 @@ describe('SystemParameterTest', function () {
}).catch(function (err) { }).catch(function (err) {
console.info('system_parameter_test_0200 promise set hw_sc.build.os.version error: ' + err.code); console.info('system_parameter_test_0200 promise set hw_sc.build.os.version error: ' + err.code);
}); });
} catch (e) { } catch (err) {
console.info('system_parameter_test_0200 set callback hw_sc.build.os.version unexpect err:' + e) console.info('system_parameter_test_0200 set callback hw_sc.build.os.version unexpect err:' + err)
} }
setTimeout(function(){ setTimeout(function(){
...@@ -156,8 +156,8 @@ describe('SystemParameterTest', function () { ...@@ -156,8 +156,8 @@ describe('SystemParameterTest', function () {
console.info('system_parameter_test_0220 promise set hw_sc.build.os.version error: ' + err.code); console.info('system_parameter_test_0220 promise set hw_sc.build.os.version error: ' + err.code);
done(); done();
}); });
} catch (e) { } catch (err) {
console.info('system_parameter_test_0220 set callback hw_sc.build.os.version unexpect err:' + e); console.info('system_parameter_test_0220 set callback hw_sc.build.os.version unexpect err:' + err);
} }
setTimeout(function(){ setTimeout(function(){
expect(ret).assertTrue(); expect(ret).assertTrue();
...@@ -180,9 +180,9 @@ describe('SystemParameterTest', function () { ...@@ -180,9 +180,9 @@ describe('SystemParameterTest', function () {
}).catch(function (err) { }).catch(function (err) {
console.info('system_parameter_test_0230 promise set hw_sc.build.os.version error: ' + err.code); console.info('system_parameter_test_0230 promise set hw_sc.build.os.version error: ' + err.code);
}); });
} catch (e) { } catch (err) {
ret = true; ret = true;
console.info('system_parameter_test_0230 set callback hw_sc.build.os.version unexpect err:' + e); console.info('system_parameter_test_0230 set callback hw_sc.build.os.version unexpect err:' + err);
done(); done();
} }
setTimeout(function(){ setTimeout(function(){
...@@ -203,8 +203,8 @@ describe('SystemParameterTest', function () { ...@@ -203,8 +203,8 @@ describe('SystemParameterTest', function () {
systemparameter.setSync('hw_sc.build.os.version', '2.5.3.10'); systemparameter.setSync('hw_sc.build.os.version', '2.5.3.10');
console.info('system_parameter_test_0300 promise setSync hw_sc.build.os.version success'); console.info('system_parameter_test_0300 promise setSync hw_sc.build.os.version success');
ret = true; ret = true;
} catch (e) { } catch (err) {
console.info('system_parameter_test_0300 promise setSync hw_sc.build.os.version: ' + e); console.info('system_parameter_test_0300 promise setSync hw_sc.build.os.version: ' + err);
} }
expect(ret).assertTrue(); expect(ret).assertTrue();
console.info('system_parameter_test_0300 : end'); console.info('system_parameter_test_0300 : end');
...@@ -235,8 +235,8 @@ describe('SystemParameterTest', function () { ...@@ -235,8 +235,8 @@ describe('SystemParameterTest', function () {
done(); done();
} }
}) })
} catch (e) { } catch (err) {
console.info('system_parameter_test_0310 promise setSync hw_sc.build.os.version: ' + e); console.info('system_parameter_test_0310 promise setSync hw_sc.build.os.version: ' + err);
} }
setTimeout(function(){ setTimeout(function(){
expect(ret).assertTrue(); expect(ret).assertTrue();
...@@ -256,8 +256,8 @@ describe('SystemParameterTest', function () { ...@@ -256,8 +256,8 @@ describe('SystemParameterTest', function () {
systemparameter.setSync('hw_sc.build.os.version', 111); systemparameter.setSync('hw_sc.build.os.version', 111);
console.info('system_parameter_test_0320 promise setSync hw_sc.build.os.version success: '); console.info('system_parameter_test_0320 promise setSync hw_sc.build.os.version success: ');
} catch (e) { } catch (err) {
console.info('system_parameter_test_0320 promise setSync hw_sc.build.os.version error: ' + e); console.info('system_parameter_test_0320 promise setSync hw_sc.build.os.version error: ' + err);
ret = true; ret = true;
} }
expect(ret).assertTrue(); expect(ret).assertTrue();
...@@ -288,9 +288,9 @@ describe('SystemParameterTest', function () { ...@@ -288,9 +288,9 @@ describe('SystemParameterTest', function () {
console.info('system_parameter_test_0340 promise get hw_sc.build.os.version: ' + sysValue); console.info('system_parameter_test_0340 promise get hw_sc.build.os.version: ' + sysValue);
} }
}) })
} catch (e) { } catch (err) {
ret = true; ret = true;
console.info('promise get hw_sc.build.os.version: ' + e); console.info('promise get hw_sc.build.os.version: ' + err);
} }
setTimeout(function(){ setTimeout(function(){
expect(ret).assertTrue(); expect(ret).assertTrue();
...@@ -315,8 +315,8 @@ describe('SystemParameterTest', function () { ...@@ -315,8 +315,8 @@ describe('SystemParameterTest', function () {
}).catch(function (err) { }).catch(function (err) {
console.info(' system_parameter_test_0400 promise get hw_sc.build.os.version error: ' + err.code); console.info(' system_parameter_test_0400 promise get hw_sc.build.os.version error: ' + err.code);
}); });
} catch (e) { } catch (err) {
console.info('system_parameter_test_0400 promise setSync hw_sc.build.os.version error: ' + e); console.info('system_parameter_test_0400 promise setSync hw_sc.build.os.version error: ' + err);
} }
setTimeout(function(){ setTimeout(function(){
expect(ret).assertTrue(); expect(ret).assertTrue();
...@@ -350,8 +350,8 @@ describe('SystemParameterTest', function () { ...@@ -350,8 +350,8 @@ describe('SystemParameterTest', function () {
}).catch(function (err) { }).catch(function (err) {
console.info(' system_parameter_test_0410 promise get hw_sc.build.os.version error: ' + err.code); console.info(' system_parameter_test_0410 promise get hw_sc.build.os.version error: ' + err.code);
}); });
} catch (e) { } catch (err) {
console.info('system_parameter_test_0400 promise get shw_sc.build.os.version error: ' + e); console.info('system_parameter_test_0400 promise get shw_sc.build.os.version error: ' + err);
} }
setTimeout(function(){ setTimeout(function(){
expect(ret).assertTrue(); expect(ret).assertTrue();
...@@ -390,8 +390,8 @@ describe('SystemParameterTest', function () { ...@@ -390,8 +390,8 @@ describe('SystemParameterTest', function () {
console.info(' system_parameter_test_0420 promise get hw_sc.build.os.version error: ' + err.code); console.info(' system_parameter_test_0420 promise get hw_sc.build.os.version error: ' + err.code);
}); });
done(); done();
} catch (e) { } catch (err) {
console.info('system_parameter_test_0420 promise get hw_sc.build.os.version error: ' + e); console.info('system_parameter_test_0420 promise get hw_sc.build.os.version error: ' + err);
} }
setTimeout(function(){ setTimeout(function(){
expect(ret).assertTrue(); expect(ret).assertTrue();
...@@ -418,8 +418,8 @@ describe('SystemParameterTest', function () { ...@@ -418,8 +418,8 @@ describe('SystemParameterTest', function () {
} }
}) })
} catch (e) { } catch (err) {
console.info('system_parameter_test_0430 promise catch get failed ' + e); console.info('system_parameter_test_0430 promise catch get failed ' + err);
} }
setTimeout(function(){ setTimeout(function(){
expect(ret).assertTrue(); expect(ret).assertTrue();
...@@ -446,8 +446,8 @@ describe('SystemParameterTest', function () { ...@@ -446,8 +446,8 @@ describe('SystemParameterTest', function () {
console.info(' system_parameter_test_0440 promise get hw_sc.build.os.version error: ' + err.code); console.info(' system_parameter_test_0440 promise get hw_sc.build.os.version error: ' + err.code);
}); });
done(); done();
} catch (e) { } catch (err) {
console.info('system_parameter_test_0440 promise setSync hw_sc.build.os.version: ' + e); console.info('system_parameter_test_0440 promise setSync hw_sc.build.os.version: ' + err);
} }
setTimeout(function(){ setTimeout(function(){
expect(ret).assertTrue(); expect(ret).assertTrue();
...@@ -472,8 +472,8 @@ describe('SystemParameterTest', function () { ...@@ -472,8 +472,8 @@ describe('SystemParameterTest', function () {
console.info(' system_parameter_test_0450 promise get a.b.b.c error: ' + err.code); console.info(' system_parameter_test_0450 promise get a.b.b.c error: ' + err.code);
done(); done();
}); });
} catch (e) { } catch (err) {
console.info('system_parameter_test_0450 promise setSync a.b.b.c error: ' + e); console.info('system_parameter_test_0450 promise setSync a.b.b.c error: ' + err);
} }
setTimeout(function(){ setTimeout(function(){
expect(ret).assertTrue(); expect(ret).assertTrue();
...@@ -490,7 +490,7 @@ describe('SystemParameterTest', function () { ...@@ -490,7 +490,7 @@ describe('SystemParameterTest', function () {
console.info('system_parameter_test_0500 start'); console.info('system_parameter_test_0500 start');
let ret = false; let ret = false;
try { try {
systemparameter.get('hw_sc.build.os.version', function (err, data) { systemparameter.get('hw_sc.build.os.version', async function (err, data) {
if (err == undefined) { if (err == undefined) {
console.log('system_parameter_test_0500 get test.parameter.key value success:' + data); console.log('system_parameter_test_0500 get test.parameter.key value success:' + data);
ret = ture; ret = ture;
...@@ -500,10 +500,12 @@ describe('SystemParameterTest', function () { ...@@ -500,10 +500,12 @@ describe('SystemParameterTest', function () {
} }
}); });
done(); done();
} catch (e) { } catch (err) {
console.log('system_parameter_test_0500 get unexpected error: ' + e); console.log('system_parameter_test_0500 get unexpected error: ' + err);
} }
setTimeout(function(){
expect(ret).assertTrue(); expect(ret).assertTrue();
}, '1000');
console.info('system_parameter_test_0500 : end'); console.info('system_parameter_test_0500 : end');
}) })
...@@ -531,8 +533,8 @@ describe('SystemParameterTest', function () { ...@@ -531,8 +533,8 @@ describe('SystemParameterTest', function () {
console.info('system_parameter_test_0510 get aaaaa failed :' + err.code); console.info('system_parameter_test_0510 get aaaaa failed :' + err.code);
} }
}) })
} catch (e) { } catch (err) {
console.info('system_parameter_test_0510 promise get input error: ' + e); console.info('system_parameter_test_0510 promise get input error: ' + err);
} }
setTimeout(function(){ setTimeout(function(){
expect(ret).assertTrue(); expect(ret).assertTrue();
...@@ -558,8 +560,8 @@ describe('SystemParameterTest', function () { ...@@ -558,8 +560,8 @@ describe('SystemParameterTest', function () {
console.info('system_parameter_test_0520 get systemparameter sucess: ' + err.code); console.info('system_parameter_test_0520 get systemparameter sucess: ' + err.code);
} }
}) })
} catch (e) { } catch (err) {
console.info('system_parameter_test_0520 promise get input error: ' + e); console.info('system_parameter_test_0520 promise get input error: ' + err);
} }
setTimeout(function(){ setTimeout(function(){
expect(ret).assertTrue(); expect(ret).assertTrue();
...@@ -585,8 +587,8 @@ describe('SystemParameterTest', function () { ...@@ -585,8 +587,8 @@ describe('SystemParameterTest', function () {
console.info('system_parameter_test_0530 get systemparameter sucess: ' + err.code); console.info('system_parameter_test_0530 get systemparameter sucess: ' + err.code);
} }
}) })
} catch (e) { } catch (err) {
console.info('system_parameter_test_0530 promise get input error: ' + e); console.info('system_parameter_test_0530 promise get input error: ' + err);
} }
setTimeout(function(){ setTimeout(function(){
expect(ret).assertTrue(); expect(ret).assertTrue();
...@@ -603,7 +605,7 @@ describe('SystemParameterTest', function () { ...@@ -603,7 +605,7 @@ describe('SystemParameterTest', function () {
console.info('system_parameter_test_0600 start'); console.info('system_parameter_test_0600 start');
let ret = false; let ret = false;
try { try {
systemparameter.get('hw_sc.build.os.version', '1.1.1.1', (err, data) => { systemparameter.get('hw_sc.build.os.version', '1.1.1.1', async (err, data) => {
if (err == undefined && data === '1.1.1.1') { if (err == undefined && data === '1.1.1.1') {
ret = true; ret = true;
console.info('system_parameter_test_0600 get systemparameter hw_sc.build.os.version sucess: ' console.info('system_parameter_test_0600 get systemparameter hw_sc.build.os.version sucess: '
...@@ -614,11 +616,13 @@ describe('SystemParameterTest', function () { ...@@ -614,11 +616,13 @@ describe('SystemParameterTest', function () {
+ err.code); + err.code);
} }
}) })
} catch (e) { } catch (err) {
console.info('system_parameter_test_0600 get systemparameter hw_sc.build.os.version abnormal: ', e); console.info('system_parameter_test_0600 get systemparameter hw_sc.build.os.version abnormal: ', err);
} }
setTimeout(function(){
expect(ret).assertTrue(); expect(ret).assertTrue();
console.info('system_parameter_test_0600 : end'); }, '1000');
console.info('system_parameter_test_0610 : end');
}) })
/** /**
...@@ -639,9 +643,9 @@ describe('SystemParameterTest', function () { ...@@ -639,9 +643,9 @@ describe('SystemParameterTest', function () {
+ err.code); + err.code);
} }
}) })
} catch (e) { } catch (err) {
ret = true; ret = true;
console.info('system_parameter_test_0610 get systemparameter hw_sc.build.os.version abnormal: ', e); console.info('system_parameter_test_0610 get systemparameter hw_sc.build.os.version abnormal: ', err);
done(); done();
} }
setTimeout(function(){ setTimeout(function(){
...@@ -670,8 +674,8 @@ describe('SystemParameterTest', function () { ...@@ -670,8 +674,8 @@ describe('SystemParameterTest', function () {
+ err.code); + err.code);
} }
}) })
} catch (e) { } catch (err) {
console.info('system_parameter_test_0620 get systemparameter hw_sc.build.os.version abnormal: ', e); console.info('system_parameter_test_0620 get systemparameter hw_sc.build.os.version abnormal: ', err);
} }
setTimeout(function(){ setTimeout(function(){
expect(ret).assertTrue(); expect(ret).assertTrue();
...@@ -702,8 +706,8 @@ describe('SystemParameterTest', function () { ...@@ -702,8 +706,8 @@ describe('SystemParameterTest', function () {
done(); done();
} }
}) })
} catch (e) { } catch (err) {
console.info('system_parameter_test_0640 get systemparameter b.b.b.b.b abnormal: ', e); console.info('system_parameter_test_0640 get systemparameter b.b.b.b.b abnormal: ', err);
} }
setTimeout(function(){ setTimeout(function(){
expect(ret).assertTrue(); expect(ret).assertTrue();
...@@ -722,9 +726,9 @@ describe('SystemParameterTest', function () { ...@@ -722,9 +726,9 @@ describe('SystemParameterTest', function () {
try { try {
let parameterInfo = systemparameter.getSync('hw_sc.build.os.version', 496); let parameterInfo = systemparameter.getSync('hw_sc.build.os.version', 496);
console.info(JSON.stringify(parameterInfo)); console.info(JSON.stringify(parameterInfo));
} catch (e) { } catch (err) {
ret = true; ret = true;
console.info('system_parameter_test_0700 promise get input error: ' + e); console.info('system_parameter_test_0700 promise get input error: ' + err);
done(); done();
} }
expect(ret).assertTrue(); expect(ret).assertTrue();
...@@ -744,8 +748,8 @@ describe('SystemParameterTest', function () { ...@@ -744,8 +748,8 @@ describe('SystemParameterTest', function () {
ret = true; ret = true;
console.info('system_parameter_test_0710 promise get input sucess: ', parameterInfo); console.info('system_parameter_test_0710 promise get input sucess: ', parameterInfo);
done(); done();
} catch (e) { } catch (err) {
console.info('system_parameter_test_0710 promise get input error: ' + e); console.info('system_parameter_test_0710 promise get input error: ' + err);
} }
expect(ret).assertTrue(); expect(ret).assertTrue();
console.info('system_parameter_test_0710 : end'); console.info('system_parameter_test_0710 : end');
...@@ -764,8 +768,8 @@ describe('SystemParameterTest', function () { ...@@ -764,8 +768,8 @@ describe('SystemParameterTest', function () {
ret = true; ret = true;
console.info('system_parameter_test_0720 promise get input sucess: ', parameterInfo); console.info('system_parameter_test_0720 promise get input sucess: ', parameterInfo);
done(); done();
} catch (e) { } catch (err) {
console.info('system_parameter_test_0720 promise get input error: ' + e); console.info('system_parameter_test_0720 promise get input error: ' + err);
} }
expect(ret).assertTrue(); expect(ret).assertTrue();
console.info('system_parameter_test_0720: end'); console.info('system_parameter_test_0720: end');
...@@ -785,8 +789,8 @@ describe('SystemParameterTest', function () { ...@@ -785,8 +789,8 @@ describe('SystemParameterTest', function () {
ret = true; ret = true;
console.info('system_parameter_test_0730 promise get input sucess: ', parameterInfo); console.info('system_parameter_test_0730 promise get input sucess: ', parameterInfo);
done(); done();
} catch (e) { } catch (err) {
console.info('system_parameter_test_0730 promise get input error: ' + e); console.info('system_parameter_test_0730 promise get input error: ' + err);
} }
expect(ret).assertTrue(); expect(ret).assertTrue();
console.info('system_parameter_test_0730: end'); console.info('system_parameter_test_0730: end');
...@@ -806,8 +810,8 @@ describe('SystemParameterTest', function () { ...@@ -806,8 +810,8 @@ describe('SystemParameterTest', function () {
ret = true; ret = true;
console.info('system_parameter_test_0740 promise get input sucess: ', parameterInfo); console.info('system_parameter_test_0740 promise get input sucess: ', parameterInfo);
done(); done();
} catch (e) { } catch (err) {
console.info('system_parameter_test_0740 promise get input error: ' + e); console.info('system_parameter_test_0740 promise get input error: ' + err);
} }
expect(ret).assertTrue(); expect(ret).assertTrue();
console.info('system_parameter_test_0740 : end'); console.info('system_parameter_test_0740 : end');
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册