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 16 #include <gmock/gmock.h> 17 #include <gtest/gtest.h> 18 #include "cloud_daemon_manager_impl.h" 19 20 namespace OHOS::FileManagement::CloudFile::Test { 21 using namespace testing; 22 using namespace testing::ext; 23 using namespace std; 24 25 class CloudDaemonManagerTest : public testing::Test { 26 public: 27 static void SetUpTestCase(void); 28 static void TearDownTestCase(void); 29 void SetUp(); 30 void TearDown(); 31 }; 32 SetUpTestCase(void)33void CloudDaemonManagerTest::SetUpTestCase(void) 34 { 35 GTEST_LOG_(INFO) << "SetUpTestCase"; 36 } 37 TearDownTestCase(void)38void CloudDaemonManagerTest::TearDownTestCase(void) 39 { 40 GTEST_LOG_(INFO) << "TearDownTestCase"; 41 } 42 SetUp(void)43void CloudDaemonManagerTest::SetUp(void) 44 { 45 GTEST_LOG_(INFO) << "SetUp"; 46 } 47 TearDown(void)48void CloudDaemonManagerTest::TearDown(void) 49 { 50 GTEST_LOG_(INFO) << "TearDown"; 51 } 52 53 /** 54 * @tc.name: GetInstanceTest 55 * @tc.desc: Verify the GetInstance function 56 * @tc.type: FUNC 57 * @tc.require: I6H5MH 58 */ 59 HWTEST_F(CloudDaemonManagerTest, GetInstanceTest, TestSize.Level1) 60 { 61 GTEST_LOG_(INFO) << "GetInstanceTest Start"; 62 try { 63 CloudDaemonManager::GetInstance(); 64 EXPECT_TRUE(true); 65 } catch (...) { 66 EXPECT_TRUE(false); 67 GTEST_LOG_(INFO) << "GetInstanceTest ERROR"; 68 } 69 GTEST_LOG_(INFO) << "GetInstanceTest End"; 70 } 71 } // namespace OHOS::FileManagement::CloudFile::Test