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 2c859f1ef8b1f2237f66176ebb0d364c20ae6734..22d97c9ac2287e651a37f3de12b3bdee8caaacb9 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