1 /* 2 * Copyright (c) 2023 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 private public 16 #define protected public 17 18 #include "gtest/gtest.h" 19 20 #include "vpe_sa_utils.h" 21 22 #include <fcntl.h> 23 #include <sys/stat.h> 24 #include <sys/types.h> 25 #include <unistd.h> 26 27 #include "vpe_log.h" 28 29 // NOTE: Add header file of static algorithm which would be called by VPE SA below: 30 // algorithm begin 31 // algorithm end 32 using namespace std; 33 using namespace testing::ext; 34 35 using namespace OHOS; 36 using namespace OHOS::Media::VideoProcessingEngine; 37 38 namespace OHOS { 39 namespace Media { 40 namespace VideoProcessingEngine { 41 42 class VpeSaUtilsTest : public testing::Test { 43 public: 44 static void SetUpTestCase(void); 45 static void TearDownTestCase(void); 46 void SetUp(); 47 void TearDown(); 48 }; 49 SetUpTestCase(void)50void VpeSaUtilsTest::SetUpTestCase(void) 51 { 52 cout << "[SetUpTestCase]: " << endl; 53 } 54 TearDownTestCase(void)55void VpeSaUtilsTest::TearDownTestCase(void) 56 { 57 cout << "[TearDownTestCase]: " << endl; 58 } 59 SetUp(void)60void VpeSaUtilsTest::SetUp(void) 61 { 62 cout << "[SetUp]: SetUp!!!" << endl; 63 } 64 TearDown(void)65void VpeSaUtilsTest::TearDown(void) 66 { 67 cout << "[TearDown]: over!!!" << endl; 68 } 69 70 /** 71 * @tc.name : GetProcessName_ShouldReturnProcessName_WhenProcessExists 72 * @tc.number: VpeSaUtilsTest_001 73 * @tc.desc : Test GetProcessName method when process exists. 74 */ TEST_F(VpeSaUtilsTest,GetProcessName_ShouldReturnProcessName_WhenProcessExists)75TEST_F(VpeSaUtilsTest, GetProcessName_ShouldReturnProcessName_WhenProcessExists) 76 { 77 VpeSaUtils vpeSaUtils; 78 std::string processName = vpeSaUtils.GetProcessName(); 79 EXPECT_FALSE(processName.empty()); 80 } 81 82 } 83 } 84 } 85