提交 45d2c828 编写于 作者: X xdmal

Modify xts of process

Signed-off-by: Nxdmal <maxiaodong16@huawei.com>
上级 ccf63ad2
...@@ -1323,9 +1323,14 @@ describe('ChildProcessTest', function () { ...@@ -1323,9 +1323,14 @@ describe('ChildProcessTest', function () {
function sleep(d){ function sleep(d){
while(process.uptime() - result1 <= d); while(process.uptime() - result1 <= d);
} }
sleep(5); sleep(6);
let result2 = process.uptime() - 6 let result2 = process.uptime()
expect(result1).assertEqual(result2) var flag = false
if ((result2 - result1) >= 6)
{
flag = true
}
expect(flag).assertEqual(true)
}) })
/** /**
...@@ -1335,13 +1340,18 @@ describe('ChildProcessTest', function () { ...@@ -1335,13 +1340,18 @@ describe('ChildProcessTest', function () {
* @tc.author: wangben * @tc.author: wangben
*/ */
it('testUptime002', 0, function () { it('testUptime002', 0, function () {
var result1 = process.uptime() let result1 = process.uptime()
function sleep(d){ function sleep(d){
while(process.uptime() - result1 <= d); while(process.uptime() - result1 <= d);
} }
sleep(8); sleep(8);
let result2 = process.uptime() - 9 let result2 = process.uptime()
expect(result1).assertEqual(result2) var flag = false
if ((result2 - result1) >= 8)
{
flag = true
}
expect(flag).assertEqual(true)
}) })
/** /**
...@@ -1356,8 +1366,13 @@ describe('ChildProcessTest', function () { ...@@ -1356,8 +1366,13 @@ describe('ChildProcessTest', function () {
while(process.uptime() - result1 <= d); while(process.uptime() - result1 <= d);
} }
sleep(10); sleep(10);
let result2 = process.uptime() - 11 let result2 = process.uptime()
expect(result1).assertEqual(result2) var flag = false
if ((result2 - result1) >= 10)
{
flag = true
}
expect(flag).assertEqual(true)
}) })
/** /**
...@@ -1372,8 +1387,13 @@ describe('ChildProcessTest', function () { ...@@ -1372,8 +1387,13 @@ describe('ChildProcessTest', function () {
while(process.uptime() - result1 <= d); while(process.uptime() - result1 <= d);
} }
sleep(7); sleep(7);
let result2 = process.uptime() - 8 let result2 = process.uptime()
expect(result1).assertEqual(result2) var flag = false
if ((result2 - result1) >= 7)
{
flag = true
}
expect(flag).assertEqual(true)
}) })
/** /**
...@@ -1383,13 +1403,18 @@ describe('ChildProcessTest', function () { ...@@ -1383,13 +1403,18 @@ describe('ChildProcessTest', function () {
* @tc.author: wangben * @tc.author: wangben
*/ */
it('testUptime005', 0, function () { it('testUptime005', 0, function () {
var result1 = process.uptime() let result1 = process.uptime()
function sleep(d){ function sleep(d){
while(process.uptime() - result1 <= d); while(process.uptime() - result1 <= d);
} }
sleep(11); sleep(11);
var result2 = process.uptime() - 12 let result2 = process.uptime()
expect(result1).assertEqual(result2) var flag = false
if ((result2 - result1) >= 11)
{
flag = true
}
expect(flag).assertEqual(true)
}) })
/** /**
...@@ -2399,7 +2424,7 @@ describe('ChildProcessTest', function () { ...@@ -2399,7 +2424,7 @@ describe('ChildProcessTest', function () {
if(pri == null) if(pri == null)
{ {
var flag = new Boolean(true) var flag = new Boolean(true)
expect(flag).assertEqual(true) expect(Boolean(flag)).assertEqual(true)
} }
} }
}) })
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册