From 74fcef089dbc5ceb0aed4ea8c20197eb1587d448 Mon Sep 17 00:00:00 2001 From: zhaona45 Date: Wed, 13 Aug 2025 10:19:12 +0800 Subject: [PATCH] Fix TDD script unable to push images in Signed-off-by: zhaona45 Change-Id: I6fdb809d8755de8d3670db99b833cdedf466a4b1 --- .../test/unittest/plugin_test/ext_decoder_test.cpp | 12 ++++++++++++ test/resource/image/ohos_test.xml | 4 ++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/frameworks/innerkitsimpl/test/unittest/plugin_test/ext_decoder_test.cpp b/frameworks/innerkitsimpl/test/unittest/plugin_test/ext_decoder_test.cpp index 6e4c1f975..80f9b6493 100644 --- a/frameworks/innerkitsimpl/test/unittest/plugin_test/ext_decoder_test.cpp +++ b/frameworks/innerkitsimpl/test/unittest/plugin_test/ext_decoder_test.cpp @@ -1397,10 +1397,13 @@ HWTEST_F(ExtDecoderTest, WriteJpegCodedDataTest004, TestSize.Level3) opts.formatHint = "image/jpeg"; std::unique_ptr imageSource = ImageSource::CreateImageSource(IMAGE_INPUT_JPEG_PATH, opts, errorCode); + ASSERT_NE(imageSource, nullptr); DecodeOptions decodeOpts; decodeOpts.allocatorType = AllocatorType::DMA_ALLOC; std::unique_ptr tmpPixelMap = imageSource->CreatePixelMap(decodeOpts, errorCode); + ASSERT_NE(tmpPixelMap, nullptr); std::shared_ptr pixelMap = std::move(tmpPixelMap); + ASSERT_NE(pixelMap, nullptr); ASSERT_EQ(pixelMap->GetAllocatorType(), AllocatorType::DMA_ALLOC); ASSERT_NE(pixelMap->GetFd(), nullptr); AuxiliaryPictureType type = AuxiliaryPictureType::GAINMAP; @@ -1429,10 +1432,13 @@ HWTEST_F(ExtDecoderTest, WriteJpegUncodedDataTest004, TestSize.Level3) opts.formatHint = "image/jpeg"; std::unique_ptr imageSource = ImageSource::CreateImageSource(IMAGE_INPUT_JPEG_PATH, opts, errorCode); + ASSERT_NE(imageSource, nullptr); DecodeOptions decodeOpts; decodeOpts.allocatorType = AllocatorType::DMA_ALLOC; std::unique_ptr tmpPixelMap = imageSource->CreatePixelMap(decodeOpts, errorCode); + ASSERT_NE(tmpPixelMap, nullptr); std::shared_ptr pixelMap = std::move(tmpPixelMap); + ASSERT_NE(pixelMap, nullptr); ASSERT_EQ(pixelMap->GetAllocatorType(), AllocatorType::DMA_ALLOC); ASSERT_NE(pixelMap->GetFd(), nullptr); AuxiliaryPictureType type = AuxiliaryPictureType::GAINMAP; @@ -1462,10 +1468,13 @@ HWTEST_F(ExtDecoderTest, WriteJpegUncodedDataTest005, TestSize.Level3) opts.formatHint = "image/jpeg"; std::unique_ptr imageSource = ImageSource::CreateImageSource(IMAGE_INPUT_JPEG_PATH, opts, errorCode); + ASSERT_NE(imageSource, nullptr); DecodeOptions decodeOpts; decodeOpts.allocatorType = AllocatorType::DMA_ALLOC; std::unique_ptr tmpPixelMap = imageSource->CreatePixelMap(decodeOpts, errorCode); + ASSERT_NE(tmpPixelMap, nullptr); std::shared_ptr pixelMap = std::move(tmpPixelMap); + ASSERT_NE(pixelMap, nullptr); ASSERT_EQ(pixelMap->GetAllocatorType(), AllocatorType::DMA_ALLOC); ASSERT_NE(pixelMap->GetFd(), nullptr); AuxiliaryPictureType type = AuxiliaryPictureType::DEPTH_MAP; @@ -1495,10 +1504,13 @@ HWTEST_F(ExtDecoderTest, WriteJpegUncodedDataTest006, TestSize.Level3) opts.formatHint = "image/jpeg"; std::unique_ptr imageSource = ImageSource::CreateImageSource(IMAGE_INPUT_JPEG_PATH, opts, errorCode); + ASSERT_NE(imageSource, nullptr); DecodeOptions decodeOpts; decodeOpts.allocatorType = AllocatorType::DMA_ALLOC; std::unique_ptr tmpPixelMap = imageSource->CreatePixelMap(decodeOpts, errorCode); + ASSERT_NE(tmpPixelMap, nullptr); std::shared_ptr pixelMap = std::move(tmpPixelMap); + ASSERT_NE(pixelMap, nullptr); ASSERT_EQ(pixelMap->GetAllocatorType(), AllocatorType::DMA_ALLOC); ASSERT_NE(pixelMap->GetFd(), nullptr); AuxiliaryPictureType type = AuxiliaryPictureType::LINEAR_MAP; diff --git a/test/resource/image/ohos_test.xml b/test/resource/image/ohos_test.xml index fda3fb0eb..f325e6d63 100644 --- a/test/resource/image/ohos_test.xml +++ b/test/resource/image/ohos_test.xml @@ -116,11 +116,11 @@ - -- Gitee