提交 79fff3a5 编写于 作者: F fengzewu

code check

Signed-off-by: Nfengzewu <fengzewu@huawei.com>
上级 81ebcbee
/* /*
* Copyright (C) 2021 Huawei Device Co., Ltd. * Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
import image from '@ohos.multimedia.image' import image from '@ohos.multimedia.image'
import fileio from '@ohos.fileio' import fileio from '@ohos.fileio'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index' import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
import {tc_184_buf2} from './modifyBuffer' import {modifyBuf} from './modifyBuffer'
import abilityAccessCtrl from '@ohos.abilityAccessCtrl' import abilityAccessCtrl from '@ohos.abilityAccessCtrl'
import bundle from '@ohos.bundle' import bundle from '@ohos.bundle'
...@@ -72,7 +72,7 @@ describe('Image', function () { ...@@ -72,7 +72,7 @@ describe('Image', function () {
async function modifyPromise(done, testNum, type, key, value, checkProps){ async function modifyPromise(done, testNum, type, key, value, checkProps){
let imageSourceApi; let imageSourceApi;
if (type == 'buffer') { if (type == 'buffer') {
const data = tc_184_buf2.buffer; const data = modifyBuf.buffer;
imageSourceApi = image.createImageSource(data); imageSourceApi = image.createImageSource(data);
} else { } else {
let fdExifJpg = fileio.openSync(pathExifJpg, 0o2 | 0o100, 0o777); let fdExifJpg = fileio.openSync(pathExifJpg, 0o2 | 0o100, 0o777);
...@@ -104,7 +104,7 @@ describe('Image', function () { ...@@ -104,7 +104,7 @@ describe('Image', function () {
async function modifyCb(done, testNum, type, key, value, checkProps){ async function modifyCb(done, testNum, type, key, value, checkProps){
let imageSourceApi; let imageSourceApi;
if (type == 'buffer') { if (type == 'buffer') {
const data = tc_184_buf2.buffer; const data = modifyBuf.buffer;
imageSourceApi = image.createImageSource(data); imageSourceApi = image.createImageSource(data);
} else { } else {
let fdExifJpg = fileio.openSync(pathExifJpg, 0o2 | 0o100, 0o777); let fdExifJpg = fileio.openSync(pathExifJpg, 0o2 | 0o100, 0o777);
...@@ -139,7 +139,7 @@ describe('Image', function () { ...@@ -139,7 +139,7 @@ describe('Image', function () {
async function modifyCb1(done, testNum, type, key, value, checkProps){ async function modifyCb1(done, testNum, type, key, value, checkProps){
let imageSourceApi; let imageSourceApi;
if (type == 'buffer') { if (type == 'buffer') {
const data = tc_184_buf2.buffer; const data = modifyBuf.buffer;
imageSourceApi = image.createImageSource(data); imageSourceApi = image.createImageSource(data);
} else { } else {
let fdExifJpg = fileio.openSync(pathExifJpg, 0o2 | 0o100, 0o777); let fdExifJpg = fileio.openSync(pathExifJpg, 0o2 | 0o100, 0o777);
...@@ -172,10 +172,10 @@ describe('Image', function () { ...@@ -172,10 +172,10 @@ describe('Image', function () {
} }
} }
async function modifyImageProperty_err_cb(done, testNum, type, key, value) { async function modifyErrCb(done, testNum, type, key, value) {
let imageSourceApi; let imageSourceApi;
if (type == 'buffer') { if (type == 'buffer') {
const data = tc_184_buf2.buffer; const data = modifyBuf.buffer;
imageSourceApi = image.createImageSource(data); imageSourceApi = image.createImageSource(data);
} else { } else {
let fdExifJpg = fileio.openSync(pathExifJpg, 0o2 | 0o100, 0o777); let fdExifJpg = fileio.openSync(pathExifJpg, 0o2 | 0o100, 0o777);
...@@ -195,10 +195,10 @@ describe('Image', function () { ...@@ -195,10 +195,10 @@ describe('Image', function () {
} }
} }
async function modifyImageProperty_err_cb1(done, testNum, type, key, value) { async function modifyErrCb1(done, testNum, type, key, value) {
let imageSourceApi; let imageSourceApi;
if (type == 'buffer') { if (type == 'buffer') {
const data = tc_184_buf2.buffer; const data = modifyBuf.buffer;
imageSourceApi = image.createImageSource(data); imageSourceApi = image.createImageSource(data);
}else { }else {
let fdExifJpg = fileio.openSync(pathExifJpg, 0o2 | 0o100, 0o777); let fdExifJpg = fileio.openSync(pathExifJpg, 0o2 | 0o100, 0o777);
...@@ -218,11 +218,11 @@ describe('Image', function () { ...@@ -218,11 +218,11 @@ describe('Image', function () {
} }
} }
async function modifyImageProperty_err_promise(done, testNum, type, key, value) { async function modifyImageErrPromise(done, testNum, type, key, value) {
let imageSourceApi; let imageSourceApi;
try { try {
if (type == 'buffer') { if (type == 'buffer') {
const data = tc_184_buf2.buffer; const data = modifyBuf.buffer;
imageSourceApi = image.createImageSource(data); imageSourceApi = image.createImageSource(data);
} else { } else {
let fdExifJpg = fileio.openSync(pathExifJpg, 0o2 | 0o100, 0o777); let fdExifJpg = fileio.openSync(pathExifJpg, 0o2 | 0o100, 0o777);
...@@ -771,7 +771,7 @@ describe('Image', function () { ...@@ -771,7 +771,7 @@ describe('Image', function () {
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it('modify_01_011', 0, async function (done) { it('modify_01_011', 0, async function (done) {
modifyImageProperty_err_promise(done, 'modify_01_011', 'fd', "Orientation", "abcdef") modifyImageErrPromise(done, 'modify_01_011', 'fd', "Orientation", "abcdef")
}) })
/** /**
...@@ -785,7 +785,7 @@ describe('Image', function () { ...@@ -785,7 +785,7 @@ describe('Image', function () {
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it('modify_01_012', 0, async function (done) { it('modify_01_012', 0, async function (done) {
modifyImageProperty_err_promise(done, 'modify_01_012', 'fd', "GPSLatitude", "abc,3") modifyImageErrPromise(done, 'modify_01_012', 'fd', "GPSLatitude", "abc,3")
}) })
/** /**
...@@ -799,7 +799,7 @@ describe('Image', function () { ...@@ -799,7 +799,7 @@ describe('Image', function () {
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it('modify_01_013', 0, async function (done) { it('modify_01_013', 0, async function (done) {
modifyImageProperty_err_promise(done, 'modify_01_013', 'fd', "GPSLongitude", "abc,2") modifyImageErrPromise(done, 'modify_01_013', 'fd', "GPSLongitude", "abc,2")
}) })
/** /**
...@@ -813,7 +813,7 @@ describe('Image', function () { ...@@ -813,7 +813,7 @@ describe('Image', function () {
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it('modify_01_014', 0, async function (done) { it('modify_01_014', 0, async function (done) {
modifyImageProperty_err_promise(done, 'modify_01_014', 'fd', "GPSLatitudeRef", "456") modifyImageErrPromise(done, 'modify_01_014', 'fd', "GPSLatitudeRef", "456")
}) })
/** /**
...@@ -827,7 +827,7 @@ describe('Image', function () { ...@@ -827,7 +827,7 @@ describe('Image', function () {
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it('modify_01_015', 0, async function (done) { it('modify_01_015', 0, async function (done) {
modifyImageProperty_err_promise(done, 'modify_01_015', 'fd', "GPSLongitudeRef", "1234") modifyImageErrPromise(done, 'modify_01_015', 'fd', "GPSLongitudeRef", "1234")
}) })
/** /**
...@@ -841,7 +841,7 @@ describe('Image', function () { ...@@ -841,7 +841,7 @@ describe('Image', function () {
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it('modify_01_016', 0, async function (done) { it('modify_01_016', 0, async function (done) {
modifyImageProperty_err_promise(done, "modify_01_016", "buffer", "Orientation", "abcdef") modifyImageErrPromise(done, "modify_01_016", "buffer", "Orientation", "abcdef")
}) })
/** /**
...@@ -855,7 +855,7 @@ describe('Image', function () { ...@@ -855,7 +855,7 @@ describe('Image', function () {
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it('modify_01_017', 0, async function (done) { it('modify_01_017', 0, async function (done) {
modifyImageProperty_err_promise(done, "modify_01_017", "buffer", "GPSLatitude", "abc,3") modifyImageErrPromise(done, "modify_01_017", "buffer", "GPSLatitude", "abc,3")
}) })
/** /**
...@@ -869,7 +869,7 @@ describe('Image', function () { ...@@ -869,7 +869,7 @@ describe('Image', function () {
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it('modify_01_018', 0, async function (done) { it('modify_01_018', 0, async function (done) {
modifyImageProperty_err_promise(done, "modify_01_018", "buffer", "GPSLongitude", "abc,2") modifyImageErrPromise(done, "modify_01_018", "buffer", "GPSLongitude", "abc,2")
}) })
/** /**
...@@ -883,7 +883,7 @@ describe('Image', function () { ...@@ -883,7 +883,7 @@ describe('Image', function () {
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it('modify_01_019', 0, async function (done) { it('modify_01_019', 0, async function (done) {
modifyImageProperty_err_promise(done, "modify_01_019", "buffer", "GPSLatitudeRef", "456") modifyImageErrPromise(done, "modify_01_019", "buffer", "GPSLatitudeRef", "456")
}) })
/** /**
...@@ -897,7 +897,7 @@ describe('Image', function () { ...@@ -897,7 +897,7 @@ describe('Image', function () {
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it('modify_01_020', 0, async function (done) { it('modify_01_020', 0, async function (done) {
modifyImageProperty_err_promise(done, "modify_01_020", "buffer", "GPSLongitudeRef", "1234") modifyImageErrPromise(done, "modify_01_020", "buffer", "GPSLongitudeRef", "1234")
}) })
/** /**
...@@ -911,7 +911,7 @@ describe('Image', function () { ...@@ -911,7 +911,7 @@ describe('Image', function () {
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it('modify_02_011', 0, async function (done) { it('modify_02_011', 0, async function (done) {
modifyImageProperty_err_cb(done, "modify_02_011", "fd", "Orientation", "abcdef") modifyErrCb(done, "modify_02_011", "fd", "Orientation", "abcdef")
}) })
/** /**
...@@ -925,7 +925,7 @@ describe('Image', function () { ...@@ -925,7 +925,7 @@ describe('Image', function () {
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it('modify_02_012', 0, async function (done) { it('modify_02_012', 0, async function (done) {
modifyImageProperty_err_cb(done, "modify_02_012", "fd", "GPSLatitude", "abc,3") modifyErrCb(done, "modify_02_012", "fd", "GPSLatitude", "abc,3")
}) })
/** /**
...@@ -939,7 +939,7 @@ describe('Image', function () { ...@@ -939,7 +939,7 @@ describe('Image', function () {
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it('modify_02_013', 0, async function (done) { it('modify_02_013', 0, async function (done) {
modifyImageProperty_err_cb(done, "modify_02_013", "fd", "GPSLongitude", "abc,2") modifyErrCb(done, "modify_02_013", "fd", "GPSLongitude", "abc,2")
}) })
/** /**
...@@ -953,7 +953,7 @@ describe('Image', function () { ...@@ -953,7 +953,7 @@ describe('Image', function () {
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it('modify_02_014', 0, async function (done) { it('modify_02_014', 0, async function (done) {
modifyImageProperty_err_cb(done, "modify_02_014", "fd", "GPSLongitudeRef", "1234") modifyErrCb(done, "modify_02_014", "fd", "GPSLongitudeRef", "1234")
}) })
/** /**
...@@ -967,7 +967,7 @@ describe('Image', function () { ...@@ -967,7 +967,7 @@ describe('Image', function () {
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it('modify_02_015', 0, async function (done) { it('modify_02_015', 0, async function (done) {
modifyImageProperty_err_cb(done, "modify_02_015", "fd", "GPSLatitudeRef", "456") modifyErrCb(done, "modify_02_015", "fd", "GPSLatitudeRef", "456")
}) })
/** /**
...@@ -981,7 +981,7 @@ describe('Image', function () { ...@@ -981,7 +981,7 @@ describe('Image', function () {
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it('modify_02_016', 0, async function (done) { it('modify_02_016', 0, async function (done) {
modifyImageProperty_err_cb(done, "modify_02_016", "buffer", "Orientation", "abcdef") modifyErrCb(done, "modify_02_016", "buffer", "Orientation", "abcdef")
}) })
/** /**
...@@ -995,7 +995,7 @@ describe('Image', function () { ...@@ -995,7 +995,7 @@ describe('Image', function () {
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it('modify_02_017', 0, async function (done) { it('modify_02_017', 0, async function (done) {
modifyImageProperty_err_cb(done, "modify_02_017", "buffer", "GPSLatitude", "abc,3") modifyErrCb(done, "modify_02_017", "buffer", "GPSLatitude", "abc,3")
}) })
/** /**
...@@ -1009,7 +1009,7 @@ describe('Image', function () { ...@@ -1009,7 +1009,7 @@ describe('Image', function () {
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it('modify_02_018', 0, async function (done) { it('modify_02_018', 0, async function (done) {
modifyImageProperty_err_cb(done, "modify_02_018", "buffer", "GPSLongitude", "abc,2") modifyErrCb(done, "modify_02_018", "buffer", "GPSLongitude", "abc,2")
}) })
/** /**
...@@ -1023,7 +1023,7 @@ describe('Image', function () { ...@@ -1023,7 +1023,7 @@ describe('Image', function () {
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it('modify_02_019', 0, async function (done) { it('modify_02_019', 0, async function (done) {
modifyImageProperty_err_cb(done, "modify_02_019", "buffer", "GPSLongitudeRef", "1234") modifyErrCb(done, "modify_02_019", "buffer", "GPSLongitudeRef", "1234")
}) })
/** /**
...@@ -1037,7 +1037,7 @@ describe('Image', function () { ...@@ -1037,7 +1037,7 @@ describe('Image', function () {
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it('modify_02_020', 0, async function (done) { it('modify_02_020', 0, async function (done) {
modifyImageProperty_err_cb(done, "modify_02_020", "buffer", "GPSLatitudeRef", "456") modifyErrCb(done, "modify_02_020", "buffer", "GPSLatitudeRef", "456")
}) })
/** /**
...@@ -1051,7 +1051,7 @@ describe('Image', function () { ...@@ -1051,7 +1051,7 @@ describe('Image', function () {
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it('modify_03_011', 0, async function (done) { it('modify_03_011', 0, async function (done) {
modifyImageProperty_err_cb1(done, "modify_03_011", "fd", "Orientation", "abcdef") modifyErrCb1(done, "modify_03_011", "fd", "Orientation", "abcdef")
}) })
/** /**
...@@ -1065,7 +1065,7 @@ describe('Image', function () { ...@@ -1065,7 +1065,7 @@ describe('Image', function () {
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it('modify_03_012', 0, async function (done) { it('modify_03_012', 0, async function (done) {
modifyImageProperty_err_cb1(done, "modify_03_012", "fd", "GPSLatitude", "abc,3") modifyErrCb1(done, "modify_03_012", "fd", "GPSLatitude", "abc,3")
}) })
/** /**
...@@ -1079,7 +1079,7 @@ describe('Image', function () { ...@@ -1079,7 +1079,7 @@ describe('Image', function () {
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it('modify_03_013', 0, async function (done) { it('modify_03_013', 0, async function (done) {
modifyImageProperty_err_cb1(done, "modify_03_013", "fd", "GPSLongitude", "abc,2") modifyErrCb1(done, "modify_03_013", "fd", "GPSLongitude", "abc,2")
}) })
/** /**
...@@ -1093,7 +1093,7 @@ describe('Image', function () { ...@@ -1093,7 +1093,7 @@ describe('Image', function () {
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it('modify_03_014', 0, async function (done) { it('modify_03_014', 0, async function (done) {
modifyImageProperty_err_cb1(done, "modify_03_014", "fd", "GPSLatitudeRef", "1234") modifyErrCb1(done, "modify_03_014", "fd", "GPSLatitudeRef", "1234")
}) })
/** /**
...@@ -1107,7 +1107,7 @@ describe('Image', function () { ...@@ -1107,7 +1107,7 @@ describe('Image', function () {
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it('modify_03_015', 0, async function (done) { it('modify_03_015', 0, async function (done) {
modifyImageProperty_err_cb1(done, "modify_03_015", "fd", "GPSLongitudeRef", "567") modifyErrCb1(done, "modify_03_015", "fd", "GPSLongitudeRef", "567")
}) })
/** /**
...@@ -1121,7 +1121,7 @@ describe('Image', function () { ...@@ -1121,7 +1121,7 @@ describe('Image', function () {
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it('modify_03_016', 0, async function (done) { it('modify_03_016', 0, async function (done) {
modifyImageProperty_err_cb1(done, "modify_03_016", "buffer", "Orientation", "abcef") modifyErrCb1(done, "modify_03_016", "buffer", "Orientation", "abcef")
}) })
/** /**
...@@ -1135,7 +1135,7 @@ describe('Image', function () { ...@@ -1135,7 +1135,7 @@ describe('Image', function () {
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it('modify_03_017', 0, async function (done) { it('modify_03_017', 0, async function (done) {
modifyImageProperty_err_cb1(done, "modify_03_017", "buffer", "GPSLatitude", "abc,3") modifyErrCb1(done, "modify_03_017", "buffer", "GPSLatitude", "abc,3")
}) })
/** /**
...@@ -1149,7 +1149,7 @@ describe('Image', function () { ...@@ -1149,7 +1149,7 @@ describe('Image', function () {
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it('modify_03_018', 0, async function (done) { it('modify_03_018', 0, async function (done) {
modifyImageProperty_err_cb1(done, "modify_03_018", "buffer", "GPSLongitude", "abc,2") modifyErrCb1(done, "modify_03_018", "buffer", "GPSLongitude", "abc,2")
}) })
/** /**
...@@ -1163,7 +1163,7 @@ describe('Image', function () { ...@@ -1163,7 +1163,7 @@ describe('Image', function () {
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it('modify_03_019', 0, async function (done) { it('modify_03_019', 0, async function (done) {
modifyImageProperty_err_cb1(done, "modify_03_019", "buffer", "GPSLatitudeRef", "456") modifyErrCb1(done, "modify_03_019", "buffer", "GPSLatitudeRef", "456")
}) })
/** /**
...@@ -1177,6 +1177,6 @@ describe('Image', function () { ...@@ -1177,6 +1177,6 @@ describe('Image', function () {
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it('modify_03_020', 0, async function (done) { it('modify_03_020', 0, async function (done) {
modifyImageProperty_err_cb1(done, "modify_03_020", "buffer", "GPSLongitudeRef", "1234") modifyErrCb1(done, "modify_03_020", "buffer", "GPSLongitudeRef", "1234")
}) })
}) })
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册