1/* 2 * Copyright (c) 2024 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15#define LOG_TAG "AudioTest" 16 17#include <unistd.h> 18#include <gtest/gtest.h> 19#include <string> 20 21#include "logger.h" 22#include "audio.h" 23 24using namespace testing::ext; 25using namespace OHOS::UDMF; 26using namespace OHOS; 27namespace OHOS::Test { 28using namespace std; 29 30class AudioTest : public testing::Test { 31public: 32 static void SetUpTestCase(); 33 static void TearDownTestCase(); 34 void SetUp() override; 35 void TearDown() override; 36}; 37 38void AudioTest::SetUpTestCase() 39{ 40} 41 42void AudioTest::TearDownTestCase() 43{ 44} 45 46void AudioTest::SetUp() 47{ 48} 49 50void AudioTest::TearDown() 51{ 52} 53 54/** 55* @tc.name: Audio001 56* @tc.desc: Normal testcase of Audio 57* @tc.type: FUNC 58*/ 59HWTEST_F(AudioTest, Audio001, TestSize.Level1) 60{ 61 LOG_INFO(UDMF_TEST, "Audio001 begin."); 62 UDType type = UDType::ENTITY; 63 ValueType value = 0; 64 Audio audio(type, value); 65 EXPECT_EQ(audio.dataType_, AUDIO); 66 LOG_INFO(UDMF_TEST, "Audio001 end."); 67} 68} // OHOS::Test