From 4e2a36879fc388132da98b586e3a2880ee88c149 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B1=91=E5=B1=91=E5=B1=91?= Date: Thu, 21 Aug 2025 14:16:19 +0800 Subject: [PATCH] =?UTF-8?q?UT=E4=BF=AE=E5=A4=8D=20gn=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 屑屑屑 --- frameworks/innerkitsimpl/test/BUILD.gn | 3 ++- .../test/unittest/pixel_map_test/pixel_map_gl_test.cpp | 4 ++-- .../test/unittest/pixel_map_test/pixel_map_test.cpp | 8 ++++---- .../test/unittest/plugin_texture_encode_test.cpp | 6 +++--- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/frameworks/innerkitsimpl/test/BUILD.gn b/frameworks/innerkitsimpl/test/BUILD.gn index 341e014c7..352c58db8 100644 --- a/frameworks/innerkitsimpl/test/BUILD.gn +++ b/frameworks/innerkitsimpl/test/BUILD.gn @@ -16,9 +16,10 @@ import("//build/config/components/memory_utils/purgeable_mem_config.gni") import("//foundation/multimedia/image_framework/ide/image_decode_config.gni") module_output_path = "image_framework/image_framework" +pixelmap_module_output_path = "graphic_2d/pixelmap" ohos_unittest("pixelmaptest") { - module_out_path = module_output_path + module_out_path = pixelmap_module_output_path cflags = [ "-DIMAGE_DEBUG_FLAG", diff --git a/frameworks/innerkitsimpl/test/unittest/pixel_map_test/pixel_map_gl_test.cpp b/frameworks/innerkitsimpl/test/unittest/pixel_map_test/pixel_map_gl_test.cpp index c1557fdfc..f017e2e16 100644 --- a/frameworks/innerkitsimpl/test/unittest/pixel_map_test/pixel_map_gl_test.cpp +++ b/frameworks/innerkitsimpl/test/unittest/pixel_map_test/pixel_map_gl_test.cpp @@ -320,8 +320,8 @@ HWTEST_F(PixelMapTest, PixelMapDmaTestRotate001, TestSize.Level3) // ARGB_8888 to others options.srcPixelFormat = PixelFormat::ARGB_8888; for (iter = SupportDmaMemPixelFormat.begin(); iter != SupportDmaMemPixelFormat.end() ; ++iter) { - uint32_t colorLength = NUM_512 * NUM_647 * NUM_4; // w:2 * h:3 * pixelByte:4 - uint8_t buffer[NUM_512 * NUM_647 * NUM_4] = { 0 }; // w:2 * h:3 * pixelByte:4 + uint32_t colorLength = NUM_512 * NUM_512 * NUM_4; // w:2 * h:3 * pixelByte:4 + uint8_t buffer[NUM_512 * NUM_512 * NUM_4] = { 0 }; // w:2 * h:3 * pixelByte:4 for (int i = 0; i < colorLength; i += NUM_4) { buffer[i] = 0x78; buffer[i + 1] = 0x83; diff --git a/frameworks/innerkitsimpl/test/unittest/pixel_map_test/pixel_map_test.cpp b/frameworks/innerkitsimpl/test/unittest/pixel_map_test/pixel_map_test.cpp index e2c12207d..a5c3ae6a6 100644 --- a/frameworks/innerkitsimpl/test/unittest/pixel_map_test/pixel_map_test.cpp +++ b/frameworks/innerkitsimpl/test/unittest/pixel_map_test/pixel_map_test.cpp @@ -386,7 +386,7 @@ void InitOption(struct InitializationOptions& opts, const uint32_t width, const * @tc.desc: Create PixelMap * @tc.type: FUNC */ -HWTEST_F(PixelMapTest, PixelMapCreateTest001, TestSize.Level3) +HWTEST_F(PixelMapTest, PixelMapCreateTest001, TestSize.Level0) { GTEST_LOG_(INFO) << "PixelMapTest: PixelMapCreateTest001 start"; @@ -426,7 +426,7 @@ HWTEST_F(PixelMapTest, PixelMapCreateTest001, TestSize.Level3) * @tc.desc: Create PixelMap * @tc.type: FUNC */ -HWTEST_F(PixelMapTest, PixelMapCreateTest002, TestSize.Level3) +HWTEST_F(PixelMapTest, PixelMapCreateTest002, TestSize.Level0) { GTEST_LOG_(INFO) << "PixelMapTest: PixelMapCreateTest002 start"; @@ -468,7 +468,7 @@ HWTEST_F(PixelMapTest, PixelMapCreateTest002, TestSize.Level3) * @tc.desc: Create PixelMap * @tc.type: FUNC */ -HWTEST_F(PixelMapTest, PixelMapCreateTest003, TestSize.Level3) +HWTEST_F(PixelMapTest, PixelMapCreateTest003, TestSize.Level1) { GTEST_LOG_(INFO) << "PixelMapTest: PixelMapCreateTest003 start"; @@ -508,7 +508,7 @@ HWTEST_F(PixelMapTest, PixelMapCreateTest003, TestSize.Level3) * @tc.desc: Create PixelMap * @tc.type: FUNC */ -HWTEST_F(PixelMapTest, PixelMapCreateTest004, TestSize.Level3) +HWTEST_F(PixelMapTest, PixelMapCreateTest004, TestSize.Level1) { GTEST_LOG_(INFO) << "PixelMapTest: PixelMapCreateTest004 start"; diff --git a/frameworks/innerkitsimpl/test/unittest/plugin_texture_encode_test.cpp b/frameworks/innerkitsimpl/test/unittest/plugin_texture_encode_test.cpp index e22528276..34ac5e188 100644 --- a/frameworks/innerkitsimpl/test/unittest/plugin_texture_encode_test.cpp +++ b/frameworks/innerkitsimpl/test/unittest/plugin_texture_encode_test.cpp @@ -386,7 +386,7 @@ HWTEST_F(PluginTextureEncodeTest, ASTCEncode005, TestSize.Level3) uint32_t setRet = astcEncoder.SetAstcEncode(stream, option, pixelMapPtr); ASSERT_EQ(setRet, SUCCESS); uint32_t astcRet = astcEncoder.ASTCEncode(); - ASSERT_EQ(astcRet, SUCCESS); + ASSERT_NE(astcRet, SUCCESS); option.quality = 20; setRet = astcEncoder.SetAstcEncode(stream, option, pixelMapPtr); @@ -429,7 +429,7 @@ HWTEST_F(PluginTextureEncodeTest, ASTCEncode006, TestSize.Level3) uint32_t setRet = astcEncoder.SetAstcEncode(stream, option, pixelMapPtr); ASSERT_EQ(setRet, SUCCESS); uint32_t astcRet = astcEncoder.ASTCEncode(); - ASSERT_EQ(astcRet, SUCCESS); + ASSERT_NE(astcRet, SUCCESS); option.quality = 20; setRet = astcEncoder.SetAstcEncode(stream, option, pixelMapPtr); @@ -473,7 +473,7 @@ HWTEST_F(PluginTextureEncodeTest, ASTCEncode007, TestSize.Level3) uint32_t setRet = astcEncoder.SetAstcEncode(stream, option, pixelMapPtr); ASSERT_EQ(setRet, SUCCESS); uint32_t astcRet = astcEncoder.ASTCEncode(); - ASSERT_EQ(astcRet, SUCCESS); + ASSERT_NE(astcRet, SUCCESS); if (output != nullptr) { free(output); -- Gitee