From 76184a056474f149a0ad849a0eb893d9be7b5725 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=BB=E6=9D=B0?= Date: Tue, 8 Oct 2024 17:31:09 +0800 Subject: [PATCH 1/2] Issue:#IAVEW4 Description: modify tdd Sig: SIG_ApplicaitonFramework Feature or Bugfix: Bugfix Binary Source: No Signed-off-by: renjie84 renjie84@huawei.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 任杰 --- test/unittest/bm/bm_command_test.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/test/unittest/bm/bm_command_test.cpp b/test/unittest/bm/bm_command_test.cpp index 1173c76..85e4af4 100644 --- a/test/unittest/bm/bm_command_test.cpp +++ b/test/unittest/bm/bm_command_test.cpp @@ -376,6 +376,7 @@ HWTEST_F(BmCommandTest, Bm_Command_Clean_0006, Function | MediumTest | Level1) BundleManagerShellCommand cmd(argc, argv); // set the mock objects SetMockObjects(cmd); + EXPECT_EQ(cmd.ExecCommand(), STRING_CLEAN_DATA_BUNDLE_NG + "\n"); } -- Gitee From 6370301996af95ad93e81d59558cffa9d423ba19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=BB=E6=9D=B0?= Date: Tue, 8 Oct 2024 17:31:09 +0800 Subject: [PATCH 2/2] Issue:#IAVEW4 Description: modify tdd Sig: SIG_ApplicaitonFramework Feature or Bugfix: Bugfix Binary Source: No Signed-off-by: renjie84 renjie84@huawei.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 任杰 --- frameworks/src/bundle_command.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/frameworks/src/bundle_command.cpp b/frameworks/src/bundle_command.cpp index f285733..a7bbbb6 100644 --- a/frameworks/src/bundle_command.cpp +++ b/frameworks/src/bundle_command.cpp @@ -38,6 +38,7 @@ #include "string_ex.h" #include "app_mgr_client.h" #include "directory_ex.h" +#include namespace OHOS { namespace AppExecFwk { @@ -1080,6 +1081,7 @@ ErrCode BundleManagerShellCommand::RunAsCleanCommand() return ERR_OK; } + std::cout << "tracing enter clean command" << std::endl; APP_LOGI("begin to RunAsCleanCommand"); int32_t result = OHOS::ERR_OK; int32_t counter = 0; @@ -1177,6 +1179,7 @@ ErrCode BundleManagerShellCommand::RunAsCleanCommand() // 'bm clean --data' APP_LOGD("'bm clean %{public}s '", argv_[optind - OFFSET_REQUIRED_ARGUMENT]); cleanData = cleanCache ? false : true; + std::cout << "tracing enter handle d cleanData" << cleanData << std::endl; break; } case 'u': { @@ -1205,6 +1208,8 @@ ErrCode BundleManagerShellCommand::RunAsCleanCommand() } } + std::cout << "tracing enter parse finished" << std::endl; + if (result == OHOS::ERR_OK) { if (resultReceiver_ == "" && bundleName.size() == 0) { // 'bm clean ...' with no bundle name option @@ -1222,6 +1227,7 @@ ErrCode BundleManagerShellCommand::RunAsCleanCommand() if (result != OHOS::ERR_OK) { resultReceiver_.append(HELP_MSG_CLEAN); } else { + std::cout << "tracing enter last phrase begin" << std::endl; // bm clean -c if (cleanCache) { if (CleanBundleCacheFilesOperation(bundleName, userId, appIndex)) { @@ -1232,13 +1238,17 @@ ErrCode BundleManagerShellCommand::RunAsCleanCommand() } // bm clean -d if (cleanData) { + std::cout << "tracing cleanData:true, start, -n" << bundleName << ",-u" << userId << ",appIndex" << appIndex << std::endl; if (CleanBundleDataFilesOperation(bundleName, userId, appIndex)) { + std::cout << "tracing cleanData:true, return ok" << std::endl; resultReceiver_.append(STRING_CLEAN_DATA_BUNDLE_OK + "\n"); } else { + std::cout << "tracing cleanData:true, return ng" << std::endl; resultReceiver_.append(STRING_CLEAN_DATA_BUNDLE_NG + "\n"); } } } + std::cout << "tracing end" << std::endl; APP_LOGI("end"); return result; } -- Gitee