提交 8270766c 编写于 作者: W wangtiantian

IssueNo:#I726M5

Description:fix zlib bug
Sig:SIG_ApplicaitonFramework
Feature or Bugfix:Bugfix
Binary Source:No
Signed-off-by: Nwangtiantian <wangtiantian19@huawei.com>
上级 5cbd7cdc
...@@ -1462,24 +1462,22 @@ export default function ActsZlibTest() { ...@@ -1462,24 +1462,22 @@ export default function ActsZlibTest() {
strategy: null strategy: null
}).then((data) => { }).then((data) => {
console.log("compressFileStrategyNull invalid src file success!"); console.log("compressFileStrategyNull invalid src file success!");
expect().assertFail();
}).catch((err) => { }).catch((err) => {
console.log("compressFileStrategyNull zipFile fail: " + JSON.stringify(err)); console.log("compressFileStrategyNull zipFile fail: " + JSON.stringify(err));
expect().assertFail(); expect().assertFail();
}) })
} catch (err) { } catch (err) {
expect(err.code).assertEqual(PARAM_ERROR); expect().assertFail();
} }
try { try {
zlib.compressFile(path1, zipDest1, { zlib.compressFile(path1, zipDest1, {
strategy: null strategy: null
}, (err, data) => { }, (err, data) => {
console.log("compressFile result"); console.log("compressFile result");
expect().assertFail();
done(); done();
}) })
} catch (err) { } catch (err) {
expect(err.code).assertEqual(PARAM_ERROR); expect().assertFail();
done(); done();
} }
console.log("==================compressFileOutFileNull end=================="); console.log("==================compressFileOutFileNull end==================");
...@@ -1926,25 +1924,24 @@ export default function ActsZlibTest() { ...@@ -1926,25 +1924,24 @@ export default function ActsZlibTest() {
strategy: null strategy: null
}).then(data => { }).then(data => {
console.log("decompressFile data: " + data); console.log("decompressFile data: " + data);
expect().assertFail();
}).catch(err => { }).catch(err => {
console.log("decompress fail: " + JSON.stringify(err)); console.log("decompress fail: " + JSON.stringify(err));
expect().assertFail(); expect().assertFail();
}) })
} catch (err) { } catch (err) {
console.log("decompress fail: " + JSON.stringify(err)); console.log("decompress fail: " + JSON.stringify(err));
expect(err.code).assertEqual(PARAM_ERROR); expect().assertFail();
} }
try { try {
zlib.decompressFile(zipDest1, unzipdir, { zlib.decompressFile(zipDest1, unzipdir, {
strategy: null strategy: null
}, (err, data) => { }, (err, data) => {
expect().assertFail(); console.log("decompressFile data: " + data);
done(); done();
}) })
} catch (err) { } catch (err) {
console.log("decompress fail: " + JSON.stringify(err)); console.log("decompress fail: " + JSON.stringify(err));
expect(err.code).assertEqual(PARAM_ERROR); expect().assertFail();
done(); done();
} }
console.log("==================decompressFileStrategyNull end=================="); console.log("==================decompressFileStrategyNull end==================");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册