From f27405a8b22ce3eb1dca5fcf1abb3253ba6e137c Mon Sep 17 00:00:00 2001 From: BrainL Date: Fri, 8 Aug 2025 16:15:25 +0800 Subject: [PATCH] =?UTF-8?q?idl=E5=8C=96=E8=A1=A5=E5=85=85UT=E5=9B=9E?= =?UTF-8?q?=E9=80=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: BrainL --- tests/unittests/backup_sa/BUILD.gn | 1 - .../backup_sa/module_client/BUILD.gn | 86 ---- .../module_client/service_client_test.cpp | 405 ------------------ 3 files changed, 492 deletions(-) delete mode 100644 tests/unittests/backup_sa/module_client/BUILD.gn delete mode 100644 tests/unittests/backup_sa/module_client/service_client_test.cpp diff --git a/tests/unittests/backup_sa/BUILD.gn b/tests/unittests/backup_sa/BUILD.gn index b552944b3..5351c84bd 100644 --- a/tests/unittests/backup_sa/BUILD.gn +++ b/tests/unittests/backup_sa/BUILD.gn @@ -19,7 +19,6 @@ group("backup_sa_test") { deps = [ "module_app_gallery:app_gallery_test", - "module_client:service_client_test", "module_external:adapter_test", "module_ipc:backup_sa_ipc_test", "session:session_test", diff --git a/tests/unittests/backup_sa/module_client/BUILD.gn b/tests/unittests/backup_sa/module_client/BUILD.gn deleted file mode 100644 index 47a26fff8..000000000 --- a/tests/unittests/backup_sa/module_client/BUILD.gn +++ /dev/null @@ -1,86 +0,0 @@ -# Copyright (c) 2024 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. - -import("//build/test.gni") -import("//foundation/filemanagement/app_file_service/app_file_service.gni") -import("//foundation/filemanagement/app_file_service/backup.gni") - -ohos_unittest("service_client_test") { - module_out_path = path_module_out_tests - - include_dirs = [ - "${path_backup}/frameworks/native/backup_kit_inner/include", - "${path_backup}/interfaces/inner_api/native/backup_kit_inner/impl", - "${path_backup}/services/backup_sa/include", - "${path_backup}/services/backup_sa/include/module_notify", - "${path_backup}/utils/include", - "${path_backup}/utils/src", - "${path_backup}/tests/mock/utils_mock/include", - ".", - ] - - sources = [ - "${path_backup}/tests/mock/utils_mock/src/utils_mock_global_variable.cpp", - "service_client_test.cpp", - ] - - deps = [ - "${path_backup}/interfaces/inner_api/native/backup_kit_inner:backup_kit_inner", - "${path_backup}/services/backup_sa:backup_sa_ipc_stub", - "${path_backup}/utils:backup_utils", - ] - - sanitize = { - integer_overflow = true - ubsan = true - boundary_sanitize = true - cfi = true - cfi_cross_dso = true - debug = false - } - - defines = [ - "LOG_TAG=\"app_file_service\"", - "LOG_DOMAIN=0xD200000", - "private = public", - "protected = public", - ] - - external_deps = [ - "ability_base:want", - "ability_runtime:ability_connect_callback_stub", - "ability_runtime:ability_manager", - "access_token:libaccesstoken_sdk", - "access_token:libtokenid_sdk", - "bundle_framework:appexecfwk_base", - "bundle_framework:appexecfwk_core", - "c_utils:utils", - "common_event_service:cesfwk_innerkits", - "googletest:gmock_main", - "googletest:gtest_main", - "hilog:libhilog", - "hitrace:hitrace_meter", - "ipc:ipc_core", - "jsoncpp:jsoncpp", - "safwk:system_ability_fwk", - "samgr:samgr_proxy", - "storage_service:storage_manager_sa_proxy", - ] - - use_exceptions = true -} - -group("backup_sa_service_client_test") { - testonly = true - deps = [ ":service_client_test" ] -} diff --git a/tests/unittests/backup_sa/module_client/service_client_test.cpp b/tests/unittests/backup_sa/module_client/service_client_test.cpp deleted file mode 100644 index ce840db00..000000000 --- a/tests/unittests/backup_sa/module_client/service_client_test.cpp +++ /dev/null @@ -1,405 +0,0 @@ -/* - * Copyright (c) 2022-2024 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. - */ -#include -#include - -#include "b_error/b_error.h" -#include "service_client.h" -#include "service_reverse.h" -#include "b_session_restore.h" - -namespace OHOS::FileManagement::Backup { -using namespace std; -using namespace testing; - -class ServiceClientTest : public testing::Test { -public: - static void SetUpTestCase(void); - static void TearDownTestCase(); - void SetUp() override {}; - void TearDown() override {}; - -public: - static inline sptr proxy = nullptr; -}; - -void ServiceClientTest::SetUpTestCase() -{ - GTEST_LOG_(INFO) << "begin SetUpTestCase"; - proxy = ServiceClient::GetInstance(); - if (proxy == nullptr) { - GTEST_LOG_(INFO) << "Failed to get ServiceClient instance"; - } -} - -void ServiceClientTest::TearDownTestCase() -{ - if (proxy != nullptr) { - ServiceClient::InvaildInstance(); - proxy = nullptr; - } - ServiceClient::InvaildInstance(); -} - -/** - * @tc.number: SUB_service_client_test_0100 - * @tc.name: SUB_service_client_test_0100 - * @tc.desc: 测试 InitIncrementalBackupSession 接口 - * @tc.size: MEDIUM - * @tc.type: FUNC - * @tc.level Level 1 - * @tc.require: issuesI9KPRL - */ -HWTEST_F(ServiceClientTest, SUB_service_client_test_0100, testing::ext::TestSize.Level1) -{ - GTEST_LOG_(INFO) << "ServiceClientTest-begin SUB_service_client_test_0100"; - EXPECT_NE(proxy, nullptr); - ServiceClient::InvaildInstance(); - proxy=ServiceClient::serviceProxy_; - EXPECT_EQ(proxy, nullptr); - GTEST_LOG_(INFO) << "ServiceClientTest-end SUB_service_client_test_0100"; -} - -HWTEST_F(ServiceClientTest, SUB_service_client_test_0200, testing::ext::TestSize.Level1) -{ - GTEST_LOG_(INFO) << "ServiceClientTest-begin SUB_service_client_test_0200"; - proxy = ServiceClient::GetInstance(); - EXPECT_NE(proxy, nullptr); - ErrCode ret = proxy->Start(); - EXPECT_EQ(ret, BError(BError::BackupErrorCode::E_PERM)); - ret = proxy->Finish(); - EXPECT_EQ(ret, BError(BError::BackupErrorCode::E_PERM)); - ret = proxy->Release(); - EXPECT_NE(ret, BError(BError::BackupErrorCode::E_PERM)); - ret = proxy->GetAppLocalListAndDoIncrementalBackup(); - EXPECT_NE(ret, BError(BError::Codes::OK)); - GTEST_LOG_(INFO) << "ServiceClientTest-end SUB_service_client_test_0200"; -} - -HWTEST_F(ServiceClientTest, SUB_service_client_test_0300, testing::ext::TestSize.Level1) -{ - GTEST_LOG_(INFO) << "ServiceClientTest-begin SUB_service_client_test_0300"; - proxy = ServiceClient::GetInstance(); - EXPECT_NE(proxy, nullptr); - std::string bundleName; - int32_t result = -1; - bundleName = "test"; - proxy->CancelForResult(bundleName, result); - EXPECT_EQ(result, 0); - GTEST_LOG_(INFO) << "ServiceClientTest-end SUB_service_client_test_0300"; -} - -HWTEST_F(ServiceClientTest, SUB_service_client_test_0400, testing::ext::TestSize.Level1) -{ - GTEST_LOG_(INFO) << "ServiceClientTest-begin SUB_service_client_test_0400"; - proxy = ServiceClient::GetInstance(); - EXPECT_NE(proxy, nullptr); - ErrCode err = -1; - ErrCode ret = proxy->AppIncrementalDone(err); - EXPECT_EQ(ret, BError(BError::BackupErrorCode::E_INVAL)); - err = 0; - ret = proxy->AppIncrementalDone(err); - EXPECT_EQ(ret, BError(BError::BackupErrorCode::E_INVAL)); - err = 1; - ret = proxy->AppIncrementalDone(err); - EXPECT_EQ(ret, BError(BError::BackupErrorCode::E_INVAL)); - GTEST_LOG_(INFO) << "ServiceClientTest-end SUB_service_client_test_0400"; -} - -HWTEST_F(ServiceClientTest, SUB_service_client_test_0500, testing::ext::TestSize.Level1) -{ - GTEST_LOG_(INFO) << "ServiceClientTest-begin SUB_service_client_test_0500"; - proxy = ServiceClient::GetInstance(); - EXPECT_NE(proxy, nullptr); - ErrCode err = -1; - ErrCode ret = proxy->AppDone(err); - EXPECT_EQ(ret, BError(BError::BackupErrorCode::E_INVAL)); - err = 0; - ret = proxy->AppDone(err); - EXPECT_EQ(ret, BError(BError::BackupErrorCode::E_INVAL)); - err = 1; - ret = proxy->AppDone(err); - EXPECT_EQ(ret, BError(BError::BackupErrorCode::E_INVAL)); - GTEST_LOG_(INFO) << "ServiceClientTest-end SUB_service_client_test_0500"; -} - -HWTEST_F(ServiceClientTest, SUB_service_client_test_0600, testing::ext::TestSize.Level1) -{ - GTEST_LOG_(INFO) << "ServiceClientTest-begin SUB_service_client_test_0600"; - proxy = ServiceClient::GetInstance(); - EXPECT_NE(proxy, nullptr); - int fd = -1; - ErrCode ret = proxy->GetLocalCapabilities(fd); - EXPECT_EQ(ret, BError(BError::Codes::OK)); - fd = -2; - ret = proxy->GetLocalCapabilitiesForBundleInfos(fd); - EXPECT_EQ(ret, BError(BError::Codes::OK)); - GTEST_LOG_(INFO) << "ServiceClientTest-end SUB_service_client_test_0600"; -} - -HWTEST_F(ServiceClientTest, SUB_service_client_test_0700, testing::ext::TestSize.Level1) -{ - GTEST_LOG_(INFO) << "ServiceClientTest-begin SUB_service_client_test_0700"; - proxy = ServiceClient::GetInstance(); - EXPECT_NE(proxy, nullptr); - std::string bundleName; - std::string fileName; - ErrCode ret = proxy->GetIncrementalFileHandle(bundleName, fileName); - EXPECT_EQ(ret, BError(BError::BackupErrorCode::E_INVAL)); - bundleName = ""; - fileName = ""; - ret = proxy->GetIncrementalFileHandle(bundleName, fileName); - EXPECT_EQ(ret, BError(BError::BackupErrorCode::E_INVAL)); - bundleName = "test"; - fileName = "test"; - ret = proxy->GetIncrementalFileHandle(bundleName, fileName); - EXPECT_EQ(ret, BError(BError::BackupErrorCode::E_INVAL)); - GTEST_LOG_(INFO) << "ServiceClientTest-end SUB_service_client_test_0700"; -} - -HWTEST_F(ServiceClientTest, SUB_service_client_test_0800, testing::ext::TestSize.Level1) -{ - GTEST_LOG_(INFO) << "ServiceClientTest-begin SUB_service_client_test_0800"; - proxy = ServiceClient::GetInstance(); - EXPECT_NE(proxy, nullptr); - std::string bundleName; - std::string fileName; - bool booleanValue = false; - ErrCode ret = proxy->GetBackupInfo(bundleName, fileName); - EXPECT_EQ(ret, BError(BError::BackupErrorCode::E_BEF)); - EXPECT_EQ(bundleName, ""); - EXPECT_EQ(fileName, ""); - booleanValue = true; - ret = proxy->StartExtTimer(booleanValue); - EXPECT_EQ(ret, BError(BError::BackupErrorCode::E_INVAL)); - booleanValue = false; - ret = proxy->StartExtTimer(booleanValue); - EXPECT_EQ(ret, BError(BError::BackupErrorCode::E_INVAL)); - booleanValue = true; - ret = proxy->StartFwkTimer(booleanValue); - EXPECT_EQ(ret, BError(BError::BackupErrorCode::E_INVAL)); - booleanValue = false; - ret = proxy->StartFwkTimer(booleanValue); - EXPECT_EQ(ret, BError(BError::BackupErrorCode::E_INVAL)); - booleanValue = true; - ret = proxy->StopExtTimer(booleanValue); - EXPECT_EQ(ret, BError(BError::BackupErrorCode::E_INVAL)); - booleanValue = false; - ret = proxy->StopExtTimer(booleanValue); - EXPECT_EQ(ret, BError(BError::BackupErrorCode::E_INVAL)); - bool isExt = true; - bundleName = ""; - ret = proxy->UpdateTimer(bundleName, 0, isExt); - EXPECT_NE(ret, BError(BError::BackupErrorCode::E_INVAL)); - EXPECT_EQ(isExt, false); - bundleName = "test"; - ret = proxy->UpdateTimer(bundleName, 10, isExt); - EXPECT_EQ(ret, BError(BError::Codes::OK)); - EXPECT_EQ(isExt, false); - GTEST_LOG_(INFO) << "ServiceClientTest-end SUB_service_client_test_0800"; -} - -HWTEST_F(ServiceClientTest, SUB_service_client_test_0900, testing::ext::TestSize.Level1) -{ - GTEST_LOG_(INFO) << "ServiceClientTest-begin SUB_service_client_test_0900"; - proxy = ServiceClient::GetInstance(); - EXPECT_NE(proxy, nullptr); - std::string stringVal = ""; - ErrCode ret = proxy->ReportAppProcessInfo(stringVal, BackupRestoreScenario::FULL_BACKUP); - EXPECT_EQ(ret, BError(BError::BackupErrorCode::E_INVAL)); - stringVal = ""; - ret = proxy->ReportAppProcessInfo(stringVal, BackupRestoreScenario::FULL_BACKUP); - EXPECT_EQ(ret, BError(BError::BackupErrorCode::E_INVAL)); - stringVal = "test"; - ret = proxy->ReportAppProcessInfo(stringVal, BackupRestoreScenario::FULL_BACKUP); - EXPECT_EQ(ret, BError(BError::BackupErrorCode::E_INVAL)); - int64_t val = -1; - ret = proxy->RefreshDataSize(val); - EXPECT_EQ(ret, BError(BError::BackupErrorCode::E_INVAL)); - val = 1; - ret = proxy->RefreshDataSize(val); - EXPECT_EQ(ret, BError(BError::BackupErrorCode::E_INVAL)); - stringVal = ""; - ret = proxy->ServiceResultReport(stringVal, BackupRestoreScenario::FULL_BACKUP, 0); - EXPECT_EQ(ret, BError(BError::BackupErrorCode::E_INVAL)); - stringVal = ""; - ret = proxy->ServiceResultReport(stringVal, BackupRestoreScenario::FULL_BACKUP, 0); - EXPECT_EQ(ret, BError(BError::BackupErrorCode::E_INVAL)); - GTEST_LOG_(INFO) << "ServiceClientTest-end SUB_service_client_test_0900"; -} - -HWTEST_F(ServiceClientTest, SUB_service_client_test_1000, testing::ext::TestSize.Level1) -{ - std::string bundleName = ""; - GTEST_LOG_(INFO) << "ServiceClientTest-begin SUB_service_client_test_1000"; - proxy = ServiceClient::GetInstance(); - EXPECT_NE(proxy, nullptr); - BFileInfo *fileInfo = nullptr; - BFileInfo bf {bundleName, "", 0}; - fileInfo = &bf; - ErrCode ret = proxy->PublishFile(*fileInfo); - EXPECT_NE(ret, BError(BError::Codes::OK)); - ret = proxy->PublishIncrementalFile(*fileInfo); - EXPECT_NE(ret, BError(BError::Codes::OK)); - ret = proxy->PublishSAIncrementalFile(*fileInfo, 0); - EXPECT_NE(ret, BError(BError::Codes::OK)); - GTEST_LOG_(INFO) << "ServiceClientTest-end SUB_service_client_test_1000"; -} - -HWTEST_F(ServiceClientTest, SUB_service_client_test_1100, testing::ext::TestSize.Level1) -{ - GTEST_LOG_(INFO) << "ServiceClientTest-begin SUB_service_client_test_1100"; - proxy = ServiceClient::GetInstance(); - EXPECT_NE(proxy, nullptr); - int fd = 0; - int32_t restoreType = -1; - int32_t userid = -1; - std::vector bundleNames; - std::vector detailInfos; - std::vector bundlesToBackup; - ErrCode ret = proxy->AppendBundlesRestoreSessionDataByDetail(fd, bundleNames, detailInfos, restoreType, userid); - EXPECT_NE(ret, BError(BError::Codes::OK)); - ret = proxy->AppendBundlesRestoreSessionData(fd, bundleNames, restoreType, userid); - EXPECT_NE(ret, BError(BError::Codes::OK)); - ret = proxy->AppendBundlesIncrementalBackupSessionWithBundleInfos(bundlesToBackup, detailInfos); - EXPECT_EQ(ret, BError(BError::BackupErrorCode::E_INVAL)); - ret = proxy->AppendBundlesBackupSession(bundleNames); - EXPECT_EQ(ret, BError(BError::BackupErrorCode::E_INVAL)); - ret = proxy->AppendBundlesDetailsBackupSession(bundleNames, detailInfos); - EXPECT_EQ(ret, BError(BError::BackupErrorCode::E_INVAL)); - bundleNames.push_back("test"); - ret = proxy->AppendBundlesRestoreSessionDataByDetail(fd, bundleNames, detailInfos, restoreType, userid); - EXPECT_NE(ret, BError(BError::Codes::OK)); - ret = proxy->AppendBundlesRestoreSessionData(fd, bundleNames, restoreType, userid); - EXPECT_NE(ret, BError(BError::Codes::OK)); - ret = proxy->AppendBundlesIncrementalBackupSessionWithBundleInfos(bundlesToBackup, detailInfos); - EXPECT_EQ(ret, BError(BError::BackupErrorCode::E_INVAL)); - ret = proxy->AppendBundlesBackupSession(bundleNames); - EXPECT_EQ(ret, BError(BError::BackupErrorCode::E_INVAL)); - ret = proxy->AppendBundlesDetailsBackupSession(bundleNames, detailInfos); - EXPECT_EQ(ret, BError(BError::BackupErrorCode::E_INVAL)); - detailInfos.push_back("test"); - ret = proxy->AppendBundlesRestoreSessionDataByDetail(fd, bundleNames, detailInfos, restoreType, userid); - EXPECT_NE(ret, BError(BError::Codes::OK)); - ret = proxy->AppendBundlesRestoreSessionData(fd, bundleNames, restoreType, userid); - EXPECT_NE(ret, BError(BError::Codes::OK)); - ret = proxy->AppendBundlesIncrementalBackupSessionWithBundleInfos(bundlesToBackup, detailInfos); - EXPECT_EQ(ret, BError(BError::BackupErrorCode::E_INVAL)); - ret = proxy->AppendBundlesDetailsBackupSession(bundleNames, detailInfos); - EXPECT_EQ(ret, BError(BError::BackupErrorCode::E_INVAL)); - restoreType = 1; - userid = 1; - ret = proxy->AppendBundlesRestoreSessionDataByDetail(fd, bundleNames, detailInfos, restoreType, userid); - EXPECT_NE(ret, BError(BError::Codes::OK)); - ret = proxy->AppendBundlesRestoreSessionData(fd, bundleNames, restoreType, userid); - EXPECT_NE(ret, BError(BError::Codes::OK)); - ret = proxy->AppendBundlesIncrementalBackupSessionWithBundleInfos(bundlesToBackup, detailInfos); - EXPECT_EQ(ret, BError(BError::BackupErrorCode::E_INVAL)); - GTEST_LOG_(INFO) << "ServiceClientTest-end SUB_service_client_test_1100"; -} - -HWTEST_F(ServiceClientTest, SUB_service_client_test_1200, testing::ext::TestSize.Level1) -{ - GTEST_LOG_(INFO) << "ServiceClientTest-begin SUB_service_client_test_1200"; - proxy = ServiceClient::GetInstance(); - EXPECT_NE(proxy, nullptr); - sptr srptr = nullptr; - ErrCode ret = proxy->InitRestoreSession(srptr); - EXPECT_NE(ret, BError(BError::Codes::OK)); - ret = proxy->InitBackupSession(srptr); - EXPECT_NE(ret, BError(BError::Codes::OK)); - ret = proxy->InitIncrementalBackupSession(srptr); - EXPECT_NE(ret, BError(BError::Codes::OK)); - std::string errMsg = ""; - std::string result = "err"; - proxy->InitRestoreSessionWithErrMsg(srptr, ret, errMsg); - EXPECT_NE(ret, BError(BError::Codes::OK)); - proxy->InitBackupSessionWithErrMsg(srptr, ret, errMsg); - EXPECT_NE(ret, BError(BError::Codes::OK)); - proxy->InitIncrementalBackupSessionWithErrMsg(srptr, ret, errMsg); - EXPECT_NE(ret, BError(BError::Codes::OK)); - BSessionRestore::Callbacks callback; - srptr = sptr(new ServiceReverse(callback)); - ret = proxy->InitRestoreSession(srptr); - EXPECT_EQ(ret, BError(BError::Codes::OK)); - ret = proxy->InitBackupSession(srptr); - EXPECT_EQ(ret, BError(BError::BackupErrorCode::E_CONFLICT)); - ret = proxy->InitIncrementalBackupSession(srptr); - EXPECT_EQ(ret, BError(BError::BackupErrorCode::E_CONFLICT)); - - proxy->InitRestoreSessionWithErrMsg(srptr, ret, errMsg); - EXPECT_EQ(ret, BError(BError::BackupErrorCode::E_CONFLICT)); - EXPECT_NE(errMsg, ""); - proxy->InitBackupSessionWithErrMsg(srptr, ret, errMsg); - EXPECT_EQ(ret, BError(BError::BackupErrorCode::E_CONFLICT)); - EXPECT_NE(errMsg, ""); - proxy->InitIncrementalBackupSessionWithErrMsg(srptr, ret, errMsg); - EXPECT_EQ(ret, BError(BError::BackupErrorCode::E_CONFLICT)); - EXPECT_NE(errMsg, ""); - - GTEST_LOG_(INFO) << "ServiceClientTest-end SUB_service_client_test_1200"; -} - -HWTEST_F(ServiceClientTest, SUB_service_client_test_1300, testing::ext::TestSize.Level1) -{ - GTEST_LOG_(INFO) << "ServiceClientTest-begin SUB_service_client_test_1300"; - proxy = ServiceClient::GetInstance(); - EXPECT_NE(proxy, nullptr); - - GTEST_LOG_(INFO) << "ServiceClientTest-end SUB_service_client_test_1300"; -} - -HWTEST_F(ServiceClientTest, SUB_service_client_test_1400, testing::ext::TestSize.Level1) -{ - GTEST_LOG_(INFO) << "ServiceClientTest-begin SUB_service_client_test_1400"; - proxy = ServiceClient::GetInstance(); - EXPECT_NE(proxy, nullptr); - std::string bundleName; - std::string fileName; - bool isExt = true; - bundleName = ""; - ErrCode ret = proxy->UpdateSendRate(bundleName, 0, isExt); - EXPECT_EQ(ret, BError(BError::BackupErrorCode::E_INVAL)); - EXPECT_TRUE(isExt); - bundleName = "test"; - ret = proxy->UpdateSendRate(bundleName, 10, isExt); - EXPECT_EQ(ret, BError(BError::BackupErrorCode::E_INVAL)); - EXPECT_TRUE(isExt); - bundleName = ""; - ret = proxy->AppIncrementalFileReady(bundleName, 0, 0, 0); - EXPECT_NE(ret, BError(BError::Codes::OK)); - bundleName = "test"; - ret = proxy->AppIncrementalFileReady(bundleName, 1, 1, 0); - EXPECT_EQ(ret, BError(BError::BackupErrorCode::E_INVAL)); - fileName = ""; - ret = proxy->AppFileReady(fileName, 0, 0); - EXPECT_NE(ret, BError(BError::Codes::OK)); - fileName = "name"; - ret = proxy->AppFileReady(fileName, -1, 0); - EXPECT_NE(ret, BError(BError::Codes::OK)); - ret = proxy->AppFileReady(fileName, 0, 0); - EXPECT_NE(ret, BError(BError::BackupErrorCode::E_INVAL)); - bundleName = ""; - fileName = ""; - ret = proxy->GetFileHandle(bundleName, fileName); - EXPECT_EQ(ret, BError(BError::Codes::OK)); - EXPECT_EQ(fileName, ""); - bundleName = "test"; - ret = proxy->GetFileHandle(bundleName, fileName); - EXPECT_EQ(ret, BError(BError::Codes::OK)); - EXPECT_EQ(fileName, ""); - GTEST_LOG_(INFO) << "ServiceClientTest-end SUB_service_client_test_1400"; -} -} // namespace OHOS::FileManagement::Backup \ No newline at end of file -- Gitee