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 60a3fc5749d4581c5b82460c2f938d312fd5e578..e5f4c943477ed304efb82f7624268fd23594ed38 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 @@ -671,113 +671,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(); - if (jsonObject == nullptr) { - return; - } - 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(); - if (jsonObject2 == nullptr) { - return; - } - cJSON_AddNumberToObject(jsonObject2, MIME.c_str(), 1); - FromJson(jsonObject2, audioEncoderIn); - cJSON_Delete(jsonObject2); - - cJSON *jsonObject3 = cJSON_CreateObject(); - if (jsonObject3 == nullptr) { - return; - } - cJSON_AddStringToObject(jsonObject3, MIME.c_str(), "MIME"); - cJSON *sampleRateJson1 = cJSON_CreateObject(); - if (sampleRateJson1 == nullptr) { - cJSON_Delete(jsonObject3); - return; - } - 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(); - if (jsonObject == nullptr) { - return; - } - 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(); - if (jsonObject2 == nullptr) { - return; - } - 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(); - if (jsonObject3 == nullptr) { - return; - } - 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(); - if (jsonObject4 == nullptr) { - return; - } - 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