diff --git a/services/screenservice/test/unittest/sourceservice/dscreenmgr/1.0/src/dscreen_test.cpp b/services/screenservice/test/unittest/sourceservice/dscreenmgr/1.0/src/dscreen_test.cpp index 8b8921faf06e9c9f6a6cd255c7fa85f1c9a3f694..ebb9945af5e5ca2cf7600fd37d17431e4b84ee19 100644 --- a/services/screenservice/test/unittest/sourceservice/dscreenmgr/1.0/src/dscreen_test.cpp +++ b/services/screenservice/test/unittest/sourceservice/dscreenmgr/1.0/src/dscreen_test.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2024 Huawei Device Co., Ltd. + * Copyright (c) 2022-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -306,15 +306,6 @@ HWTEST_F(DScreenTestV1, CheckJsonData_003, TestSize.Level1) attrJson["screenHeight"] = heigth; attrJson["codecType"] = 0; - std::string devId = "devId"; - std::string dhId = "dhId"; - ScreenMgrAdapter::GetInstance().screenIdMap_.clear(); - std::shared_ptr videoParam = std::make_shared(); - uint64_t screenId = ScreenMgrAdapter::GetInstance().CreateVirtualScreen(devId, dhId, videoParam); - std::string taskId = "taskId"; - dScreen_->screenId_ = screenId; - dScreen_->HandleDisable(taskId); - int32_t ret = dScreen_->CheckJsonData(attrJson); EXPECT_EQ(DH_SUCCESS, ret); diff --git a/services/screenservice/test/unittest/sourceservice/dscreenmgr/BUILD.gn b/services/screenservice/test/unittest/sourceservice/dscreenmgr/BUILD.gn index 3724e5b53c59b871976fa58a73156b51a891aba8..8534216beb49868229fa58c1b20aa25bc770c62d 100644 --- a/services/screenservice/test/unittest/sourceservice/dscreenmgr/BUILD.gn +++ b/services/screenservice/test/unittest/sourceservice/dscreenmgr/BUILD.gn @@ -43,6 +43,12 @@ config("module_private_config") { ## UnitTest DscreenMgrTest ohos_unittest("DscreenMgrTest") { module_out_path = module_out_path + sanitize = { + blocklist = "./cfi_blocklist.txt" + cfi = true + cfi_cross_dso = true + debug = false + } sources = [ "${services_path}/screenservice/test/unittest/sourceservice/dscreenmgr/1.0/src/dscreen_manager_test.cpp", diff --git a/services/screenservice/test/unittest/sourceservice/dscreenmgr/cfi_blocklist.txt b/services/screenservice/test/unittest/sourceservice/dscreenmgr/cfi_blocklist.txt new file mode 100644 index 0000000000000000000000000000000000000000..a3b6e425e7db15ba9a6c13a19bb88af111690d17 --- /dev/null +++ b/services/screenservice/test/unittest/sourceservice/dscreenmgr/cfi_blocklist.txt @@ -0,0 +1,16 @@ +# Copyright (c) 2025 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +[cfi] +type:*testing::UnitTest* +src:*third_party/googletest/*