From 05499d1f01028bb3ea75ecfce9e24b1cfe778a3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9F=A6=E5=9B=BD=E5=BA=86?= Date: Thu, 2 Jan 2025 14:17:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=97=A0=E7=94=A8ut?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 韦国庆 --- .../src/histreamer_ability_querier_test.cpp | 94 ------------------- 1 file changed, 94 deletions(-) diff --git a/av_transport/av_trans_handler/histreamer_ability_querier/test/unittest/common/src/histreamer_ability_querier_test.cpp b/av_transport/av_trans_handler/histreamer_ability_querier/test/unittest/common/src/histreamer_ability_querier_test.cpp index 2c859f1e..22d97c9a 100644 --- a/av_transport/av_trans_handler/histreamer_ability_querier/test/unittest/common/src/histreamer_ability_querier_test.cpp +++ b/av_transport/av_trans_handler/histreamer_ability_querier/test/unittest/common/src/histreamer_ability_querier_test.cpp @@ -612,99 +612,5 @@ HWTEST_F(HistreamerAbilityQuerierTest, histreamer_ability_querier_test_023, Test EXPECT_TRUE(videoDecoder.outs.empty()); cJSON_Delete(jsonObject2); } - -/** - * @tc.name: histreamer_ability_querier_test_024 - * @tc.desc: Verify the FromJson(const cJSON *jsonObject, VideoDecoder &videoDecoder) function. - * @tc.type: FUNC - * @tc.require: issuelI7MJPJ - */ -HWTEST_F(HistreamerAbilityQuerierTest, histreamer_ability_querier_test_024, TestSize.Level0) -{ - cJSON *jsonObject = nullptr; - AudioEncoderIn audioEncoderIn; - audioEncoderIn.mime = AUDIO_ENCODERIN_MIME; - audioEncoderIn.sample_rate = {96000, 88200, 64000, 48000, 44100, 32000}; - ToJson(jsonObject, audioEncoderIn); - - jsonObject = cJSON_CreateObject(); - ASSERT_TRUE(jsonObject != nullptr); - cJSON_AddStringToObject(jsonObject, MIME.c_str(), "MIME"); - cJSON *sampleRateJson = cJSON_CreateArray(); - if (sampleRateJson == nullptr) { - cJSON_Delete(jsonObject); - return; - } - cJSON_AddItemToArray(sampleRateJson, cJSON_CreateNumber(1)); - cJSON_AddItemToObject(jsonObject, SAMPLE_RATE.c_str(), sampleRateJson); - FromJson(jsonObject, audioEncoderIn); - cJSON_Delete(jsonObject); - - cJSON *jsonObject2 = cJSON_CreateObject(); - ASSERT_TRUE(jsonObject2 != nullptr); - cJSON_AddNumberToObject(jsonObject2, MIME.c_str(), 1); - FromJson(jsonObject2, audioEncoderIn); - cJSON_Delete(jsonObject2); - - cJSON *jsonObject3 = cJSON_CreateObject(); - ASSERT_TRUE(jsonObject3 != nullptr); - cJSON_AddStringToObject(jsonObject3, MIME.c_str(), "MIME"); - cJSON *sampleRateJson1 = cJSON_CreateObject(); - if (sampleRateJson1 == nullptr) { - cJSON_Delete(jsonObject3); - ASSERT_TRUE(sampleRateJson1 != nullptr); - } - cJSON_AddItemToArray(sampleRateJson1, cJSON_CreateNumber(1)); - cJSON_AddItemToObject(jsonObject3, SAMPLE_RATE.c_str(), sampleRateJson1); - FromJson(jsonObject3, audioEncoderIn); - cJSON_Delete(jsonObject3); -} - -/** - * @tc.name: histreamer_ability_querier_test_025 - * @tc.desc: Verify the FromJson(const cJSON *jsonObject, VideoDecoder &videoDecoder) function. - * @tc.type: FUNC - * @tc.require: issuelI7MJPJ - */ -HWTEST_F(HistreamerAbilityQuerierTest, histreamer_ability_querier_test_025, TestSize.Level0) -{ - cJSON *jsonObject = nullptr; - AudioEncoderOut audioEncoderOut; - ToJson(jsonObject, audioEncoderOut); - - jsonObject = cJSON_CreateObject(); - ASSERT_TRUE(jsonObject != nullptr); - cJSON_AddStringToObject(jsonObject, MIME.c_str(), "MIME"); - cJSON_AddNumberToObject(jsonObject, AD_MPEG_VER.c_str(), 1); - cJSON_AddNumberToObject(jsonObject, AUDIO_AAC_PROFILE.c_str(), 2); - cJSON_AddNumberToObject(jsonObject, AUDIO_AAC_STREAM_FORMAT.c_str(), 3); - FromJson(jsonObject, audioEncoderOut); - cJSON_Delete(jsonObject); - - cJSON *jsonObject2 = cJSON_CreateObject(); - ASSERT_TRUE(jsonObject2 != nullptr); - cJSON_AddStringToObject(jsonObject2, MIME.c_str(), "MIME"); - cJSON_AddStringToObject(jsonObject2, AD_MPEG_VER.c_str(), "VER"); - FromJson(jsonObject2, audioEncoderOut); - cJSON_Delete(jsonObject2); - - cJSON *jsonObject3 = cJSON_CreateObject(); - ASSERT_TRUE(jsonObject3 != nullptr); - cJSON_AddStringToObject(jsonObject3, MIME.c_str(), "MIME"); - cJSON_AddNumberToObject(jsonObject3, AD_MPEG_VER.c_str(), 1); - cJSON_AddStringToObject(jsonObject3, AUDIO_AAC_PROFILE.c_str(), "PROFILE"); - FromJson(jsonObject3, audioEncoderOut); - cJSON_Delete(jsonObject3); - - - cJSON *jsonObject4 = cJSON_CreateObject(); - ASSERT_TRUE(jsonObject4 != nullptr); - cJSON_AddStringToObject(jsonObject4, MIME.c_str(), "MIME"); - cJSON_AddNumberToObject(jsonObject4, AD_MPEG_VER.c_str(), 1); - cJSON_AddNumberToObject(jsonObject4, AUDIO_AAC_PROFILE.c_str(), 2); - cJSON_AddStringToObject(jsonObject4, AUDIO_AAC_STREAM_FORMAT.c_str(), "FORMAT"); - FromJson(jsonObject4, audioEncoderOut); - cJSON_Delete(jsonObject4); -} } // namespace DistributedHardware } // namespace OHOS \ No newline at end of file -- Gitee