• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2022-2025 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6#     http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14import("//build/test.gni")
15import("../../../../dsoftbus.gni")
16
17module_output_path = "dsoftbus/soft_bus/LNN"
18dsoftbus_root_path = "../../../.."
19
20ohos_unittest("HeartBeatMediumTest") {
21  module_out_path = module_output_path
22  sources = [
23    "$dsoftbus_root_path/core/authentication/src/auth_deviceprofile_virtual.cpp",
24    "$dsoftbus_root_path/core/authentication/src/auth_interface.c",
25    "$dsoftbus_root_path/core/authentication/src/auth_tcp_connection.c",
26    "$dsoftbus_root_path/core/bus_center/monitor/src/lnn_init_monitor.c",
27    "$dsoftbus_root_path/core/bus_center/utils/src/lnn_connection_addr_utils.c",
28    "$dsoftbus_root_path/core/transmission/trans_channel/auth/src/trans_auth_manager.c",
29    "$dsoftbus_root_path/core/transmission/trans_channel/manager/src/trans_channel_manager.c",
30    "$dsoftbus_root_path/core/transmission/trans_channel/proxy/src/softbus_proxychannel_manager.c",
31    "$dsoftbus_root_path/tests/core/bus_center/lnn/net_builder/src/lnn_net_ledger_mock.cpp",
32    "$dsoftbus_root_path/tests/core/bus_center/mock_common/src/distribute_net_ledger_mock.cpp",
33    "$dsoftbus_root_path/tests/core/bus_center/test/heartbeat/hb_medium_mgr_test.cpp",
34    "$dsoftbus_root_path/tests/core/bus_center/test/mock/src/hb_medium_mgr_mock.cpp",
35    "$dsoftbus_root_path/tests/core/bus_center/test/mock/src/hb_strategy_mock.cpp",
36    "$dsoftbus_root_path/tests/core/discovery/ble/softbus_ble_mock/ble_mock.cpp",
37    "$dsoftbus_root_path/core/frame/init/src/g_enhance_lnn_func.c",
38    "$dsoftbus_root_path/core/frame/init/src/g_enhance_auth_func.c",
39  ]
40
41  include_dirs = [
42    "$dsoftbus_dfx_path/interface/include/form",
43    "$dsoftbus_dfx_path/interface/include/legacy",
44    "$dsoftbus_root_path/adapter/common/include",
45    "$dsoftbus_root_path/adapter/common/net/bluetooth/broadcast/interface",
46    "$dsoftbus_root_path/adapter/common/net/bluetooth/include",
47    "$dsoftbus_root_path/core/adapter/bus_center/include",
48    "$dsoftbus_root_path/core/adapter/transmission/include",
49    "$dsoftbus_root_path/core/authentication/include",
50    "$dsoftbus_root_path/core/authentication/interface",
51    "$dsoftbus_root_path/core/broadcast/common/include",
52    "$dsoftbus_root_path/core/bus_center/interface",
53    "$dsoftbus_root_path/core/bus_center/lnn/disc_mgr/include",
54    "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/include",
55    "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/src",
56    "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/include",
57    "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/src",
58    "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_qos/include",
59    "$dsoftbus_root_path/core/bus_center/lnn/meta_node/include",
60    "$dsoftbus_root_path/core/bus_center/lnn/net_builder/include",
61    "$dsoftbus_root_path/core/bus_center/lnn/net_buscenter/include",
62    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include",
63    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/decision_db/include",
64    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/distributed_ledger/include",
65    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/local_ledger/include",
66    "$dsoftbus_root_path/core/bus_center/monitor/include",
67    "$dsoftbus_root_path/core/bus_center/service/include",
68    "$dsoftbus_root_path/core/bus_center/utils/include",
69    "$dsoftbus_root_path/core/common/include",
70    "$dsoftbus_root_path/core/common/security/permission/include",
71    "$dsoftbus_root_path/core/connection/p2p/common/include",
72    "$dsoftbus_root_path/core/connection/p2p/interface",
73    "$dsoftbus_root_path/core/connection/wifi_direct_cpp",
74    "$dsoftbus_root_path/core/core/discovery/manager/include",
75    "$dsoftbus_root_path/core/discovery/ble/softbus_ble/include",
76    "$dsoftbus_root_path/core/discovery/interface",
77    "$dsoftbus_root_path/core/discovery/manager/include",
78    "$dsoftbus_root_path/core/frame/init/include",
79    "$dsoftbus_root_path/core/transmission/session/include",
80    "$dsoftbus_root_path/core/transmission/trans_channel/auth/include",
81    "$dsoftbus_root_path/core/transmission/trans_channel/common/include",
82    "$dsoftbus_root_path/core/transmission/trans_channel/manager/include",
83    "$dsoftbus_root_path/core/transmission/trans_channel/qos/interface",
84    "$dsoftbus_root_path/core/transmission/trans_channel/tcp_direct/include",
85    "$dsoftbus_root_path/core/transmission/trans_channel/udp_negotiation/include",
86    "$dsoftbus_root_path/interfaces/inner_kits/lnn",
87    "$dsoftbus_root_path/interfaces/inner_kits/transport",
88    "$dsoftbus_root_path/interfaces/kits/adapter",
89    "$dsoftbus_root_path/interfaces/kits/authentication",
90    "$dsoftbus_root_path/interfaces/kits/broadcast",
91    "$dsoftbus_root_path/interfaces/kits/bus_center",
92    "$dsoftbus_root_path/interfaces/kits/disc",
93    "$dsoftbus_root_path/interfaces/kits/discovery",
94    "$dsoftbus_root_path/interfaces/kits/lnn",
95    "$dsoftbus_root_path/interfaces/kits/transport",
96    "$dsoftbus_root_path/tests/core/bus_center/lnn/net_builder/include",
97    "$dsoftbus_root_path/tests/core/bus_center/mock_common/include",
98    "$dsoftbus_root_path/tests/core/bus_center/test/mock/include",
99    "$dsoftbus_root_path/tests/core/discovery/ble/softbus_ble_mock",
100    "$dsoftbus_root_path/tests/interface/enhance",
101    "$dsoftbus_root_path/tests/interfaces/enhance",
102  ]
103
104  deps = [
105    "$dsoftbus_dfx_path:softbus_dfx",
106    "$dsoftbus_root_path/adapter:softbus_adapter",
107    "$dsoftbus_root_path/core/common:softbus_utils",
108    "$dsoftbus_root_path/core/frame:softbus_server",
109  ]
110
111  if (is_standard_system) {
112    external_deps = [
113      "device_auth:deviceauth_sdk",
114      "googletest:gmock",
115      "googletest:gtest_main",
116      "hilog:libhilog",
117    ]
118  } else {
119    external_deps = [
120      "googletest:gmock",
121      "googletest:gtest_main",
122      "hilog:libhilog",
123      "huks:libhukssdk",
124    ]
125  }
126  external_deps += [
127    "c_utils:utils",
128    "ipc:ipc_single",
129  ]
130}
131
132ohos_unittest("HeartBeatMediumStaticTest") {
133  module_out_path = module_output_path
134  sources = [
135    "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/src/lnn_heartbeat_utils.c",
136    "$dsoftbus_root_path/tests/core/bus_center/lnn/net_builder/src/lnn_net_ledger_mock.cpp",
137    "$dsoftbus_root_path/tests/core/bus_center/test/heartbeat/hb_medium_mgr_static_test.cpp",
138    "$dsoftbus_root_path/tests/core/bus_center/test/mock/src/hb_medium_mgr_static_mock.cpp",
139    "$dsoftbus_root_path/tests/core/bus_center/test/mock/src/hb_strategy_mock.cpp",
140    "$dsoftbus_root_path/core/frame/init/src/g_enhance_lnn_func.c",
141    "$dsoftbus_root_path/core/frame/init/src/g_enhance_lnn_func_pack.c",
142  ]
143
144  include_dirs = [
145    "$dsoftbus_dfx_path/interface/include/form",
146    "$dsoftbus_dfx_path/interface/include/legacy",
147    "$dsoftbus_root_path/adapter/common/include",
148    "$dsoftbus_root_path/adapter/common/net/bluetooth/broadcast/interface",
149    "$dsoftbus_root_path/adapter/common/net/bluetooth/include",
150    "$dsoftbus_root_path/adapter/common/net/wifi/include",
151    "$dsoftbus_root_path/core/authentication/include",
152    "$dsoftbus_root_path/core/authentication/interface",
153    "$dsoftbus_root_path/core/bus_center/interface",
154    "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/include",
155    "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/src",
156    "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/include",
157    "$dsoftbus_root_path/core/bus_center/lnn/net_builder/include",
158    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include",
159    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/distributed_ledger/include",
160    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/local_ledger/include",
161    "$dsoftbus_root_path/core/bus_center/service/include",
162    "$dsoftbus_root_path/core/bus_center/utils/include",
163    "$dsoftbus_root_path/core/common/include",
164    "$dsoftbus_root_path/core/connection/wifi_direct_cpp",
165    "$dsoftbus_root_path/core/discovery/interface",
166    "$dsoftbus_root_path/core/discovery/manager/include",
167    "$dsoftbus_root_path/core/frame/init/include",
168    "$dsoftbus_root_path/interfaces/inner_kits/lnn",
169    "$dsoftbus_root_path/interfaces/inner_kits/transport",
170    "$dsoftbus_root_path/interfaces/kits/adapter",
171    "$dsoftbus_root_path/interfaces/kits/authentication",
172    "$dsoftbus_root_path/interfaces/kits/bus_center",
173    "$dsoftbus_root_path/interfaces/kits/disc",
174    "$dsoftbus_root_path/interfaces/kits/lnn",
175    "$dsoftbus_root_path/interfaces/kits/transport",
176    "$dsoftbus_root_path/tests/adapter/common/include",
177    "$dsoftbus_root_path/tests/core/bus_center/lnn/net_builder/include",
178    "$dsoftbus_root_path/tests/core/bus_center/test/mock/include",
179    "$dsoftbus_root_path/tests/interface/enhance",
180  ]
181
182  deps = [
183    "$dsoftbus_dfx_path:softbus_dfx",
184    "$dsoftbus_root_path/adapter:softbus_adapter",
185    "$dsoftbus_root_path/core/common:softbus_utils",
186  ]
187
188  if (is_standard_system) {
189    external_deps = [ "device_auth:deviceauth_sdk" ]
190  } else {
191    external_deps = [ "huks:libhukssdk" ]
192  }
193  external_deps += [
194    "c_utils:utils",
195    "googletest:gmock",
196    "googletest:gtest_main",
197    "hilog:libhilog",
198    "ipc:ipc_single",
199  ]
200}
201
202ohos_unittest("HeartBeatFSMTest") {
203  module_out_path = module_output_path
204  sources = [
205    "$dsoftbus_root_path/core/adapter/bus_center/src/lnn_deviceinfo_to_profile_virtual.c",
206    "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/src/lnn_heartbeat_utils.c",
207    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/src/lnn_feature_capability.c",
208    "$dsoftbus_root_path/core/bus_center/service/src/bus_center_manager.c",
209    "$dsoftbus_root_path/core/bus_center/utils/src/lnn_state_machine.c",
210    "$dsoftbus_root_path/tests/core/bus_center/lnn/net_builder/src/lnn_net_ledger_mock.cpp",
211    "$dsoftbus_root_path/tests/core/bus_center/mock_common/src/distribute_net_ledger_mock.cpp",
212    "$dsoftbus_root_path/tests/core/bus_center/mock_common/src/lnn_connection_mock.cpp",
213    "$dsoftbus_root_path/tests/core/bus_center/test/heartbeat/hb_fsm_test.cpp",
214    "$dsoftbus_root_path/tests/core/bus_center/test/mock/src/hb_fsm_mock.cpp",
215    "$dsoftbus_root_path/core/frame/init/src/g_enhance_lnn_func_pack.c",
216    "$dsoftbus_root_path/core/frame/init/src/g_enhance_lnn_func.c",
217  ]
218
219  include_dirs = [
220    "$dsoftbus_dfx_path/interface/include/form",
221    "$dsoftbus_dfx_path/interface/include/legacy",
222    "$dsoftbus_root_path/adapter/common/include",
223    "$dsoftbus_root_path/core/adapter/bus_center/include",
224    "$dsoftbus_root_path/core/authentication/include",
225    "$dsoftbus_root_path/core/authentication/interface",
226    "$dsoftbus_root_path/core/bus_center/interface",
227    "$dsoftbus_root_path/core/bus_center/lnn/decision_center/include",
228    "$dsoftbus_root_path/core/bus_center/lnn/disc_mgr/include",
229    "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/common/include",
230    "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/include",
231    "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/src",
232    "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/include",
233    "$dsoftbus_root_path/core/bus_center/lnn/meta_node/include",
234    "$dsoftbus_root_path/core/bus_center/lnn/net_builder/include",
235    "$dsoftbus_root_path/core/bus_center/lnn/net_buscenter/include",
236    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include",
237    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/distributed_ledger/include",
238    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/local_ledger/include",
239    "$dsoftbus_root_path/core/bus_center/monitor/include",
240    "$dsoftbus_root_path/core/bus_center/service/include",
241    "$dsoftbus_root_path/core/bus_center/utils/include",
242    "$dsoftbus_root_path/core/common/include",
243    "$dsoftbus_root_path/core/connection/interface",
244    "$dsoftbus_root_path/core/connection/p2p/common/include",
245    "$dsoftbus_root_path/core/connection/p2p/interface",
246    "$dsoftbus_root_path/core/connection/wifi_direct_cpp",
247    "$dsoftbus_root_path/core/core/discovery/manager/include",
248    "$dsoftbus_root_path/core/discovery/interface",
249    "$dsoftbus_root_path/core/discovery/manager/include",
250    "$dsoftbus_root_path/core/frame/init/include",
251    "$dsoftbus_root_path/interfaces/inner_kits/lnn",
252    "$dsoftbus_root_path/interfaces/inner_kits/transport",
253    "$dsoftbus_root_path/interfaces/kits/adapter",
254    "$dsoftbus_root_path/interfaces/kits/authentication",
255    "$dsoftbus_root_path/interfaces/kits/bus_center",
256    "$dsoftbus_root_path/interfaces/kits/connect",
257    "$dsoftbus_root_path/interfaces/kits/disc",
258    "$dsoftbus_root_path/interfaces/kits/discovery",
259    "$dsoftbus_root_path/interfaces/kits/lnn",
260    "$dsoftbus_root_path/interfaces/kits/transport",
261    "$dsoftbus_root_path/tests/core/bus_center/lnn/net_builder/include",
262    "$dsoftbus_root_path/tests/core/bus_center/mock_common/include",
263    "$dsoftbus_root_path/tests/core/bus_center/test/mock/include",
264  ]
265
266  deps = [
267    "$dsoftbus_dfx_path:softbus_dfx",
268    "$dsoftbus_root_path/adapter:softbus_adapter",
269    "$dsoftbus_root_path/core/common:softbus_utils",
270  ]
271
272  if (is_standard_system) {
273    external_deps = [
274      "c_utils:utils",
275      "device_auth:deviceauth_sdk",
276      "googletest:gmock",
277      "googletest:gtest_main",
278      "hilog:libhilog",
279      "ipc:ipc_single",
280    ]
281  } else {
282    external_deps = [
283      "c_utils:utils",
284      "googletest:gmock",
285      "googletest:gtest_main",
286      "hilog:libhilog",
287      "huks:libhukssdk",
288      "ipc:ipc_single",
289    ]
290  }
291}
292
293ohos_unittest("HeartBeatStrategyTest") {
294  module_out_path = module_output_path
295  if (dsoftbus_feature_lnn_ble) {
296    cflags = [ "-DENABLE_FEATURE_LNN_BLE" ]
297  }
298  sources = [
299    "$dsoftbus_root_path/tests/core/bus_center/test/heartbeat/hb_strategy_test.cpp",
300    "$dsoftbus_root_path/tests/core/bus_center/test/mock/src/hb_fsm_strategy_mock.cpp",
301  ]
302
303  include_dirs = [
304    "$dsoftbus_dfx_path/interface/include/form",
305    "$dsoftbus_root_path/adapter/common/include",
306    "$dsoftbus_root_path/core/adapter/bus_center/include",
307    "$dsoftbus_root_path/core/authentication/interface",
308    "$dsoftbus_root_path/core/bus_center/interface",
309    "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/include",
310    "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/src",
311    "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/include",
312    "$dsoftbus_root_path/core/bus_center/lnn/net_builder/include",
313    "$dsoftbus_root_path/core/bus_center/lnn/net_buscenter/include",
314    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include",
315    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/distributed_ledger/include",
316    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/local_ledger/include",
317    "$dsoftbus_root_path/core/bus_center/service/include",
318    "$dsoftbus_root_path/core/bus_center/utils/include",
319    "$dsoftbus_root_path/core/common/include",
320    "$dsoftbus_root_path/core/discovery/interface",
321    "$dsoftbus_root_path/core/discovery/manager/include",
322    "$dsoftbus_root_path/interfaces/inner_kits/lnn",
323    "$dsoftbus_root_path/interfaces/kits/authentication",
324    "$dsoftbus_root_path/interfaces/kits/bus_center",
325    "$dsoftbus_root_path/interfaces/kits/disc",
326    "$dsoftbus_root_path/interfaces/kits/discovery",
327    "$dsoftbus_root_path/interfaces/kits/lnn",
328    "$dsoftbus_root_path/tests/core/bus_center/test/mock/include",
329    "$dsoftbus_root_path/tests/interface/enhance",
330  ]
331
332  deps = [
333    "$dsoftbus_dfx_path:softbus_dfx",
334    "$dsoftbus_root_path/adapter:softbus_adapter",
335    "$dsoftbus_root_path/core/common:softbus_utils",
336  ]
337
338  if (is_standard_system) {
339    external_deps = [
340      "device_auth:deviceauth_sdk",
341      "googletest:gmock",
342      "googletest:gtest_main",
343      "hilog:libhilog",
344    ]
345  } else {
346    external_deps = [
347      "googletest:gmock",
348      "googletest:gtest_main",
349      "hilog:libhilog",
350      "huks:libhukssdk",
351    ]
352  }
353  external_deps += [
354    "c_utils:utils",
355    "ipc:ipc_single",
356  ]
357}
358
359ohos_unittest("HeartBeatUtilsTest") {
360  module_out_path = module_output_path
361  sources = [
362    "$dsoftbus_root_path/core/adapter/bus_center/src/lnn_deviceinfo_to_profile_virtual.c",
363    "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/src/lnn_heartbeat_utils.c",
364    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/src/lnn_feature_capability.c",
365    "$dsoftbus_root_path/core/bus_center/utils/src/lnn_state_machine.c",
366    "$dsoftbus_root_path/tests/core/bus_center/lnn/net_builder/src/lnn_net_ledger_mock.cpp",
367    "$dsoftbus_root_path/tests/core/bus_center/mock_common/src/distribute_net_ledger_mock.cpp",
368    "$dsoftbus_root_path/tests/core/bus_center/mock_common/src/lnn_connection_mock.cpp",
369    "$dsoftbus_root_path/tests/core/bus_center/test/heartbeat/hb_utils_test.cpp",
370    "$dsoftbus_root_path/tests/core/bus_center/test/mock/src/hb_heartbeat_utils_mock.cpp",
371  ]
372
373  include_dirs = [
374    "$dsoftbus_dfx_path/interface/include/form",
375    "$dsoftbus_dfx_path/interface/include/legacy",
376    "$dsoftbus_root_path/adapter/common/include",
377    "$dsoftbus_root_path/core/adapter/bus_center/include",
378    "$dsoftbus_root_path/core/authentication/include",
379    "$dsoftbus_root_path/core/authentication/interface",
380    "$dsoftbus_root_path/core/bus_center/interface",
381    "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/include",
382    "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/src",
383    "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/include",
384    "$dsoftbus_root_path/core/bus_center/lnn/net_builder/include",
385    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include",
386    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/distributed_ledger/include",
387    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/local_ledger/include",
388    "$dsoftbus_root_path/core/bus_center/service/include",
389    "$dsoftbus_root_path/core/bus_center/utils/include",
390    "$dsoftbus_root_path/core/common/include",
391    "$dsoftbus_root_path/core/connection/interface",
392    "$dsoftbus_root_path/core/connection/p2p/common/include",
393    "$dsoftbus_root_path/core/connection/p2p/interface",
394    "$dsoftbus_root_path/core/connection/wifi_direct_cpp",
395    "$dsoftbus_root_path/core/core/discovery/manager/include",
396    "$dsoftbus_root_path/core/discovery/interface",
397    "$dsoftbus_root_path/core/discovery/manager/include",
398    "$dsoftbus_root_path/interfaces/inner_kits/lnn",
399    "$dsoftbus_root_path/interfaces/inner_kits/transport",
400    "$dsoftbus_root_path/interfaces/kits/adapter",
401    "$dsoftbus_root_path/interfaces/kits/authentication",
402    "$dsoftbus_root_path/interfaces/kits/bus_center",
403    "$dsoftbus_root_path/interfaces/kits/connect",
404    "$dsoftbus_root_path/interfaces/kits/disc",
405    "$dsoftbus_root_path/interfaces/kits/discovery",
406    "$dsoftbus_root_path/interfaces/kits/lnn",
407    "$dsoftbus_root_path/interfaces/kits/transport",
408    "$dsoftbus_root_path/tests/core/bus_center/lnn/net_builder/include",
409    "$dsoftbus_root_path/tests/core/bus_center/mock_common/include",
410    "$dsoftbus_root_path/tests/core/bus_center/test/mock/include",
411  ]
412
413  deps = [
414    "$dsoftbus_dfx_path:softbus_dfx",
415    "$dsoftbus_root_path/adapter:softbus_adapter",
416    "$dsoftbus_root_path/core/common:softbus_utils",
417  ]
418
419  if (is_standard_system) {
420    external_deps = [
421      "c_utils:utils",
422      "device_auth:deviceauth_sdk",
423      "googletest:gmock",
424      "googletest:gtest_main",
425      "hilog:libhilog",
426      "ipc:ipc_single",
427    ]
428  } else {
429    external_deps = [
430      "c_utils:utils",
431      "googletest:gmock",
432      "googletest:gtest_main",
433      "hilog:libhilog",
434      "huks:libhukssdk",
435      "ipc:ipc_single",
436    ]
437  }
438}
439
440ohos_unittest("HeartBeatCtrlTest") {
441  module_out_path = module_output_path
442  sources = [
443    "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/src/lnn_heartbeat_ctrl.c",
444    "$dsoftbus_root_path/core/bus_center/monitor/src/lnn_init_monitor.c",
445    "$dsoftbus_root_path/tests/core/bus_center/lnn/net_buscenter/lnn_ip_network_impl_mock.cpp",
446    "$dsoftbus_root_path/tests/core/bus_center/mock_common/src/distribute_net_ledger_mock.cpp",
447    "$dsoftbus_root_path/tests/core/bus_center/test/heartbeat/hb_ctrl_test.cpp",
448    "$dsoftbus_root_path/tests/core/bus_center/test/mock/src/hb_ctrl_deps_mock.cpp",
449    "$dsoftbus_root_path/tests/core/bus_center/test/mock/src/hb_strategy_mock.cpp",
450    "$dsoftbus_root_path/core/frame/init/src/g_enhance_lnn_func.c",
451  ]
452
453  include_dirs = [
454    "$dsoftbus_dfx_path/interface/include/form",
455    "$dsoftbus_dfx_path/interface/include/legacy",
456    "$dsoftbus_root_path/adapter/common/include",
457    "$dsoftbus_root_path/adapter/common/net/bluetooth/broadcast/interface",
458    "$dsoftbus_root_path/adapter/common/net/bluetooth/include",
459    "$dsoftbus_root_path/core/adapter/bus_center/include",
460    "$dsoftbus_root_path/core/authentication/include",
461    "$dsoftbus_root_path/core/authentication/interface",
462    "$dsoftbus_root_path/core/bus_center/interface",
463    "$dsoftbus_root_path/core/bus_center/ipc/include",
464    "$dsoftbus_root_path/core/bus_center/lnn/decision_center/include",
465    "$dsoftbus_root_path/core/bus_center/lnn/disc_mgr/include",
466    "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/include",
467    "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/src",
468    "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/include",
469    "$dsoftbus_root_path/core/bus_center/lnn/net_builder/include",
470    "$dsoftbus_root_path/core/bus_center/lnn/net_buscenter/include",
471    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include",
472    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/decision_db/include",
473    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/distributed_ledger/include",
474    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/local_ledger/include",
475    "$dsoftbus_root_path/core/bus_center/monitor/include",
476    "$dsoftbus_root_path/core/bus_center/service/include",
477    "$dsoftbus_root_path/core/bus_center/utils/include",
478    "$dsoftbus_root_path/core/common/include",
479    "$dsoftbus_root_path/core/connection/p2p/common/include",
480    "$dsoftbus_root_path/core/connection/p2p/interface",
481    "$dsoftbus_root_path/core/connection/wifi_direct_cpp",
482    "$dsoftbus_root_path/core/core/discovery/manager/include",
483    "$dsoftbus_root_path/core/discovery/interface",
484    "$dsoftbus_root_path/core/discovery/manager/include",
485    "$dsoftbus_root_path/core/frame/init/include",
486    "$dsoftbus_root_path/interfaces/inner_kits/lnn",
487    "$dsoftbus_root_path/interfaces/inner_kits/transport",
488    "$dsoftbus_root_path/interfaces/kits/adapter",
489    "$dsoftbus_root_path/interfaces/kits/authentication",
490    "$dsoftbus_root_path/interfaces/kits/bus_center",
491    "$dsoftbus_root_path/interfaces/kits/disc",
492    "$dsoftbus_root_path/interfaces/kits/discovery",
493    "$dsoftbus_root_path/interfaces/kits/lnn",
494    "$dsoftbus_root_path/interfaces/kits/transport",
495    "$dsoftbus_root_path/tests/core/bus_center/lnn/net_builder/include",
496    "$dsoftbus_root_path/tests/core/bus_center/lnn/net_builder/mock",
497    "$dsoftbus_root_path/tests/core/bus_center/lnn/net_buscenter",
498    "$dsoftbus_root_path/tests/core/bus_center/mock_common/include",
499    "$dsoftbus_root_path/tests/core/bus_center/test/mock/include",
500  ]
501
502  deps = [
503    "$dsoftbus_dfx_path:softbus_dfx",
504    "$dsoftbus_root_path/adapter:softbus_adapter",
505    "$dsoftbus_root_path/core/common:softbus_utils",
506    "$dsoftbus_root_path/core/frame:softbus_server",
507  ]
508
509  if (is_standard_system) {
510    external_deps = [
511      "device_auth:deviceauth_sdk",
512      "googletest:gmock",
513      "googletest:gtest_main",
514      "hilog:libhilog",
515    ]
516  } else {
517    external_deps = [
518      "googletest:gmock",
519      "googletest:gtest_main",
520      "hilog:libhilog",
521      "huks:libhukssdk",
522    ]
523  }
524  external_deps += [
525    "c_utils:utils",
526    "ipc:ipc_single",
527  ]
528}
529
530ohos_unittest("ClientProxyTest") {
531  module_out_path = "dsoftbus/soft_bus/bus_center"
532  sources = [
533    "$dsoftbus_root_path/tests/core/bus_center/test/ipc/client_proxy_test.cpp",
534  ]
535
536  include_dirs = [
537    "$dsoftbus_root_path/adapter/common/include",
538    "$dsoftbus_root_path/core/bus_center/ipc/standard/include",
539    "$dsoftbus_root_path/core/common/include",
540    "$dsoftbus_root_path/core/frame/common/include",
541    "$dsoftbus_root_path/core/frame/standard/client_manager/include",
542    "$dsoftbus_root_path/core/frame/standard/init/include",
543    "$dsoftbus_root_path/interfaces/kits/discovery",
544    "$dsoftbus_root_path/interfaces/kits/transport",
545    "$dsoftbus_root_path/sdk/frame/standard/include",
546  ]
547
548  deps = [
549    "$dsoftbus_dfx_path:softbus_dfx",
550    "$dsoftbus_root_path/adapter:softbus_adapter",
551    "$dsoftbus_root_path/core/common:softbus_utils",
552    "$dsoftbus_root_path/core/frame:softbus_server",
553  ]
554
555  if (is_standard_system) {
556    external_deps = [
557      "c_utils:utils",
558      "device_auth:deviceauth_sdk",
559      "dsoftbus:softbus_client",
560      "googletest:gmock",
561      "googletest:gtest_main",
562      "hilog:libhilog",
563      "ipc:ipc_single",
564      "samgr:samgr_proxy",
565    ]
566  } else {
567    external_deps = [
568      "c_utils:utils",
569      "dsoftbus:softbus_client",
570      "googletest:gmock",
571      "googletest:gtest_main",
572      "hilog:libhilog",
573      "huks:libhukssdk",
574      "ipc:ipc_single",
575      "samgr:samgr_proxy",
576    ]
577  }
578}
579
580ohos_unittest("BusCenterIpcTest") {
581  module_out_path = module_output_path
582  sources = [
583    "$dsoftbus_root_path/core/frame/common/src/softbus_ddos.c",
584    "$dsoftbus_root_path/tests/core/bus_center/test/ipc/bus_center_ipc_test.cpp",
585    "$dsoftbus_root_path/tests/core/bus_center/test/mock/src/bus_center_ipc_mock.cpp",
586  ]
587
588  include_dirs = [
589    "$dsoftbus_dfx_path/interface/include/form",
590    "$dsoftbus_root_path/core/authentication/interface",
591    "$dsoftbus_root_path/core/bus_center/interface",
592    "$dsoftbus_root_path/core/bus_center/ipc/include",
593    "$dsoftbus_root_path/core/bus_center/ipc/standard/include",
594    "$dsoftbus_root_path/core/bus_center/ipc/standard/src",
595    "$dsoftbus_root_path/core/bus_center/lnn/decision_center/include",
596    "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/include",
597    "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/include",
598    "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/time_sync/include",
599    "$dsoftbus_root_path/core/bus_center/lnn/meta_node/include",
600    "$dsoftbus_root_path/core/bus_center/lnn/net_builder/include",
601    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include",
602    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/distributed_ledger/include",
603    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/local_ledger/include",
604    "$dsoftbus_root_path/core/bus_center/service/include",
605    "$dsoftbus_root_path/core/bus_center/utils/include",
606    "$dsoftbus_root_path/core/common/include",
607    "$dsoftbus_root_path/core/discovery/interface",
608    "$dsoftbus_root_path/core/discovery/manager/include",
609    "$dsoftbus_root_path/core/frame/common/include",
610    "$dsoftbus_root_path/interfaces/inner_kits/lnn",
611    "$dsoftbus_root_path/interfaces/inner_kits/transport",
612    "$dsoftbus_root_path/interfaces/kits/authentication",
613    "$dsoftbus_root_path/interfaces/kits/bus_center",
614    "$dsoftbus_root_path/interfaces/kits/disc",
615    "$dsoftbus_root_path/interfaces/kits/discovery",
616    "$dsoftbus_root_path/interfaces/kits/lnn",
617    "$dsoftbus_root_path/tests/core/bus_center/test/mock/include",
618  ]
619
620  deps = [
621    "$dsoftbus_dfx_path:softbus_dfx",
622    "$dsoftbus_root_path/adapter:softbus_adapter",
623    "$dsoftbus_root_path/core/common:softbus_utils",
624  ]
625
626  if (is_standard_system) {
627    external_deps = [
628      "c_utils:utils",
629      "device_auth:deviceauth_sdk",
630      "googletest:gmock",
631      "googletest:gtest_main",
632      "hilog:libhilog",
633      "ipc:ipc_single",
634    ]
635  } else {
636    external_deps = [
637      "c_utils:utils",
638      "googletest:gmock",
639      "googletest:gtest_main",
640      "hilog:libhilog",
641      "huks:libhukssdk",
642      "ipc:ipc_single",
643    ]
644  }
645}
646
647ohos_unittest("HeartBeatCtrlStaticTest") {
648  module_out_path = module_output_path
649  sources = [
650    "$dsoftbus_root_path/core/bus_center/lnn/net_builder/src/lnn_net_builder.c",
651    "$dsoftbus_root_path/core/bus_center/lnn/net_builder/src/lnn_net_builder_init.c",
652    "$dsoftbus_root_path/core/bus_center/lnn/net_builder/src/lnn_net_builder_process.c",
653    "$dsoftbus_root_path/tests/core/bus_center/lnn/net_builder/src/lnn_net_ledger_mock.cpp",
654    "$dsoftbus_root_path/tests/core/bus_center/test/heartbeat/hb_ctrl_static_test.cpp",
655    "$dsoftbus_root_path/tests/core/bus_center/test/mock/src/hb_ctrl_static_mock.cpp",
656    "$dsoftbus_root_path/tests/core/discovery/ble/softbus_ble_mock/ble_mock.cpp",
657    "$dsoftbus_root_path/core/frame/init/src/g_enhance_adapter_func.c",
658    "$dsoftbus_root_path/core/frame/init/src/g_enhance_adapter_func_pack.c",
659    "$dsoftbus_root_path/core/frame/init/src/g_enhance_lnn_func.c",
660    "$dsoftbus_root_path/core/frame/init/src/g_enhance_lnn_func_pack.c",
661  ]
662
663  include_dirs = [
664    "$dsoftbus_dfx_path/interface/include/form",
665    "$dsoftbus_dfx_path/interface/include/legacy",
666    "$dsoftbus_root_path/adapter/common/include",
667    "$dsoftbus_root_path/adapter/common/net/bluetooth/broadcast/interface",
668    "$dsoftbus_root_path/adapter/common/net/bluetooth/include",
669    "$dsoftbus_root_path/adapter/common/net/wifi/include",
670    "$dsoftbus_root_path/core/adapter/bus_center/include",
671    "$dsoftbus_root_path/core/authentication/include",
672    "$dsoftbus_root_path/core/authentication/interface",
673    "$dsoftbus_root_path/core/broadcast/common/include",
674    "$dsoftbus_root_path/core/bus_center/interface",
675    "$dsoftbus_root_path/core/bus_center/ipc/include",
676    "$dsoftbus_root_path/core/bus_center/lnn/decision_center/include",
677    "$dsoftbus_root_path/core/bus_center/lnn/disc_mgr/include",
678    "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/include",
679    "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/src",
680    "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/include",
681    "$dsoftbus_root_path/core/bus_center/lnn/net_builder/include",
682    "$dsoftbus_root_path/core/bus_center/lnn/net_buscenter/include",
683    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include",
684    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/decision_db/include",
685    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/distributed_ledger/include",
686    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/local_ledger/include",
687    "$dsoftbus_root_path/core/bus_center/monitor/include",
688    "$dsoftbus_root_path/core/bus_center/monitor/src",
689    "$dsoftbus_root_path/core/bus_center/service/include",
690    "$dsoftbus_root_path/core/bus_center/utils/include",
691    "$dsoftbus_root_path/core/common/include",
692    "$dsoftbus_root_path/core/connection/p2p/common/include",
693    "$dsoftbus_root_path/core/connection/p2p/interface",
694    "$dsoftbus_root_path/core/connection/wifi_direct_cpp",
695    "$dsoftbus_root_path/core/core/discovery/manager/include",
696    "$dsoftbus_root_path/core/discovery/ble/softbus_ble/include",
697    "$dsoftbus_root_path/core/discovery/interface",
698    "$dsoftbus_root_path/core/discovery/manager/include",
699    "$dsoftbus_root_path/core/frame/init/include",
700    "$dsoftbus_root_path/core/transmission/trans_channel/auth/include",
701    "$dsoftbus_root_path/core/transmission/trans_channel/manager/include",
702    "$dsoftbus_root_path/interfaces/inner_kits/lnn",
703    "$dsoftbus_root_path/interfaces/inner_kits/transport",
704    "$dsoftbus_root_path/interfaces/kits/adapter",
705    "$dsoftbus_root_path/interfaces/kits/authentication",
706    "$dsoftbus_root_path/interfaces/kits/bus_center",
707    "$dsoftbus_root_path/interfaces/kits/disc",
708    "$dsoftbus_root_path/interfaces/kits/discovery",
709    "$dsoftbus_root_path/interfaces/kits/lnn",
710    "$dsoftbus_root_path/interfaces/kits/transport",
711    "$dsoftbus_root_path/tests/core/bus_center/lnn/net_builder/include",
712    "$dsoftbus_root_path/tests/core/bus_center/lnn/net_builder/mock",
713    "$dsoftbus_root_path/tests/core/bus_center/lnn/net_buscenter",
714    "$dsoftbus_root_path/tests/core/bus_center/mock_common/include",
715    "$dsoftbus_root_path/tests/core/bus_center/test/mock/include",
716    "$dsoftbus_root_path/tests/core/discovery/ble/softbus_ble_mock",
717  ]
718
719  deps = [
720    "$dsoftbus_dfx_path:softbus_dfx",
721    "$dsoftbus_root_path/adapter:softbus_adapter",
722    "$dsoftbus_root_path/core/common:softbus_utils",
723  ]
724
725  if (is_standard_system) {
726    external_deps = [
727      "device_auth:deviceauth_sdk",
728      "googletest:gmock",
729      "googletest:gtest_main",
730      "hilog:libhilog",
731    ]
732  } else {
733    external_deps = [
734      "googletest:gmock",
735      "googletest:gtest_main",
736      "hilog:libhilog",
737      "huks:libhukssdk",
738    ]
739  }
740  external_deps += [
741    "c_utils:utils",
742    "ipc:ipc_single",
743  ]
744}
745
746ohos_unittest("BusCenterDecisionCenterTest") {
747  module_out_path = module_output_path
748  sources = [
749    "$dsoftbus_root_path/core/bus_center/lnn/net_builder/src/lnn_net_builder_init.c",
750    "$dsoftbus_root_path/core/bus_center/lnn/net_builder/src/lnn_net_builder_process.c",
751    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/src/lnn_node_info.c",
752    "$dsoftbus_root_path/core/bus_center/monitor/src/lnn_init_monitor.c",
753    "$dsoftbus_root_path/core/bus_center/service/src/bus_center_decision_center.c",
754    "$dsoftbus_root_path/tests/core/bus_center/lnn/net_builder/src/lnn_net_builder_mock.cpp",
755    "$dsoftbus_root_path/tests/core/bus_center/test/mock/src/bus_center_decision_center_mock.cpp",
756    "$dsoftbus_root_path/tests/core/bus_center/test/service/bus_center_decision_center_test.cpp",
757    "$dsoftbus_root_path/tests/core/discovery/ble/softbus_ble_mock/ble_mock.cpp",
758    "$dsoftbus_root_path/core/frame/init/src/g_enhance_lnn_func.c",
759    "$dsoftbus_root_path/core/frame/init/src/g_enhance_lnn_func_pack.c",
760  ]
761
762  include_dirs = [
763    "$dsoftbus_dfx_path/interface/include/form",
764    "$dsoftbus_dfx_path/interface/include/legacy",
765    "$dsoftbus_root_path/adapter/common/include",
766    "$dsoftbus_root_path/adapter/common/net/bluetooth/broadcast/interface",
767    "$dsoftbus_root_path/adapter/common/net/bluetooth/include",
768    "$dsoftbus_root_path/adapter/common/net/wifi/include",
769    "$dsoftbus_root_path/core/adapter/bus_center/include",
770    "$dsoftbus_root_path/core/authentication/include",
771    "$dsoftbus_root_path/core/authentication/interface",
772    "$dsoftbus_root_path/core/broadcast/common/include",
773    "$dsoftbus_root_path/core/bus_center/interface",
774    "$dsoftbus_root_path/core/bus_center/ipc/include",
775    "$dsoftbus_root_path/core/bus_center/lnn/decision_center/include",
776    "$dsoftbus_root_path/core/bus_center/lnn/disc_mgr/include",
777    "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/include",
778    "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/src",
779    "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/include",
780    "$dsoftbus_root_path/core/bus_center/lnn/net_builder/include",
781    "$dsoftbus_root_path/core/bus_center/lnn/net_buscenter/include",
782    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include",
783    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/decision_db/include",
784    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/distributed_ledger/include",
785    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/local_ledger/include",
786    "$dsoftbus_root_path/core/bus_center/monitor/include",
787    "$dsoftbus_root_path/core/bus_center/service/include",
788    "$dsoftbus_root_path/core/bus_center/utils/include",
789    "$dsoftbus_root_path/core/common/include",
790    "$dsoftbus_root_path/core/connection/p2p/common/include",
791    "$dsoftbus_root_path/core/connection/p2p/interface",
792    "$dsoftbus_root_path/core/connection/wifi_direct_cpp",
793    "$dsoftbus_root_path/core/core/discovery/manager/include",
794    "$dsoftbus_root_path/core/discovery/ble/softbus_ble/include",
795    "$dsoftbus_root_path/core/discovery/interface",
796    "$dsoftbus_root_path/core/discovery/manager/include",
797    "$dsoftbus_root_path/core/frame/init/include",
798    "$dsoftbus_root_path/core/transmission/trans_channel/manager/include",
799    "$dsoftbus_root_path/interfaces/inner_kits/lnn",
800    "$dsoftbus_root_path/interfaces/inner_kits/transport",
801    "$dsoftbus_root_path/interfaces/kits/adapter",
802    "$dsoftbus_root_path/interfaces/kits/authentication",
803    "$dsoftbus_root_path/interfaces/kits/broadcast",
804    "$dsoftbus_root_path/interfaces/kits/bus_center",
805    "$dsoftbus_root_path/interfaces/kits/disc",
806    "$dsoftbus_root_path/interfaces/kits/discovery",
807    "$dsoftbus_root_path/interfaces/kits/lnn",
808    "$dsoftbus_root_path/interfaces/kits/transport",
809    "$dsoftbus_root_path/tests/core/bus_center/lnn/net_builder/include",
810    "$dsoftbus_root_path/tests/core/bus_center/lnn/net_builder/mock",
811    "$dsoftbus_root_path/tests/core/bus_center/lnn/net_buscenter",
812    "$dsoftbus_root_path/tests/core/bus_center/mock_common/include",
813    "$dsoftbus_root_path/tests/core/bus_center/test/mock/include",
814    "$dsoftbus_root_path/tests/core/connection/interface",
815    "$dsoftbus_root_path/tests/core/discovery/ble/softbus_ble_mock",
816  ]
817
818  deps = [
819    "$dsoftbus_dfx_path:softbus_dfx",
820    "$dsoftbus_root_path/adapter:softbus_adapter",
821    "$dsoftbus_root_path/core/common:softbus_utils",
822  ]
823
824  if (is_standard_system) {
825    external_deps = [
826      "device_auth:deviceauth_sdk",
827      "googletest:gmock",
828      "googletest:gtest_main",
829      "hilog:libhilog",
830    ]
831  } else {
832    external_deps = [
833      "googletest:gmock",
834      "googletest:gtest_main",
835      "hilog:libhilog",
836      "huks:libhukssdk",
837    ]
838  }
839  external_deps += [
840    "c_utils:utils",
841    "ipc:ipc_single",
842  ]
843}
844
845group("unittest") {
846  testonly = true
847  deps = [
848    ":BusCenterDecisionCenterTest",
849    ":BusCenterIpcTest",
850    ":ClientProxyTest",
851    ":HeartBeatMediumStaticTest",
852  ]
853  if (dsoftbus_feature_lnn_ble) {
854    deps += [
855      ":HeartBeatCtrlStaticTest",
856      ":HeartBeatCtrlTest",
857      ":HeartBeatFSMTest",
858      ":HeartBeatMediumTest",
859      ":HeartBeatStrategyTest",
860      ":HeartBeatUtilsTest",
861    ]
862  }
863}
864