1# Copyright (C) 2021-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. 13import("//build/test.gni") 14import("//foundation/filemanagement/dfs_service/distributedfile.gni") 15 16module_output_path = "dfs_service/dfs_service_daemon/distributedfiledaemon" 17 18config("module_private_config") { 19 visibility = [ ":*" ] 20 21 include_dirs = [ 22 "${distributedfile_path}/frameworks/native/distributed_file_inner/include", 23 "${distributedfile_path}/test/mock", 24 "${services_path}/distributedfiledaemon/include", 25 "${services_path}/distributedfiledaemon/include/ipc", 26 ] 27} 28 29ohos_unittest("device_info_test") { 30 branch_protector_ret = "pac_ret" 31 sanitize = { 32 integer_overflow = true 33 cfi = true 34 cfi_cross_dso = true 35 debug = false 36 } 37 38 module_out_path = module_output_path 39 40 sources = 41 [ "${services_path}/distributedfiledaemon/src/device/device_info.cpp" ] 42 43 sources += [ "device/device_info_test.cpp" ] 44 45 configs = [ 46 ":module_private_config", 47 "${utils_path}:compiler_configs", 48 ] 49 50 deps = [ 51 "${utils_path}:libdistributedfileutils" 52 ] 53 54 external_deps = [ 55 "app_file_service:remote_file_share_native", 56 "c_utils:utils", 57 "device_manager:devicemanagersdk", 58 "googletest:gmock_main", 59 "googletest:gtest_main", 60 "hilog:libhilog", 61 "ipc:ipc_core", 62 ] 63 64 defines = [ "private=public" ] 65} 66 67ohos_unittest("device_manager_agent_sup_test") { 68 branch_protector_ret = "pac_ret" 69 sanitize = { 70 integer_overflow = true 71 cfi = true 72 cfi_cross_dso = true 73 debug = false 74 blocklist = "${distributedfile_path}/cfi_blocklist.txt" 75 } 76 77 module_out_path = module_output_path 78 79 include_dirs = [ "device/include/" ] 80 81 sources = [ 82 "${distributedfile_path}/test/mock/device_manager_impl_mock.cpp", 83 "${distributedfile_path}/test/mock/device_manager_mock.cpp", 84 "${distributedfile_path}/test/mock/softbus_bus_center_mock.cpp", 85 "device/device_manager_agent_sup_test.cpp", 86 "device/mock_other_method.cpp", 87 ] 88 89 configs = [ 90 ":module_private_config", 91 "${utils_path}:compiler_configs", 92 ] 93 94 deps = [ 95 "${services_path}/distributedfiledaemon:distributed_file_daemon_kit_inner", 96 "${services_path}/distributedfiledaemon:libdistributedfiledaemon", 97 "${utils_path}:libdistributedfileutils", 98 ] 99 100 external_deps = [ 101 "ability_base:want", 102 "ability_base:zuri", 103 "access_token:libaccesstoken_sdk", 104 "app_file_service:remote_file_share_native", 105 "app_file_service:sandbox_helper_native", 106 "c_utils:utils", 107 "common_event_service:cesfwk_innerkits", 108 "dataclassification:data_transit_mgr", 109 "device_auth:deviceauth_sdk", 110 "device_manager:devicemanagersdk", 111 "dsoftbus:softbus_client", 112 "eventhandler:libeventhandler", 113 "file_api:securitylabel", 114 "googletest:gmock_main", 115 "googletest:gtest_main", 116 "hilog:libhilog", 117 "hisysevent:libhisysevent", 118 "init:libbegetutil", 119 "ipc:ipc_single", 120 "os_account:os_account_innerkits", 121 "safwk:system_ability_fwk", 122 "samgr:samgr_proxy", 123 "storage_service:storage_manager_sa_proxy", 124 "zlib:shared_libz", 125 ] 126 127 defines = [ "private=public" ] 128 129 if (support_same_account) { 130 defines += [ "SUPPORT_SAME_ACCOUNT" ] 131 } 132} 133 134ohos_unittest("device_manager_agent_test") { 135 branch_protector_ret = "pac_ret" 136 sanitize = { 137 integer_overflow = true 138 cfi = true 139 cfi_cross_dso = true 140 debug = false 141 blocklist = "${distributedfile_path}/cfi_blocklist.txt" 142 } 143 144 module_out_path = module_output_path 145 146 sources = [ 147 "${distributedfile_path}/test/mock/device_manager_impl_mock.cpp", 148 "${distributedfile_path}/test/mock/device_manager_mock.cpp", 149 "${distributedfile_path}/test/mock/softbus_bus_center_mock.cpp", 150 "device/device_manager_agent_test.cpp", 151 ] 152 153 configs = [ 154 ":module_private_config", 155 "${utils_path}:compiler_configs", 156 ] 157 158 deps = [ 159 "${services_path}/distributedfiledaemon:distributed_file_daemon_kit_inner", 160 "${services_path}/distributedfiledaemon:libdistributedfiledaemon", 161 "${utils_path}:libdistributedfileutils", 162 ] 163 164 external_deps = [ 165 "ability_base:want", 166 "ability_base:zuri", 167 "access_token:libaccesstoken_sdk", 168 "app_file_service:remote_file_share_native", 169 "app_file_service:sandbox_helper_native", 170 "c_utils:utils", 171 "common_event_service:cesfwk_innerkits", 172 "dataclassification:data_transit_mgr", 173 "device_auth:deviceauth_sdk", 174 "device_manager:devicemanagersdk", 175 "dsoftbus:softbus_client", 176 "eventhandler:libeventhandler", 177 "file_api:securitylabel", 178 "googletest:gmock_main", 179 "googletest:gtest_main", 180 "hilog:libhilog", 181 "hisysevent:libhisysevent", 182 "init:libbegetutil", 183 "ipc:ipc_single", 184 "os_account:os_account_innerkits", 185 "safwk:system_ability_fwk", 186 "samgr:samgr_proxy", 187 "storage_service:storage_manager_sa_proxy", 188 "zlib:shared_libz", 189 ] 190 191 defines = [ "private=public" ] 192 193 if (support_same_account) { 194 defines += [ "SUPPORT_SAME_ACCOUNT" ] 195 } 196} 197 198ohos_unittest("os_account_observer_test") { 199 branch_protector_ret = "pac_ret" 200 sanitize = { 201 integer_overflow = true 202 cfi = true 203 cfi_cross_dso = true 204 debug = false 205 } 206 207 module_out_path = module_output_path 208 209 include_dirs = [ "${services_path}/distributedfiledaemon/test/mock/include/" ] 210 211 sources = [ 212 "${services_path}/distributedfiledaemon/test/mock/device_manager_agent_mock.cpp", 213 "multiuser/os_account_observer_test.cpp", 214 ] 215 216 configs = [ 217 ":module_private_config", 218 "${utils_path}:compiler_configs", 219 ] 220 221 deps = [ 222 "${services_path}/distributedfiledaemon:distributed_file_daemon_kit_inner", 223 "${services_path}/distributedfiledaemon:libdistributedfiledaemon", 224 "${utils_path}:libdistributedfileutils", 225 ] 226 227 external_deps = [ 228 "ability_base:want", 229 "ability_base:zuri", 230 "access_token:libaccesstoken_sdk", 231 "app_file_service:remote_file_share_native", 232 "app_file_service:sandbox_helper_native", 233 "c_utils:utils", 234 "common_event_service:cesfwk_innerkits", 235 "dataclassification:data_transit_mgr", 236 "device_auth:deviceauth_sdk", 237 "device_manager:devicemanagersdk", 238 "dsoftbus:softbus_client", 239 "eventhandler:libeventhandler", 240 "file_api:securitylabel", 241 "googletest:gmock_main", 242 "googletest:gtest_main", 243 "hilog:libhilog", 244 "hisysevent:libhisysevent", 245 "init:libbegetutil", 246 "ipc:ipc_single", 247 "os_account:os_account_innerkits", 248 "safwk:system_ability_fwk", 249 "samgr:samgr_proxy", 250 "storage_service:storage_manager_sa_proxy", 251 "zlib:shared_libz", 252 ] 253 254 defines = [ "private=public" ] 255 if (support_same_account) { 256 defines += [ "SUPPORT_SAME_ACCOUNT" ] 257 } 258} 259 260ohos_unittest("devsl_dispatcher_test") { 261 branch_protector_ret = "pac_ret" 262 sanitize = { 263 integer_overflow = true 264 cfi = true 265 cfi_cross_dso = true 266 debug = false 267 } 268 269 module_out_path = module_output_path 270 271 sources = [ "network/devsl_dispatcher_test.cpp" ] 272 273 configs = [ 274 ":module_private_config", 275 "${utils_path}:compiler_configs", 276 ] 277 278 deps = [ 279 "${services_path}/distributedfiledaemon:distributed_file_daemon_kit_inner", 280 "${services_path}/distributedfiledaemon:libdistributedfiledaemon", 281 "${utils_path}:libdistributedfileutils", 282 ] 283 284 external_deps = [ 285 "ability_base:want", 286 "ability_base:zuri", 287 "access_token:libaccesstoken_sdk", 288 "app_file_service:sandbox_helper_native", 289 "c_utils:utils", 290 "common_event_service:cesfwk_innerkits", 291 "dataclassification:data_transit_mgr", 292 "device_auth:deviceauth_sdk", 293 "device_manager:devicemanagersdk", 294 "dsoftbus:softbus_client", 295 "eventhandler:libeventhandler", 296 "file_api:securitylabel", 297 "googletest:gmock_main", 298 "googletest:gtest_main", 299 "hilog:libhilog", 300 "hisysevent:libhisysevent", 301 "init:libbegetutil", 302 "ipc:ipc_single", 303 "os_account:os_account_innerkits", 304 "safwk:system_ability_fwk", 305 "samgr:samgr_proxy", 306 "storage_service:storage_manager_sa_proxy", 307 "zlib:shared_libz", 308 ] 309 310 defines = [ "private=public" ] 311 312 if (support_same_account) { 313 defines += [ "SUPPORT_SAME_ACCOUNT" ] 314 } 315} 316 317ohos_unittest("kernel_talker_test") { 318 branch_protector_ret = "pac_ret" 319 sanitize = { 320 integer_overflow = true 321 cfi = true 322 cfi_cross_dso = true 323 debug = false 324 } 325 326 module_out_path = module_output_path 327 328 sources = [ "network/kernel_talker_test.cpp" ] 329 330 configs = [ 331 ":module_private_config", 332 "${utils_path}:compiler_configs", 333 ] 334 335 deps = [ 336 "${services_path}/distributedfiledaemon:distributed_file_daemon_kit_inner", 337 "${services_path}/distributedfiledaemon:libdistributedfiledaemon", 338 "${utils_path}:libdistributedfileutils", 339 ] 340 341 external_deps = [ 342 "ability_base:want", 343 "ability_base:zuri", 344 "access_token:libaccesstoken_sdk", 345 "app_file_service:sandbox_helper_native", 346 "c_utils:utils", 347 "common_event_service:cesfwk_innerkits", 348 "dataclassification:data_transit_mgr", 349 "device_auth:deviceauth_sdk", 350 "device_manager:devicemanagersdk", 351 "dsoftbus:softbus_client", 352 "eventhandler:libeventhandler", 353 "file_api:securitylabel", 354 "googletest:gmock_main", 355 "googletest:gtest_main", 356 "hilog:libhilog", 357 "hisysevent:libhisysevent", 358 "init:libbegetutil", 359 "ipc:ipc_single", 360 "os_account:os_account_innerkits", 361 "safwk:system_ability_fwk", 362 "samgr:samgr_proxy", 363 "storage_service:storage_manager_sa_proxy", 364 "zlib:shared_libz", 365 ] 366 367 defines = [ "private=public" ] 368 369 if (support_same_account) { 370 defines += [ "SUPPORT_SAME_ACCOUNT" ] 371 } 372} 373 374ohos_unittest("session_pool_test") { 375 branch_protector_ret = "pac_ret" 376 sanitize = { 377 integer_overflow = true 378 cfi = true 379 cfi_cross_dso = true 380 debug = false 381 } 382 383 module_out_path = module_output_path 384 385 sources = [ "network/session_pool_test.cpp" ] 386 387 configs = [ 388 ":module_private_config", 389 "${utils_path}:compiler_configs", 390 ] 391 392 deps = [ 393 "${services_path}/distributedfiledaemon:distributed_file_daemon_kit_inner", 394 "${services_path}/distributedfiledaemon:libdistributedfiledaemon", 395 "${utils_path}:libdistributedfileutils", 396 ] 397 398 external_deps = [ 399 "ability_base:want", 400 "ability_base:zuri", 401 "access_token:libaccesstoken_sdk", 402 "app_file_service:sandbox_helper_native", 403 "c_utils:utils", 404 "common_event_service:cesfwk_innerkits", 405 "dataclassification:data_transit_mgr", 406 "device_auth:deviceauth_sdk", 407 "device_manager:devicemanagersdk", 408 "dsoftbus:softbus_client", 409 "eventhandler:libeventhandler", 410 "file_api:securitylabel", 411 "googletest:gmock_main", 412 "googletest:gtest_main", 413 "hilog:libhilog", 414 "hisysevent:libhisysevent", 415 "init:libbegetutil", 416 "ipc:ipc_single", 417 "os_account:os_account_innerkits", 418 "safwk:system_ability_fwk", 419 "samgr:samgr_proxy", 420 "storage_service:storage_manager_sa_proxy", 421 "zlib:shared_libz", 422 ] 423 424 defines = [ "private=public" ] 425 426 if (support_same_account) { 427 defines += [ "SUPPORT_SAME_ACCOUNT" ] 428 } 429} 430 431ohos_unittest("softbus_agent_test") { 432 branch_protector_ret = "pac_ret" 433 sanitize = { 434 integer_overflow = true 435 cfi = true 436 cfi_cross_dso = true 437 debug = false 438 blocklist = "${distributedfile_path}/cfi_blocklist.txt" 439 } 440 441 module_out_path = module_output_path 442 443 include_dirs = [ "${services_path}/distributedfiledaemon/test/mock/include/" ] 444 445 sources = [ 446 "${distributedfile_path}/test/mock/device_manager_impl_mock.cpp", 447 "${distributedfile_path}/test/mock/device_manager_mock.cpp", 448 "${distributedfile_path}/test/mock/socket_mock.cpp", 449 "${services_path}/distributedfiledaemon/test/mock/device_manager_agent_mock.cpp", 450 "network/softbus/softbus_agent_test.cpp", 451 ] 452 453 configs = [ 454 ":module_private_config", 455 "${utils_path}:compiler_configs", 456 ] 457 458 deps = [ 459 "${services_path}/distributedfiledaemon:distributed_file_daemon_kit_inner", 460 "${services_path}/distributedfiledaemon:libdistributedfiledaemon", 461 "${utils_path}:libdistributedfileutils", 462 ] 463 464 external_deps = [ 465 "ability_base:want", 466 "ability_base:zuri", 467 "access_token:libaccesstoken_sdk", 468 "app_file_service:remote_file_share_native", 469 "app_file_service:sandbox_helper_native", 470 "c_utils:utils", 471 "common_event_service:cesfwk_innerkits", 472 "dataclassification:data_transit_mgr", 473 "device_auth:deviceauth_sdk", 474 "device_manager:devicemanagersdk", 475 "dsoftbus:softbus_client", 476 "eventhandler:libeventhandler", 477 "file_api:securitylabel", 478 "googletest:gmock_main", 479 "googletest:gtest_main", 480 "hilog:libhilog", 481 "hisysevent:libhisysevent", 482 "init:libbegetutil", 483 "ipc:ipc_single", 484 "os_account:os_account_innerkits", 485 "safwk:system_ability_fwk", 486 "samgr:samgr_proxy", 487 "storage_service:storage_manager_sa_proxy", 488 "zlib:shared_libz", 489 ] 490 491 defines = [ 492 "private=public", 493 "protected=public", 494 "NORMAL_MOCK", 495 ] 496 497 if (support_same_account) { 498 defines += [ "SUPPORT_SAME_ACCOUNT" ] 499 } 500} 501 502ohos_unittest("softbus_agent_sup_test") { 503 branch_protector_ret = "pac_ret" 504 sanitize = { 505 integer_overflow = true 506 cfi = true 507 cfi_cross_dso = true 508 debug = false 509 blocklist = "${distributedfile_path}/cfi_blocklist.txt" 510 } 511 512 module_out_path = module_output_path 513 514 include_dirs = [ "${services_path}/distributedfiledaemon/test/mock/include/" ] 515 516 sources = [ 517 "${distributedfile_path}/test/mock/device_manager_impl_mock.cpp", 518 "${services_path}/distributedfiledaemon/test/mock/device_manager_agent_mock.cpp", 519 "network/softbus/softbus_agent_sup_test.cpp", 520 ] 521 522 configs = [ 523 ":module_private_config", 524 "${utils_path}:compiler_configs", 525 ] 526 527 deps = [ 528 "${services_path}/distributedfiledaemon:distributed_file_daemon_kit_inner", 529 "${services_path}/distributedfiledaemon:libdistributedfiledaemon", 530 "${utils_path}:libdistributedfileutils", 531 ] 532 533 external_deps = [ 534 "ability_base:want", 535 "ability_base:zuri", 536 "access_token:libaccesstoken_sdk", 537 "app_file_service:remote_file_share_native", 538 "app_file_service:sandbox_helper_native", 539 "c_utils:utils", 540 "common_event_service:cesfwk_innerkits", 541 "dataclassification:data_transit_mgr", 542 "device_auth:deviceauth_sdk", 543 "device_manager:devicemanagersdk", 544 "dsoftbus:softbus_client", 545 "eventhandler:libeventhandler", 546 "file_api:securitylabel", 547 "googletest:gmock_main", 548 "googletest:gtest_main", 549 "hilog:libhilog", 550 "hisysevent:libhisysevent", 551 "init:libbegetutil", 552 "ipc:ipc_single", 553 "os_account:os_account_innerkits", 554 "safwk:system_ability_fwk", 555 "samgr:samgr_proxy", 556 "storage_service:storage_manager_sa_proxy", 557 "zlib:shared_libz", 558 ] 559 560 defines = [ 561 "private=public", 562 "protected=public", 563 "NORMAL_MOCK", 564 ] 565 566 if (support_same_account) { 567 defines += [ "SUPPORT_SAME_ACCOUNT" ] 568 } 569} 570 571ohos_unittest("softbus_file_receive_listener_test") { 572 branch_protector_ret = "pac_ret" 573 sanitize = { 574 integer_overflow = true 575 cfi = true 576 cfi_cross_dso = true 577 debug = false 578 } 579 580 module_out_path = module_output_path 581 582 include_dirs = [ 583 "${distributedfile_path}/services/distributedfiledaemon/include/ipc", 584 "${distributedfile_path}/services/distributedfiledaemon/include/network/softbus", 585 "${distributedfile_path}/services/distributedfiledaemon/test/mock/include", 586 ] 587 588 sources = [ 589 "${services_path}/distributedfiledaemon/test/mock/all_connect_manager_mock.cpp", 590 "network/softbus/softbus_file_receive_listener_test.cpp", 591 ] 592 593 configs = [ 594 ":module_private_config", 595 "${utils_path}:compiler_configs", 596 ] 597 598 deps = [ 599 "${services_path}/distributedfiledaemon:libdistributedfiledaemon", 600 "${utils_path}:libdistributedfileutils", 601 ] 602 603 external_deps = [ 604 "app_file_service:sandbox_helper_native", 605 "c_utils:utils", 606 "dataclassification:data_transit_mgr", 607 "device_manager:devicemanagersdk", 608 "dsoftbus:softbus_client", 609 "googletest:gmock_main", 610 "googletest:gtest_main", 611 "hilog:libhilog", 612 "hisysevent:libhisysevent", 613 "os_account:os_account_innerkits", 614 ] 615 616 defines = [ "private=public" ] 617 618 if (support_same_account) { 619 defines += [ "SUPPORT_SAME_ACCOUNT" ] 620 } 621} 622 623ohos_unittest("softbus_file_send_listener_test") { 624 branch_protector_ret = "pac_ret" 625 sanitize = { 626 integer_overflow = true 627 cfi = true 628 cfi_cross_dso = true 629 debug = false 630 } 631 632 module_out_path = module_output_path 633 634 include_dirs = [ 635 "${distributedfile_path}/services/distributedfiledaemon/include/ipc", 636 "${distributedfile_path}/services/distributedfiledaemon/include/network/softbus", 637 "${distributedfile_path}/services/distributedfiledaemon/test/mock/include", 638 ] 639 640 sources = [ 641 "${services_path}/distributedfiledaemon/test/mock/all_connect_manager_mock.cpp", 642 "network/softbus/softbus_file_send_listener_test.cpp", 643 ] 644 645 configs = [ 646 ":module_private_config", 647 "${utils_path}:compiler_configs", 648 ] 649 650 deps = [ 651 "${services_path}/distributedfiledaemon:libdistributedfiledaemon", 652 "${utils_path}:libdistributedfileutils", 653 ] 654 655 external_deps = [ 656 "app_file_service:sandbox_helper_native", 657 "c_utils:utils", 658 "dataclassification:data_transit_mgr", 659 "device_manager:devicemanagersdk", 660 "dsoftbus:softbus_client", 661 "googletest:gmock_main", 662 "googletest:gtest_main", 663 "hilog:libhilog", 664 "hisysevent:libhisysevent", 665 "os_account:os_account_innerkits", 666 ] 667 668 defines = [ "private=public" ] 669 670 if (support_same_account) { 671 defines += [ "SUPPORT_SAME_ACCOUNT" ] 672 } 673} 674 675ohos_unittest("softbus_session_dispatcher_test") { 676 branch_protector_ret = "pac_ret" 677 sanitize = { 678 integer_overflow = true 679 cfi = true 680 cfi_cross_dso = true 681 debug = false 682 } 683 684 module_out_path = module_output_path 685 686 include_dirs = [ 687 "${distributedfile_path}/services/distributedfiledaemon/test/unittest/device/include" 688 ] 689 690 sources = [ 691 "network/softbus/softbus_session_dispatcher_test.cpp", 692 "${distributedfile_path}/test/mock/device_manager_impl_mock.cpp", 693 ] 694 695 configs = [ 696 ":module_private_config", 697 "${utils_path}:compiler_configs", 698 ] 699 700 deps = [ 701 "${services_path}/distributedfiledaemon:distributed_file_daemon_kit_inner", 702 "${services_path}/distributedfiledaemon:libdistributedfiledaemon", 703 "${utils_path}:libdistributedfileutils", 704 ] 705 706 external_deps = [ 707 "ability_base:want", 708 "ability_base:zuri", 709 "access_token:libaccesstoken_sdk", 710 "app_file_service:remote_file_share_native", 711 "app_file_service:sandbox_helper_native", 712 "c_utils:utils", 713 "common_event_service:cesfwk_innerkits", 714 "dataclassification:data_transit_mgr", 715 "device_auth:deviceauth_sdk", 716 "device_manager:devicemanagersdk", 717 "dsoftbus:softbus_client", 718 "eventhandler:libeventhandler", 719 "file_api:securitylabel", 720 "googletest:gmock_main", 721 "googletest:gtest_main", 722 "hilog:libhilog", 723 "hisysevent:libhisysevent", 724 "init:libbegetutil", 725 "ipc:ipc_single", 726 "os_account:os_account_innerkits", 727 "safwk:system_ability_fwk", 728 "samgr:samgr_proxy", 729 "storage_service:storage_manager_sa_proxy", 730 "zlib:shared_libz", 731 ] 732 733 defines = [ "private=public" ] 734 735 if (support_same_account) { 736 defines += [ "SUPPORT_SAME_ACCOUNT" ] 737 } 738} 739 740ohos_unittest("softbus_session_test") { 741 branch_protector_ret = "pac_ret" 742 sanitize = { 743 integer_overflow = true 744 cfi = true 745 cfi_cross_dso = true 746 debug = false 747 } 748 749 module_out_path = module_output_path 750 751 sources = [ "network/softbus/softbus_session_test.cpp" ] 752 753 configs = [ 754 ":module_private_config", 755 "${utils_path}:compiler_configs", 756 ] 757 758 deps = [ 759 "${services_path}/distributedfiledaemon:distributed_file_daemon_kit_inner", 760 "${services_path}/distributedfiledaemon:libdistributedfiledaemon", 761 "${utils_path}:libdistributedfileutils", 762 ] 763 764 external_deps = [ 765 "ability_base:want", 766 "ability_base:zuri", 767 "access_token:libaccesstoken_sdk", 768 "app_file_service:sandbox_helper_native", 769 "c_utils:utils", 770 "common_event_service:cesfwk_innerkits", 771 "dataclassification:data_transit_mgr", 772 "device_auth:deviceauth_sdk", 773 "device_manager:devicemanagersdk", 774 "dsoftbus:softbus_client", 775 "eventhandler:libeventhandler", 776 "file_api:securitylabel", 777 "googletest:gmock_main", 778 "googletest:gtest_main", 779 "hilog:libhilog", 780 "hisysevent:libhisysevent", 781 "init:libbegetutil", 782 "ipc:ipc_single", 783 "os_account:os_account_innerkits", 784 "safwk:system_ability_fwk", 785 "samgr:samgr_proxy", 786 "storage_service:storage_manager_sa_proxy", 787 "zlib:shared_libz", 788 ] 789 790 defines = [ "private=public" ] 791 792 if (support_same_account) { 793 defines += [ "SUPPORT_SAME_ACCOUNT" ] 794 } 795} 796 797ohos_unittest("softbus_handler_asset_test") { 798 branch_protector_ret = "pac_ret" 799 sanitize = { 800 integer_overflow = true 801 cfi = true 802 cfi_cross_dso = true 803 debug = false 804 blocklist = "${distributedfile_path}/cfi_blocklist.txt" 805 } 806 807 module_out_path = module_output_path 808 809 include_dirs = [ 810 "${distributedfile_path}/services/distributedfiledaemon/include/network/softbus", 811 "${distributedfile_path}/services/distributedfiledaemon/test/unittest/device/include" 812 ] 813 814 sources = [ 815 "${distributedfile_path}/services/distributedfiledaemon/src/network/softbus/softbus_handler_asset.cpp", 816 "${distributedfile_path}/services/distributedfiledaemon/src/network/softbus/softbus_permission_check.cpp", 817 "${distributedfile_path}/services/distributedfiledaemon/test/unittest/device/mock_other_method.cpp", 818 "${distributedfile_path}/test/mock/device_manager_impl_mock.cpp", 819 "${distributedfile_path}/test/mock/socket_mock.cpp", 820 "${distributedfile_path}/test/mock/softbus_bus_center_mock.cpp", 821 "network/softbus/softbus_handler_asset_test.cpp", 822 ] 823 824 configs = [ 825 ":module_private_config", 826 "${utils_path}:compiler_configs", 827 ] 828 829 deps = [ 830 "${services_path}/distributedfiledaemon:distributed_file_daemon_kit_inner", 831 "${services_path}/distributedfiledaemon:libdistributedfiledaemon", 832 "${utils_path}:libdistributedfileutils", 833 ] 834 835 external_deps = [ 836 "access_token:libaccesstoken_sdk", 837 "app_file_service:sandbox_helper_native", 838 "c_utils:utils", 839 "dataclassification:data_transit_mgr", 840 "device_manager:devicemanagersdk", 841 "dsoftbus:softbus_client", 842 "googletest:gmock_main", 843 "googletest:gtest_main", 844 "hilog:libhilog", 845 "hisysevent:libhisysevent", 846 "ipc:ipc_core", 847 "os_account:os_account_innerkits", 848 "samgr:samgr_proxy", 849 "zlib:shared_libz", 850 "dataclassification:data_transit_mgr", 851 ] 852 853 defines = [ "private=public" ] 854 855 if (support_same_account) { 856 defines += [ "SUPPORT_SAME_ACCOUNT" ] 857 } 858} 859 860ohos_unittest("softbus_handler_test") { 861 branch_protector_ret = "pac_ret" 862 sanitize = { 863 integer_overflow = true 864 cfi = true 865 cfi_cross_dso = true 866 debug = false 867 blocklist = "${distributedfile_path}/cfi_blocklist.txt" 868 } 869 870 module_out_path = module_output_path 871 872 include_dirs = [ 873 "${distributedfile_path}/services/distributedfiledaemon/include/network/softbus", 874 "${distributedfile_path}/services/distributedfiledaemon/test/mock/include", 875 "${distributedfile_path}/services/distributedfiledaemon/test/unittest/device/include" 876 ] 877 878 sources = [ 879 "${distributedfile_path}/services/distributedfiledaemon/src/network/softbus/softbus_handler.cpp", 880 "${distributedfile_path}/services/distributedfiledaemon/src/network/softbus/softbus_permission_check.cpp", 881 "${distributedfile_path}/services/distributedfiledaemon/test/unittest/device/mock_other_method.cpp", 882 "${distributedfile_path}/test/mock/device_manager_impl_mock.cpp", 883 "${distributedfile_path}/test/mock/socket_mock.cpp", 884 "${services_path}/distributedfiledaemon/test/mock/all_connect_manager_mock.cpp", 885 "network/softbus/softbus_handler_test.cpp", 886 ] 887 888 configs = [ 889 ":module_private_config", 890 "${utils_path}:compiler_configs", 891 ] 892 893 deps = [ 894 "${services_path}/distributedfiledaemon:libdistributedfiledaemon", 895 "${utils_path}:libdistributedfileutils", 896 ] 897 898 external_deps = [ 899 "access_token:libaccesstoken_sdk", 900 "app_file_service:sandbox_helper_native", 901 "c_utils:utils", 902 "dataclassification:data_transit_mgr", 903 "device_manager:devicemanagersdk", 904 "dsoftbus:softbus_client", 905 "googletest:gmock_main", 906 "googletest:gtest_main", 907 "hilog:libhilog", 908 "hisysevent:libhisysevent", 909 "os_account:os_account_innerkits", 910 "samgr:samgr_proxy", 911 ] 912 913 defines = [ "private=public" ] 914 915 if (support_same_account) { 916 defines += [ "SUPPORT_SAME_ACCOUNT" ] 917 } 918} 919 920ohos_unittest("softbus_session_pool_test") { 921 branch_protector_ret = "pac_ret" 922 sanitize = { 923 integer_overflow = true 924 cfi = true 925 cfi_cross_dso = true 926 debug = false 927 } 928 929 module_out_path = module_output_path 930 931 include_dirs = [ "${distributedfile_path}/services/distributedfiledaemon/include/network/softbus" ] 932 933 sources = [ "network/softbus/softbus_session_pool_test.cpp" ] 934 935 configs = [ 936 ":module_private_config", 937 "${utils_path}:compiler_configs", 938 ] 939 940 deps = [ 941 "${services_path}/distributedfiledaemon:libdistributedfiledaemon", 942 "${utils_path}:libdistributedfileutils", 943 ] 944 945 external_deps = [ 946 "access_token:libaccesstoken_sdk", 947 "c_utils:utils", 948 "dsoftbus:softbus_client", 949 "googletest:gmock_main", 950 "googletest:gtest_main", 951 "hilog:libhilog", 952 ] 953} 954 955ohos_unittest("softbus_session_listener_test") { 956 branch_protector_ret = "pac_ret" 957 sanitize = { 958 integer_overflow = true 959 cfi = true 960 cfi_cross_dso = true 961 debug = false 962 blocklist = "${distributedfile_path}/cfi_blocklist.txt" 963 } 964 965 module_out_path = module_output_path 966 967 include_dirs = [ 968 "${distributedfile_path}/services/distributedfiledaemon/include/network/softbus", 969 "${distributedfile_path}/services/distributedfiledaemon/test/mock/include", 970 ] 971 972 sources = [ 973 "${distributedfile_path}/test/mock/socket_mock.cpp", 974 "${services_path}/distributedfiledaemon/test/mock/all_connect_manager_mock.cpp", 975 "network/softbus/softbus_session_listener_test.cpp", 976 ] 977 978 configs = [ 979 ":module_private_config", 980 "${utils_path}:compiler_configs", 981 ] 982 983 deps = [ 984 "${services_path}/distributedfiledaemon:distributed_file_daemon_kit_inner", 985 "${services_path}/distributedfiledaemon:libdistributedfiledaemon", 986 "${utils_path}:libdistributedfileutils", 987 ] 988 989 external_deps = [ 990 "ability_base:zuri", 991 "access_token:libaccesstoken_sdk", 992 "app_file_service:sandbox_helper_native", 993 "c_utils:utils", 994 "dataclassification:data_transit_mgr", 995 "device_manager:devicemanagersdk", 996 "dsoftbus:softbus_client", 997 "googletest:gmock_main", 998 "googletest:gtest_main", 999 "hilog:libhilog", 1000 "hisysevent:libhisysevent", 1001 "os_account:os_account_innerkits", 1002 "samgr:samgr_proxy", 1003 ] 1004 1005 defines = [ "private=public" ] 1006} 1007 1008ohos_unittest("softbus_asset_recv_listener_test") { 1009 branch_protector_ret = "pac_ret" 1010 sanitize = { 1011 integer_overflow = true 1012 cfi = true 1013 cfi_cross_dso = true 1014 debug = false 1015 } 1016 1017 module_out_path = module_output_path 1018 1019 include_dirs = [ 1020 "${distributedfile_path}/frameworks/native/distributed_file_inner/include/asset", 1021 "${distributedfile_path}/services/distributedfiledaemon/include/ipc", 1022 "${distributedfile_path}/services/distributedfiledaemon/include/network/softbus", 1023 "${distributedfile_path}/services/distributedfiledaemon/test/mock/include", 1024 ] 1025 1026 sources = [ 1027 "${services_path}/distributedfiledaemon/test/mock/all_connect_manager_mock.cpp", 1028 "network/softbus/softbus_asset_recv_listener_test.cpp", 1029 ] 1030 1031 configs = [ 1032 ":module_private_config", 1033 "${utils_path}:compiler_configs", 1034 ] 1035 1036 deps = [ 1037 "${services_path}/distributedfiledaemon:distributed_file_daemon_kit_inner", 1038 "${services_path}/distributedfiledaemon:libdistributedfiledaemon", 1039 "${utils_path}:libdistributedfileutils", 1040 ] 1041 1042 external_deps = [ 1043 "access_token:libaccesstoken_sdk", 1044 "c_utils:utils", 1045 "device_manager:devicemanagersdk", 1046 "dsoftbus:softbus_client", 1047 "googletest:gmock_main", 1048 "googletest:gtest_main", 1049 "hilog:libhilog", 1050 "os_account:os_account_innerkits", 1051 "zlib:shared_libz", 1052 ] 1053 1054 defines = [ "private=public" ] 1055} 1056 1057ohos_unittest("softbus_asset_send_listener_test") { 1058 branch_protector_ret = "pac_ret" 1059 sanitize = { 1060 integer_overflow = true 1061 cfi = true 1062 cfi_cross_dso = true 1063 debug = false 1064 } 1065 1066 module_out_path = module_output_path 1067 1068 include_dirs = [ 1069 "${distributedfile_path}/frameworks/native/distributed_file_inner/include/asset", 1070 "${distributedfile_path}/services/distributedfiledaemon/include/ipc", 1071 "${distributedfile_path}/services/distributedfiledaemon/include/network/softbus", 1072 "${distributedfile_path}/services/distributedfiledaemon/test/mock/include", 1073 ] 1074 1075 sources = [ 1076 "${services_path}/distributedfiledaemon/test/mock/all_connect_manager_mock.cpp", 1077 "network/softbus/softbus_asset_send_listener_test.cpp", 1078 ] 1079 1080 configs = [ 1081 ":module_private_config", 1082 "${utils_path}:compiler_configs", 1083 ] 1084 1085 deps = [ 1086 "${services_path}/distributedfiledaemon:distributed_file_daemon_kit_inner", 1087 "${services_path}/distributedfiledaemon:libdistributedfiledaemon", 1088 "${utils_path}:libdistributedfileutils", 1089 ] 1090 1091 external_deps = [ 1092 "access_token:libaccesstoken_sdk", 1093 "c_utils:utils", 1094 "device_manager:devicemanagersdk", 1095 "dsoftbus:softbus_client", 1096 "googletest:gmock_main", 1097 "googletest:gtest_main", 1098 "hilog:libhilog", 1099 "os_account:os_account_innerkits", 1100 "zlib:shared_libz", 1101 ] 1102 1103 defines = [ "private=public" ] 1104} 1105 1106ohos_unittest("softbus_permission_check_test") { 1107 branch_protector_ret = "pac_ret" 1108 sanitize = { 1109 integer_overflow = true 1110 cfi = true 1111 cfi_cross_dso = true 1112 debug = false 1113 blocklist = "${distributedfile_path}/cfi_blocklist.txt" 1114 } 1115 1116 module_out_path = module_output_path 1117 1118 include_dirs = [ 1119 "${distributedfile_path}/services/distributedfiledaemon/include/network/softbus", 1120 "${distributedfile_path}/services/distributedfiledaemon/test/unittest/device/include" 1121 ] 1122 1123 sources = [ 1124 "${distributedfile_path}/test/mock/device_manager_impl_mock.cpp", 1125 "${distributedfile_path}/test/mock/socket_mock.cpp", 1126 "${distributedfile_path}/services/distributedfiledaemon/src/network/softbus/softbus_permission_check.cpp", 1127 "${distributedfile_path}/services/distributedfiledaemon/test/unittest/device/mock_other_method.cpp", 1128 "network/softbus/softbus_permission_check_test.cpp", 1129 ] 1130 1131 configs = [ 1132 ":module_private_config", 1133 "${utils_path}:compiler_configs", 1134 ] 1135 1136 deps = [ 1137 "${services_path}/distributedfiledaemon:distributed_file_daemon_kit_inner", 1138 "${services_path}/distributedfiledaemon:libdistributedfiledaemon", 1139 "${utils_path}:libdistributedfileutils", 1140 ] 1141 1142 external_deps = [ 1143 "access_token:libaccesstoken_sdk", 1144 "app_file_service:sandbox_helper_native", 1145 "c_utils:utils", 1146 "dataclassification:data_transit_mgr", 1147 "device_manager:devicemanagersdk", 1148 "dsoftbus:softbus_client", 1149 "googletest:gmock_main", 1150 "googletest:gtest_main", 1151 "hilog:libhilog", 1152 "hisysevent:libhisysevent", 1153 "ipc:ipc_core", 1154 "os_account:os_account_innerkits", 1155 "samgr:samgr_proxy", 1156 "zlib:shared_libz", 1157 ] 1158 1159 defines = [ "private=public" ] 1160 1161 if (support_same_account) { 1162 defines += [ "SUPPORT_SAME_ACCOUNT" ] 1163 } 1164} 1165 1166ohos_unittest("system_notifier_test") { 1167 branch_protector_ret = "pac_ret" 1168 sanitize = { 1169 integer_overflow = true 1170 cfi = true 1171 cfi_cross_dso = true 1172 debug = false 1173 blocklist = "${distributedfile_path}/cfi_blocklist.txt" 1174 } 1175 1176 module_out_path = module_output_path 1177 1178 include_dirs = [ 1179 "include", 1180 "include/network/softbus", 1181 "${distributedfile_path}/frameworks/native/distributed_file_inner/include", 1182 "${distributedfile_path}/services/distributedfiledaemon/include/ipc", 1183 "${distributedfile_path}/services/distributedfiledaemon/include/channel_manager", 1184 ] 1185 1186 sources = [ 1187 "${distributedfile_path}/services/distributedfiledaemon/src/channel_manager/system_notifier.cpp", 1188 "${distributedfile_path}/test/mock/device_manager_impl_mock.cpp", 1189 "${distributedfile_path}/test/mock/device_manager_mock.cpp", 1190 "channel_manager/system_notifier_test.cpp", 1191 ] 1192 1193 configs = [ 1194 ":module_private_config", 1195 "${utils_path}:compiler_configs", 1196 ] 1197 1198 deps = [ 1199 "${services_path}/distributedfiledaemon:distributed_file_daemon_kit_inner", 1200 "${services_path}/distributedfiledaemon:libdistributedfiledaemon", 1201 "${utils_path}:libdistributedfileutils", 1202 ] 1203 1204 external_deps = [ 1205 "ability_base:want", 1206 "ability_base:zuri", 1207 "access_token:libaccesstoken_sdk", 1208 "app_file_service:sandbox_helper_native", 1209 "c_utils:utils", 1210 "cJSON:cjson_static", 1211 "dataclassification:data_transit_mgr", 1212 "device_manager:devicemanagersdk", 1213 "distributed_notification_service:ans_innerkits", 1214 "dsoftbus:softbus_client", 1215 "googletest:gmock_main", 1216 "googletest:gtest_main", 1217 "hilog:libhilog", 1218 "hisysevent:libhisysevent", 1219 "i18n:intl_util", 1220 "ipc:ipc_core", 1221 "os_account:os_account_innerkits", 1222 "safwk:system_ability_fwk", 1223 "zlib:shared_libz", 1224 ] 1225 1226 defines = [ "private=public" ] 1227} 1228 1229ohos_unittest("control_cmd_parser_test") { 1230 branch_protector_ret = "pac_ret" 1231 sanitize = { 1232 integer_overflow = true 1233 cfi = true 1234 cfi_cross_dso = true 1235 debug = false 1236 blocklist = "${distributedfile_path}/cfi_blocklist.txt" 1237 } 1238 1239 module_out_path = module_output_path 1240 1241 include_dirs = [ 1242 "include", 1243 "include/network/softbus", 1244 "${distributedfile_path}/frameworks/native/distributed_file_inner/include", 1245 "${distributedfile_path}/services/distributedfiledaemon/include/ipc", 1246 "${distributedfile_path}/services/distributedfiledaemon/include/channel_manager", 1247 ] 1248 1249 sources = [ 1250 "channel_manager/control_cmd_parser_test.cpp" 1251 ] 1252 1253 configs = [ 1254 ":module_private_config", 1255 "${utils_path}:compiler_configs", 1256 ] 1257 1258 deps = [ 1259 "${services_path}/distributedfiledaemon:distributed_file_daemon_kit_inner", 1260 "${services_path}/distributedfiledaemon:libdistributedfiledaemon", 1261 "${utils_path}:libdistributedfileutils", 1262 ] 1263 1264 external_deps = [ 1265 "ability_base:want", 1266 "ability_base:zuri", 1267 "access_token:libaccesstoken_sdk", 1268 "app_file_service:sandbox_helper_native", 1269 "c_utils:utils", 1270 "cJSON:cjson_static", 1271 "dataclassification:data_transit_mgr", 1272 "device_manager:devicemanagersdk", 1273 "distributed_notification_service:ans_innerkits", 1274 "dsoftbus:softbus_client", 1275 "googletest:gmock_main", 1276 "googletest:gtest_main", 1277 "hilog:libhilog", 1278 "hisysevent:libhisysevent", 1279 "init:libbegetutil", 1280 "ipc:ipc_core", 1281 "os_account:os_account_innerkits", 1282 "safwk:system_ability_fwk", 1283 "zlib:shared_libz", 1284 ] 1285 1286 defines = [ "private=public" ] 1287} 1288 1289ohos_unittest("channel_manager_test") { 1290 branch_protector_ret = "pac_ret" 1291 sanitize = { 1292 integer_overflow = true 1293 cfi = true 1294 cfi_cross_dso = true 1295 debug = false 1296 blocklist = "${distributedfile_path}/cfi_blocklist.txt" 1297 } 1298 1299 module_out_path = module_output_path 1300 1301 include_dirs = [ 1302 "include", 1303 "include/network/softbus", 1304 "${distributedfile_path}/frameworks/native/distributed_file_inner/include", 1305 "${distributedfile_path}/services/distributedfiledaemon/include/ipc", 1306 "${distributedfile_path}/services/distributedfiledaemon/include/channel_manager", 1307 ] 1308 1309 sources = [ 1310 "${distributedfile_path}/services/distributedfiledaemon/src/channel_manager/channel_manager.cpp", 1311 "${distributedfile_path}/test/mock/socket_mock.cpp", 1312 "channel_manager/channel_manager_test.cpp", 1313 ] 1314 1315 configs = [ 1316 ":module_private_config", 1317 "${utils_path}:compiler_configs", 1318 ] 1319 1320 deps = [ 1321 "${services_path}/distributedfiledaemon:distributed_file_daemon_kit_inner", 1322 "${services_path}/distributedfiledaemon:libdistributedfiledaemon", 1323 "${utils_path}:libdistributedfileutils", 1324 ] 1325 1326 external_deps = [ 1327 "ability_base:want", 1328 "ability_base:zuri", 1329 "ability_runtime:abilitykit_native", 1330 "ability_runtime:uri_permission_mgr", 1331 "access_token:libaccesstoken_sdk", 1332 "access_token:libtokenid_sdk", 1333 "app_file_service:remote_file_share_native", 1334 "app_file_service:sandbox_helper_native", 1335 "c_utils:utils", 1336 "common_event_service:cesfwk_innerkits", 1337 "data_share:datashare_consumer", 1338 "dataclassification:data_transit_mgr", 1339 "device_auth:deviceauth_sdk", 1340 "dsoftbus:softbus_client", 1341 "eventhandler:libeventhandler", 1342 "file_api:securitylabel", 1343 "hilog:libhilog", 1344 "hisysevent:libhisysevent", 1345 "googletest:gmock_main", 1346 "googletest:gtest_main", 1347 "init:libbegetutil", 1348 "ipc:ipc_single", 1349 "json:nlohmann_json_static", 1350 "os_account:libaccountkits", 1351 "os_account:os_account_innerkits", 1352 "safwk:system_ability_fwk", 1353 "samgr:samgr_proxy", 1354 "storage_service:storage_manager_sa_proxy", 1355 "zlib:shared_libz", 1356 ] 1357 1358 defines = [ "private=public" ] 1359} 1360 1361group("unittest") { 1362 testonly = true 1363 deps = [ 1364 ":device_info_test", 1365 ":device_manager_agent_sup_test", 1366 ":device_manager_agent_test", 1367 ":devsl_dispatcher_test", 1368 ":kernel_talker_test", 1369 ":os_account_observer_test", 1370 ":softbus_agent_sup_test", 1371 ":softbus_agent_test", 1372 ":softbus_asset_recv_listener_test", 1373 ":softbus_asset_send_listener_test", 1374 ":softbus_file_receive_listener_test", 1375 ":softbus_file_send_listener_test", 1376 ":softbus_handler_asset_test", 1377 ":softbus_handler_test", 1378 ":softbus_permission_check_test", 1379 ":softbus_session_dispatcher_test", 1380 ":softbus_session_listener_test", 1381 ":softbus_session_pool_test", 1382 ":softbus_session_test", 1383 ":system_notifier_test", 1384 ":control_cmd_parser_test", 1385 ":channel_manager_test", 1386 ] 1387} 1388