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 <gtest/gtest.h>
17 #include <sys/stat.h>
18 #include <sys/types.h>
19 #include <string>
20 #include <vector>
21 #include <iostream>
22
23 #define private public
24 #define protected public
25 #include "device_profile_load_callback.h"
26 #include "distributed_device_profile_log.h"
27 #include "distributed_device_profile_errors.h"
28 #undef private
29 #undef protected
30
31 namespace OHOS {
32 namespace DistributedDeviceProfile {
33 using namespace testing::ext;
34 using namespace std;
35 namespace {
36 const std::string TAG = "DeviceProfileLoadCallbackTest";
37 }
38 class DeviceProfileLoadCallbackTest : public testing::Test {
39 public:
40 static void SetUpTestCase();
41 static void TearDownTestCase();
42 void SetUp();
43 void TearDown();
44 };
45
SetUpTestCase()46 void DeviceProfileLoadCallbackTest::SetUpTestCase()
47 {
48 }
49
TearDownTestCase()50 void DeviceProfileLoadCallbackTest::TearDownTestCase()
51 {
52 }
53
SetUp()54 void DeviceProfileLoadCallbackTest::SetUp()
55 {
56 }
57
TearDown()58 void DeviceProfileLoadCallbackTest::TearDown()
59 {
60 }
61
62 /*
63 * @tc.name: OnLoadSystemAbilitySuccess_001
64 * @tc.desc: Normal testCase of OnLoadSystemAbilitySuccess for CRUD
65 * @tc.type: FUNC
66 */
67 HWTEST_F(DeviceProfileLoadCallbackTest, OnLoadSystemAbilitySuccess_001, TestSize.Level1)
68 {
69 int32_t systemAbilityId = 0;
70 const OHOS::sptr<OHOS::IRemoteObject> remoteObject = nullptr;
71 DeviceProfileLoadCallback callBack;
72 callBack.OnLoadSystemAbilitySuccess(systemAbilityId, remoteObject);
73 }
74
75 /*
76 * @tc.name: OnLoadSystemAbilityFail_001
77 * @tc.desc: Normal testCase of OnLoadSystemAbilityFail for CRUD
78 * @tc.type: FUNC
79 */
80 HWTEST_F(DeviceProfileLoadCallbackTest, OnLoadSystemAbilityFail_001, TestSize.Level1)
81 {
82 int32_t systemAbilityId = 0;
83 DeviceProfileLoadCallback callBack;
84 callBack.OnLoadSystemAbilityFail(systemAbilityId);
85 }
86 } // namespace DistributedDeviceProfile
87 } // namespace OHOS
88