From b1a9b06b5f304bfc04a98c6856239ee87b11e022 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E4=B9=94=E5=BC=82?= Date: Wed, 10 Sep 2025 16:12:45 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=85=85=E5=8D=95=E5=85=83=E6=B5=8B?= =?UTF-8?q?=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 陈乔异 --- .../test/unittest/post_proc_test.cpp | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/frameworks/innerkitsimpl/test/unittest/post_proc_test.cpp b/frameworks/innerkitsimpl/test/unittest/post_proc_test.cpp index 3a3a53fe3..0414c5d75 100644 --- a/frameworks/innerkitsimpl/test/unittest/post_proc_test.cpp +++ b/frameworks/innerkitsimpl/test/unittest/post_proc_test.cpp @@ -1052,6 +1052,56 @@ HWTEST_F(PostProcTest, ScalePixelMapExTest001, TestSize.Level3) GTEST_LOG_(INFO) << "PostProcTest: ScalePixelMapExTest001 end"; } +/** + * @tc.name: ScalePixelMapExOddWidthTest001 + * @tc.desc: Test ScalePixelMapEx with odd number PixelMap width + * @tc.type: FUNC + */ +HWTEST_F(PostProcTest, ScalePixelMapExOddWidthTest001, TestSize.Level3) +{ + GTEST_LOG_(INFO) << "PostProcTest: ScalePixelMapExOddWidthTest001 start"; + + InitializationOptions opts; + opts.size = {1, 1}; + opts.allocatorType = AllocatorType::SHARE_MEM_ALLOC; + std::unique_ptr pixelMap = PixelMap::Create(opts); + if (!pixelMap) { + return; + } + PostProc postProc; + Size desiredSize = {10, 10}; + bool ret = postProc.ScalePixelMapEx(desiredSize, *(pixelMap.get())); + ASSERT_EQ(ret, true); + + GTEST_LOG_(INFO) << "PostProcTest: ScalePixelMapExOddWidthTest001 end"; +} + +/** + * @tc.name: ScalePixelMapExOddWidthTest002 + * @tc.desc: Test ScalePixelMapEx with odd number PixelMap width + * @tc.type: FUNC + */ +HWTEST_F(PostProcTest, ScalePixelMapExOddWidthTest002, TestSize.Level3) +{ + GTEST_LOG_(INFO) << "PostProcTest: ScalePixelMapExOddWidthTest002 start"; + + InitializationOptions opts; + opts.size = {513, 512}; + opts.pixelFormat = PixelFormat::RGBA_8888; + opts.allocatorType = AllocatorType::SHARE_MEM_ALLOC; + opts.useDMA = true; + std::unique_ptr pixelMap = PixelMap::Create(opts); + if (!pixelMap) { + return; + } + PostProc postProc; + Size desiredSize = {11, 10}; + bool ret = postProc.ScalePixelMapEx(desiredSize, *(pixelMap.get())); + ASSERT_EQ(ret, true); + + GTEST_LOG_(INFO) << "PostProcTest: ScalePixelMapExOddWidthTest002 end"; +} + /** * @tc.name: DecodePostProc001 * @tc.desc: Vertify that DecodePostProc when cropAndScaleStrategy is scale first. -- Gitee