提交 ef3b31b5 编写于 作者: F fengzewu

change to if(err)

Signed-off-by: Nfengzewu <fengzewu@huawei.com>
上级 658c18b2
...@@ -81,7 +81,7 @@ describe('ImageCreator', function () { ...@@ -81,7 +81,7 @@ describe('ImageCreator', function () {
return return
} }
img.getComponent(JPEG, async (err, component) => { img.getComponent(JPEG, async (err, component) => {
if (err != 0) { if (err) {
expect(false).assertTrue(); expect(false).assertTrue();
console.log(`${testNum} getComponent err:` + err); console.log(`${testNum} getComponent err:` + err);
done(); done();
...@@ -129,7 +129,7 @@ describe('ImageCreator', function () { ...@@ -129,7 +129,7 @@ describe('ImageCreator', function () {
done() done()
} else { } else {
img.getComponent(JPEG, (err, component) => { img.getComponent(JPEG, (err, component) => {
if (err != 0) { if (err) {
expect(false).assertTrue(); expect(false).assertTrue();
console.log(`${testNum} getComponent error:` + err); console.log(`${testNum} getComponent error:` + err);
done(); done();
...@@ -364,7 +364,7 @@ describe('ImageCreator', function () { ...@@ -364,7 +364,7 @@ describe('ImageCreator', function () {
var creator = image.createImageCreator(WIDTH, HEIGHT, FORMAT, CAPACITY); var creator = image.createImageCreator(WIDTH, HEIGHT, FORMAT, CAPACITY);
if (creator != undefined) { if (creator != undefined) {
creator.release((err) => { creator.release((err) => {
if (err != 0) { if (err) {
console.info('Creator_003 release call back' + err); console.info('Creator_003 release call back' + err);
expect(false).assertTrue(); expect(false).assertTrue();
done(); done();
...@@ -424,7 +424,7 @@ describe('ImageCreator', function () { ...@@ -424,7 +424,7 @@ describe('ImageCreator', function () {
var creator = image.createImageCreator(WIDTH, HEIGHT, FORMAT, CAPACITY); var creator = image.createImageCreator(WIDTH, HEIGHT, FORMAT, CAPACITY);
if (creator != undefined) { if (creator != undefined) {
creator.dequeueImage((err, img) => { creator.dequeueImage((err, img) => {
if (err != 0) { if (err) {
console.info('Creator_005 err:' + err); console.info('Creator_005 err:' + err);
expect(false).assertTrue(); expect(false).assertTrue();
done(); done();
...@@ -462,7 +462,7 @@ describe('ImageCreator', function () { ...@@ -462,7 +462,7 @@ describe('ImageCreator', function () {
return; return;
} }
img.getComponent(JPEG, (err, component) => { img.getComponent(JPEG, (err, component) => {
if (err != 0) { if (err) {
expect(false).assertTrue(); expect(false).assertTrue();
done(); done();
return; return;
...@@ -565,7 +565,7 @@ describe('ImageCreator', function () { ...@@ -565,7 +565,7 @@ describe('ImageCreator', function () {
var creator = image.createImageCreator(WIDTH, HEIGHT, FORMAT, CAPACITY); var creator = image.createImageCreator(WIDTH, HEIGHT, FORMAT, CAPACITY);
if (creator != undefined) { if (creator != undefined) {
creator.dequeueImage((err, img) => { creator.dequeueImage((err, img) => {
if (err != 0 || img == undefined) { if (err || img == undefined) {
console.log('Creator_007 dequeueImage error:' + err); console.log('Creator_007 dequeueImage error:' + err);
expect(false).assertTrue(); expect(false).assertTrue();
done(); done();
...@@ -573,7 +573,7 @@ describe('ImageCreator', function () { ...@@ -573,7 +573,7 @@ describe('ImageCreator', function () {
} }
img.getComponent(JPEG, (err, component) => { img.getComponent(JPEG, (err, component) => {
if (err != 0) { if (err) {
expect(false).assertTrue(); expect(false).assertTrue();
console.log('Creator_007 getComponent error:' + err); console.log('Creator_007 getComponent error:' + err);
done(); done();
...@@ -591,7 +591,7 @@ describe('ImageCreator', function () { ...@@ -591,7 +591,7 @@ describe('ImageCreator', function () {
} }
console.info("this is img " + img); console.info("this is img " + img);
creator.queueImage(img, (err) => { creator.queueImage(img, (err) => {
if (err != 0) { if (err) {
console.info('Creator_007 queueImage err: ' + err); console.info('Creator_007 queueImage err: ' + err);
expect(false).assertTrue(); expect(false).assertTrue();
done(); done();
...@@ -688,7 +688,7 @@ describe('ImageCreator', function () { ...@@ -688,7 +688,7 @@ describe('ImageCreator', function () {
return; return;
} }
creator.on('imageRelease', (err) => { creator.on('imageRelease', (err) => {
if (err != 0) { if (err) {
console.info('Creator_008 on release faild' + err); console.info('Creator_008 on release faild' + err);
expect(false).assertTrue(); expect(false).assertTrue();
done(); done();
...@@ -699,14 +699,14 @@ describe('ImageCreator', function () { ...@@ -699,14 +699,14 @@ describe('ImageCreator', function () {
done(); done();
}) })
creator.dequeueImage((err, img) => { creator.dequeueImage((err, img) => {
if (err != 0 || img == undefined) { if (err || img == undefined) {
console.info('Creator_008 dequeueImage fail: ' + err); console.info('Creator_008 dequeueImage fail: ' + err);
expect(false).assertTrue(); expect(false).assertTrue();
done(); done();
return; return;
} }
img.getComponent(JPEG, (err, component) => { img.getComponent(JPEG, (err, component) => {
if (err != 0 || component == undefined) { if (err || component == undefined) {
console.info('Creator_008 getComponent err:' + err); console.info('Creator_008 getComponent err:' + err);
expect(false).assertTrue(); expect(false).assertTrue();
done(); done();
...@@ -722,7 +722,7 @@ describe('ImageCreator', function () { ...@@ -722,7 +722,7 @@ describe('ImageCreator', function () {
bufferArr[i + 3] = 255; //A bufferArr[i + 3] = 255; //A
} }
creator.queueImage(img, (err) => { creator.queueImage(img, (err) => {
if (err != 0) { if (err) {
console.info('Creator_008 queueImage failerr: ' + err); console.info('Creator_008 queueImage failerr: ' + err);
expect(false).assertTrue(); expect(false).assertTrue();
done(); done();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册