diff --git a/frameworks/innerkitsimpl/test/unittest/image_source_test/image_packer_test.cpp b/frameworks/innerkitsimpl/test/unittest/image_source_test/image_packer_test.cpp index b55ed5d2f0b884992670b5a708cbb97969b1b418..84e27469e86162ef53bd7a3cd801a634c49223e0 100644 --- a/frameworks/innerkitsimpl/test/unittest/image_source_test/image_packer_test.cpp +++ b/frameworks/innerkitsimpl/test/unittest/image_source_test/image_packer_test.cpp @@ -658,154 +658,6 @@ HWTEST_F(ImagePackerTest, StartPacking020, TestSize.Level3) GTEST_LOG_(INFO) << "ImagePackerTest: StartPacking020 end"; } -/** - * @tc.name: PackYuv2Jpeg001 - * @tc.desc: test PackYuv2Jpeg - * @tc.type: FUNC - */ -HWTEST_F(ImagePackerTest, PackYuv2Jpeg001, TestSize.Level3) -{ - GTEST_LOG_(INFO) << "ImagePackerTest: PackYuv2Jpeg001 start"; - - uint32_t errorCode = 0; - SourceOptions opts; - std::string srcJpeg = "/data/local/tmp/image/test.jpg"; - std::unique_ptr imageSource = ImageSource::CreateImageSource(srcJpeg.c_str(), opts, errorCode); - ASSERT_EQ(errorCode, OHOS::Media::SUCCESS); - ASSERT_NE(imageSource, nullptr); - DecodeOptions dstOpts; - dstOpts.desiredPixelFormat = PixelFormat::NV12; - std::unique_ptr pixelMap = imageSource->CreatePixelMapEx(0, dstOpts, errorCode); - ASSERT_EQ(errorCode, OHOS::Media::SUCCESS); - ASSERT_NE(pixelMap, nullptr); - - std::string outJpeg = "/data/local/tmp/image/pack1.jpg"; - ImagePacker pack; - const int fd = open(outJpeg.c_str(), O_RDWR | O_CREAT, S_IRUSR | S_IWUSR); - ASSERT_NE(fd, -1); - PackOption option; - option.format = "image/jpeg"; - errorCode = pack.StartPacking(fd, option); - ASSERT_EQ(errorCode, OHOS::Media::SUCCESS); - errorCode = pack.AddImage(*(imageSource.get())); - ASSERT_EQ(errorCode, OHOS::Media::SUCCESS); - pack.FinalizePacking(); - - close(fd); - GTEST_LOG_(INFO) << "ImagePackerTest: PackYuv2Jpeg001 end"; -} - -/** - * @tc.name: PackYuv2Jpeg002 - * @tc.desc: test PackYuv2Jpeg - * @tc.type: FUNC - */ -HWTEST_F(ImagePackerTest, PackYuv2Jpeg002, TestSize.Level3) -{ - GTEST_LOG_(INFO) << "ImagePackerTest: PackYuv2Jpeg002 start"; - - uint32_t errorCode = 0; - SourceOptions opts; - std::string srcJpeg = "/data/local/tmp/image/test_hw.jpg"; - std::unique_ptr imageSource = ImageSource::CreateImageSource(srcJpeg.c_str(), opts, errorCode); - ASSERT_EQ(errorCode, OHOS::Media::SUCCESS); - ASSERT_NE(imageSource, nullptr); - DecodeOptions dstOpts; - dstOpts.desiredPixelFormat = PixelFormat::NV21; - std::unique_ptr pixelMap = imageSource->CreatePixelMapEx(0, dstOpts, errorCode); - ASSERT_EQ(errorCode, OHOS::Media::SUCCESS); - ASSERT_NE(pixelMap, nullptr); - - std::string outJpeg = "/data/local/tmp/image/pack2.jpg"; - ImagePacker pack; - const int fd = open(outJpeg.c_str(), O_RDWR | O_CREAT, S_IRUSR | S_IWUSR); - ASSERT_NE(fd, -1); - PackOption option; - option.format = "image/jpeg"; - errorCode = pack.StartPacking(fd, option); - ASSERT_EQ(errorCode, OHOS::Media::SUCCESS); - errorCode = pack.AddImage(*(imageSource.get())); - ASSERT_EQ(errorCode, OHOS::Media::SUCCESS); - pack.FinalizePacking(); - - close(fd); - GTEST_LOG_(INFO) << "ImagePackerTest: PackYuv2Jpeg002 end"; -} - -/** - * @tc.name: PackYuv2Jpeg003 - * @tc.desc: test PackYuv2Jpeg - * @tc.type: FUNC - */ -HWTEST_F(ImagePackerTest, PackYuv2Jpeg003, TestSize.Level3) -{ - GTEST_LOG_(INFO) << "ImagePackerTest: PackYuv2Jpeg003 start"; - - uint32_t errorCode = 0; - SourceOptions opts; - std::string srcJpeg = "/data/local/tmp/image/test_exif.jpg"; - std::unique_ptr imageSource = ImageSource::CreateImageSource(srcJpeg.c_str(), opts, errorCode); - ASSERT_EQ(errorCode, OHOS::Media::SUCCESS); - ASSERT_NE(imageSource, nullptr); - DecodeOptions dstOpts; - dstOpts.desiredPixelFormat = PixelFormat::NV12; - std::unique_ptr pixelMap = imageSource->CreatePixelMapEx(0, dstOpts, errorCode); - ASSERT_EQ(errorCode, OHOS::Media::SUCCESS); - ASSERT_NE(pixelMap, nullptr); - - std::string outJpeg = "/data/local/tmp/image/pack3.jpg"; - ImagePacker pack; - const int fd = open(outJpeg.c_str(), O_RDWR | O_CREAT, S_IRUSR | S_IWUSR); - ASSERT_NE(fd, -1); - PackOption option; - option.format = "image/jpeg"; - errorCode = pack.StartPacking(fd, option); - ASSERT_EQ(errorCode, OHOS::Media::SUCCESS); - errorCode = pack.AddImage(*(imageSource.get())); - ASSERT_EQ(errorCode, OHOS::Media::SUCCESS); - pack.FinalizePacking(); - - close(fd); - GTEST_LOG_(INFO) << "ImagePackerTest: PackYuv2Jpeg003 end"; -} - -/** - * @tc.name: PackYuv2Jpeg004 - * @tc.desc: test PackYuv2Jpeg - * @tc.type: FUNC - */ -HWTEST_F(ImagePackerTest, PackYuv2Jpeg004, TestSize.Level3) -{ - GTEST_LOG_(INFO) << "ImagePackerTest: PackYuv2Jpeg004 start"; - - uint32_t errorCode = 0; - SourceOptions opts; - std::string srcJpeg = "/data/local/tmp/image/test_packing_exif.jpg"; - std::unique_ptr imageSource = ImageSource::CreateImageSource(srcJpeg.c_str(), opts, errorCode); - ASSERT_EQ(errorCode, OHOS::Media::SUCCESS); - ASSERT_NE(imageSource, nullptr); - DecodeOptions dstOpts; - dstOpts.desiredPixelFormat = PixelFormat::NV21; - std::unique_ptr pixelMap = imageSource->CreatePixelMapEx(0, dstOpts, errorCode); - ASSERT_EQ(errorCode, OHOS::Media::SUCCESS); - ASSERT_NE(pixelMap, nullptr); - - std::string outJpeg = "/data/local/tmp/image/pack4.jpg"; - ImagePacker pack; - const int fd = open(outJpeg.c_str(), O_RDWR | O_CREAT, S_IRUSR | S_IWUSR); - ASSERT_NE(fd, -1); - PackOption option; - option.format = "image/jpeg"; - errorCode = pack.StartPacking(fd, option); - ASSERT_EQ(errorCode, OHOS::Media::SUCCESS); - errorCode = pack.AddImage(*(imageSource.get())); - ASSERT_EQ(errorCode, OHOS::Media::SUCCESS); - pack.FinalizePacking(); - - close(fd); - GTEST_LOG_(INFO) << "ImagePackerTest: PackYuv2Jpeg004 end"; -} - /** * @tc.name: GetSupportedFormatsTest001 * @tc.desc: test GetSupportedFormats 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 38802e28448fdaa5b67b2edfadb5e83e62453286..e374cff2f95cbe82ee41e0875c6be761769302a1 100644 --- a/frameworks/innerkitsimpl/test/unittest/plugin_test/ext_decoder_test.cpp +++ b/frameworks/innerkitsimpl/test/unittest/plugin_test/ext_decoder_test.cpp @@ -138,25 +138,6 @@ HWTEST_F(ExtDecoderTest, CheckCodecTest001, TestSize.Level3) GTEST_LOG_(INFO) << "ExtDecoderTest: CheckCodecTest001 end"; } -/** - * @tc.name: GetScaledSizeTest001 - * @tc.desc: Test of GetScaledSize - * @tc.type: FUNC - */ -HWTEST_F(ExtDecoderTest, GetScaledSizeTest001, TestSize.Level3) -{ - GTEST_LOG_(INFO) << "ExtDecoderTest: GetScaledSizeTest001 start"; - std::shared_ptr extDecoder = std::make_shared(); - EXIFInfo exifInfo_; - int dWidth = 0; - int dHeight = 0; - float scale = ZERO; - extDecoder->codec_ = nullptr; - bool ret = extDecoder->GetScaledSize(dWidth, dHeight, scale); - ASSERT_EQ(ret, false); - GTEST_LOG_(INFO) << "ExtDecoderTest: GetScaledSizeTest001 end"; -} - /** * @tc.name: GetHardwareScaledSizeTest001 * @tc.desc: Test of GetHardwareScaledSize