From 9fa12b84ea1bf4842f1e91cf0c9727d4ab789397 Mon Sep 17 00:00:00 2001 From: zhoulisheng1 Date: Mon, 29 May 2023 10:09:03 +0800 Subject: [PATCH 1/2] =?UTF-8?q?1.=E6=B5=8B=E8=AF=95=E6=96=87=E4=BB=B6IO?= =?UTF-8?q?=E7=95=8C=E9=9D=A2,=E8=AF=AF=E6=93=8D=E4=BD=9C=E5=8F=AF?= =?UTF-8?q?=E8=83=BD=E5=87=BA=E7=8E=B0crash,=E9=9C=80=E8=A6=81=E6=8C=89?= =?UTF-8?q?=E7=85=A7=E8=A6=81=E6=B1=82=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhoulisheng1 --- entry/src/main/ets/pages/basicTestFileIOPage.ets | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/entry/src/main/ets/pages/basicTestFileIOPage.ets b/entry/src/main/ets/pages/basicTestFileIOPage.ets index dd5e3b1..3f19ef8 100644 --- a/entry/src/main/ets/pages/basicTestFileIOPage.ets +++ b/entry/src/main/ets/pages/basicTestFileIOPage.ets @@ -22,7 +22,8 @@ struct basicTestFileIOPage { @State filePath: string = '查看featureAbility路径'; appFilePath = ''; appCachePath = ''; - @State imageFile: string = '' + @State imageHint: string = '' + @State imageFile: string = '文字提醒' @State imageRes: Resource = $r('app.media.pngSample') @State imagePixelMap: PixelMap = undefined @State normalPixelMap: boolean = false; @@ -56,9 +57,14 @@ struct basicTestFileIOPage { this.appFilePath = data; }) + Text(this.imageHint) Button('files目录创建Folder1和Folder2 验证statSync mkdirSync') .margin({ top: 10 }) .onClick(() => { + if(this.appFilePath == '' || this.appFilePath == null){ + this.appFilePath = 'appFilePath未取到值,请按顺序从上往下,从左往右依次测试' + return + } console.log('files目录创建Folder1和Folder2 验证statSync mkdirSync') FileUtils.getInstance() .createFolder(this.appFilePath + '/Folder1'); @@ -69,6 +75,10 @@ struct basicTestFileIOPage { .margin({ top: 10 }) .onClick(() => { console.log('将media资源存入Folder1 验证writeSync mkdirSync createStreamSync') + if(this.appFilePath == '' || this.appFilePath == null){ + this.appFilePath = 'appFilePath未取到值,请按顺序从上往下,从左往右依次测试' + return + } globalThis.ImageKnife.getImageKnifeContext().resourceManager .getMedia($r('app.media.gifSample').id) .then(data => { @@ -87,6 +97,10 @@ struct basicTestFileIOPage { .margin({ top: 10 }) .onClick(() => { console.log('copy:Folder1至Folder2, 验证copyFileSync') + if(this.appFilePath == '' || this.appFilePath == null){ + this.appFilePath = 'appFilePath未取到值,请按顺序从上往下,从左往右依次测试' + return + } let filePath1 = this.appFilePath + '/Folder1/jpgSample.gif'; let filePath2 = this.appFilePath + '/Folder2/jpgSample.gif'; FileUtils.getInstance().createFolder(this.appFilePath + '/Folder1') From eb94de8376a390c9c39fc09fe7cc5a10c40795b2 Mon Sep 17 00:00:00 2001 From: zhoulisheng1 Date: Tue, 30 May 2023 17:47:00 +0800 Subject: [PATCH 2/2] =?UTF-8?q?1.XTS=E7=94=A8=E4=BE=8B=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhoulisheng1 --- entry/src/ohosTest/ets/test/imageknife.ets | 1 - entry/src/ohosTest/ets/test/requestoption.ets | 14 +++++++------- entry/src/ohosTest/ets/test/transfrom.ets | 6 +----- 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/entry/src/ohosTest/ets/test/imageknife.ets b/entry/src/ohosTest/ets/test/imageknife.ets index f931033..f051d4b 100644 --- a/entry/src/ohosTest/ets/test/imageknife.ets +++ b/entry/src/ohosTest/ets/test/imageknife.ets @@ -40,7 +40,6 @@ export default function ImageKnifeTest() { it('TestGlobalImageKnife',0, function () { - expect(globalThis.ImageKnife).assertEqual(undefined) globalThis.ImageKnife = ImageKnife.with(getContext()) expect(globalThis.ImageKnife).not().assertUndefined() }) diff --git a/entry/src/ohosTest/ets/test/requestoption.ets b/entry/src/ohosTest/ets/test/requestoption.ets index 9162cec..26bff91 100644 --- a/entry/src/ohosTest/ets/test/requestoption.ets +++ b/entry/src/ohosTest/ets/test/requestoption.ets @@ -58,17 +58,17 @@ export default function RequestOptionTest() { let option = new RequestOption(); expect(option.strategy.getName()).assertEqual('AUTOMATIC') - expect(option.dontAnimateFlag).assertFail() + expect(option.dontAnimateFlag).assertFalse() - expect(option.onlyRetrieveFromCache).assertFail() + expect(option.onlyRetrieveFromCache).assertFalse() expect(option.isCacheable).assertTrue() - expect(option.gpuEnabled).assertFail() - expect(option.loadMainReady).assertFail() - expect(option.loadErrorReady).assertFail() - expect(option.loadRetryReady).assertFail() - expect(option.loadThumbnailReady).assertFail() + expect(option.gpuEnabled).assertFalse() + expect(option.loadMainReady).assertFalse() + expect(option.loadErrorReady).assertFalse() + expect(option.loadRetryReady).assertFalse() + expect(option.loadThumbnailReady).assertFalse() }) }) diff --git a/entry/src/ohosTest/ets/test/transfrom.ets b/entry/src/ohosTest/ets/test/transfrom.ets index 5705c25..c467ee4 100644 --- a/entry/src/ohosTest/ets/test/transfrom.ets +++ b/entry/src/ohosTest/ets/test/transfrom.ets @@ -120,11 +120,7 @@ export default function Transform() { + ";mBottom_left:" + 5 + ";mBottom_right:" + 5) }) - it('TestRoundedCornersTransformation', 12, function () { - let speia = new SepiaFilterTransformation(); - expect(speia.getName()).assertContain("SepiaFilterTransformation") - }) - it('TestSepiaFilterTransformation', 13, function () { + it('TestSepiaFilterTransformation', 12, function () { let speia = new SepiaFilterTransformation(); expect(speia.getName()).assertContain("SepiaFilterTransformation") })