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 16 #include <memory> 17 #include <iostream> 18 #include "gtest/gtest.h" 19 #include "osal/utils/dump_buffer.h" 20 #include "common/media_core.h" 21 #include "meta/meta.h" 22 #include "buffer/avbuffer.h" 23 24 using namespace testing::ext; 25 using namespace OHOS::Media; 26 27 namespace { 28 const std::string DUMP_PARAM = "w"; 29 const std::string DUMP_FILE_NAME = "DumpBufferTest.es"; 30 } 31 32 namespace OHOS { 33 namespace Media { 34 class DumpBufferTest : public testing::Test { 35 public: SetUpTestCase(void)36 static void SetUpTestCase(void) {}; TearDownTestCase(void)37 static void TearDownTestCase(void) {}; SetUp(void)38 void SetUp(void) {}; TearDown(void)39 void TearDown(void) {}; 40 }; 41 42 /** 43 * @tc.name: DumpAVBufferToFile 44 * @tc.desc: DumpAVBufferToFile 45 * @tc.type: FUNC 46 */ 47 HWTEST_F(DumpBufferTest, DumpAVBufferToFile, TestSize.Level1) 48 { 49 std::shared_ptr<Media::AVBuffer> outputBuffer = nullptr; 50 outputBuffer = std::make_shared<AVBuffer>(); 51 DumpAVBufferToFile(DUMP_PARAM, DUMP_FILE_NAME, outputBuffer); 52 } 53 } 54 }