提交 3d905dcb 编写于 作者: Y y00314596 提交者: 杨清

fixed 0564a07f from https://gitee.com/yangqing3/xts_acts/pulls/6351

add by yangqing3@huawei.com
Signed-off-by: Ny00314596 <yangqing3@huawei.com>
上级 aaa975d1
...@@ -1113,17 +1113,54 @@ describe('resMgrTest', function () { ...@@ -1113,17 +1113,54 @@ describe('resMgrTest', function () {
/* * /* *
* @tc.number SUB_GLOBAL_RESMGR_JS_2300 * @tc.number SUB_GLOBAL_RESMGR_JS_2300
* @tc.name test closeRawFileDescriptor method in promise mode * @tc.name test closeRawFd method in promise mode throw 9001005 error code
* @tc.desc get the closeRawFileDescriptor in promise mode * @tc.desc get the closeRawFd in promise mode
*/ */
it('closeRawFd_test_002', 0, async function (done) { it('closeRawFd_test_005', 0, async function (done) {
resmgr.getResourceManager((error, mgr) => { resmgr.getResourceManager((error, mgr) => {
mgr.closeRawFd('rawfiletest.xml').then(value => { try {
expect(value !== null).assertTrue(); // param not exist throw 9001005 error code
console.log('closeRawFd_test_002--' + value); mgr.closeRawFd('notexist.xml').then(value => {
}) console.log('closeRawFd_test_005 ' + value);
done();
}).catch(error => {
console.log('closeRawFd_test_005 error.code' + error.code);
console.log('closeRawFd_test_005 error.message' + error.message);
expect(error.code == 9001005).assertTrue();
done();
})
} catch (err) {
console.log('closeRawFd_test_005 err.code' + err.code);
console.log('closeRawFd_test_005 err.message' + err.message);
done();
}
})
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_JS_2300
* @tc.name test closeRawFd method in promise mode throw 401 error code
* @tc.desc get the closeRawFd in promise mode
*/
it('closeRawFd_test_006', 0, async function (done) {
resmgr.getResourceManager((error, mgr) => {
try {
// param type not correct,throw 401 error code
mgr.closeRawFd(0x01000000).then(value => {
console.log('closeRawFd_test_006 ' + value);
done();
}).catch(error => {
console.log('closeRawFd_test_006 error.code' + error.code);
console.log('closeRawFd_test_006 error.message' + error.message);
expect(error.code == 401).assertTrue();
done();
})
} catch (err) {
console.log('closeRawFd_test_006 err.code' + err.code);
console.log('closeRawFd_test_006 err.message' + err.message);
done();
}
}) })
done();
}) })
/* * /* *
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册