From 5d8d92b6507593de46a9b063fadd548e0fcb6801 Mon Sep 17 00:00:00 2001 From: SuRuoyan Date: Tue, 21 Jan 2025 16:33:02 +0800 Subject: [PATCH] fix ut and log Signed-off-by: SuRuoyan --- services/media_engine/modules/media_codec/media_codec.cpp | 4 ++-- .../audio_test/audio_decoder_avbuffer_capi_unit_test.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/services/media_engine/modules/media_codec/media_codec.cpp b/services/media_engine/modules/media_codec/media_codec.cpp index d42ce8539..70ece27c0 100644 --- a/services/media_engine/modules/media_codec/media_codec.cpp +++ b/services/media_engine/modules/media_codec/media_codec.cpp @@ -866,7 +866,7 @@ uint32_t MediaCodec::GetApiVersion() systemAbilityManager->GetSystemAbility(BUNDLE_MGR_SERVICE_SYS_ABILITY_ID); sptr iBundleMgr = OHOS::iface_cast(remoteObject); if (iBundleMgr == nullptr) { - MEDIA_LOG_E("GetApiVersion IBundleMgr is nullptr"); + MEDIA_LOG_W("GetApiVersion IBundleMgr is nullptr"); return apiVersion; } AppExecFwk::BundleInfo bundleInfo; @@ -874,7 +874,7 @@ uint32_t MediaCodec::GetApiVersion() apiVersion = bundleInfo.targetVersion % API_VERSION_MOD; MEDIA_LOG_I("GetApiVersion targetVersion: %{public}u", bundleInfo.targetVersion); } else { - MEDIA_LOG_E("GetApiVersion failed"); + MEDIA_LOG_W("GetApiVersion failed, call by SA or test maybe"); } return apiVersion; } diff --git a/test/unittest/audio_test/audio_decoder_avbuffer_capi_unit_test.cpp b/test/unittest/audio_test/audio_decoder_avbuffer_capi_unit_test.cpp index 0cc6846a5..54cf379c5 100644 --- a/test/unittest/audio_test/audio_decoder_avbuffer_capi_unit_test.cpp +++ b/test/unittest/audio_test/audio_decoder_avbuffer_capi_unit_test.cpp @@ -3177,10 +3177,10 @@ HWTEST_F(AudioDecoderBufferCapiUnitTest, audioDecoder_VorbisFormatChanged, TestS HWTEST_F(AudioDecoderBufferCapiUnitTest, audioDecoder_OpusFormatChanged, TestSize.Level1) { - isTestingFormat_ = true; if (!CheckSoFunc()) { return; } + isTestingFormat_ = true; ASSERT_EQ(OH_AVErrCode::AV_ERR_OK, InitFile(INPUT_OPUS_FILE_PATH, OUTPUT_OPUS_PCM_FILE_PATH)); ASSERT_EQ(OH_AVErrCode::AV_ERR_OK, CreateCodecFunc(AudioBufferFormatType::TYPE_OPUS)); EXPECT_EQ(OH_AVErrCode::AV_ERR_OK, Configure(AudioBufferFormatType::TYPE_OPUS)); -- Gitee