From 50ff966e570b78a289436e0cf3eef6c5e74b7717 Mon Sep 17 00:00:00 2001 From: zhou_xq Date: Tue, 19 Nov 2024 21:20:39 +0800 Subject: [PATCH] =?UTF-8?q?zip=5Fhelper=E9=87=8D=E5=91=BD=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhou_xq --- plugins/faultlogger/service/BUILD.gn | 6 +++--- .../zip_helper.cpp => dfx_bundle_util.cpp} | 6 +++--- .../{sanitizer_collector/zip_helper.h => dfx_bundle_util.h} | 6 +++--- plugins/faultlogger/service/faultlogger.cpp | 2 +- plugins/faultlogger/test/BUILD.gn | 4 ++-- ...zip_helper_unittest.cpp => dfx_bundle_util_unittest.cpp} | 6 +++--- .../test/common/unittest/faultlogger_unittest.cpp | 2 +- 7 files changed, 16 insertions(+), 16 deletions(-) rename plugins/faultlogger/service/{sanitizer_collector/zip_helper.cpp => dfx_bundle_util.cpp} (97%) rename plugins/faultlogger/service/{sanitizer_collector/zip_helper.h => dfx_bundle_util.h} (93%) rename plugins/faultlogger/test/common/unittest/{zip_helper_unittest.cpp => dfx_bundle_util_unittest.cpp} (86%) diff --git a/plugins/faultlogger/service/BUILD.gn b/plugins/faultlogger/service/BUILD.gn index f00f09fc..357b1953 100644 --- a/plugins/faultlogger/service/BUILD.gn +++ b/plugins/faultlogger/service/BUILD.gn @@ -86,12 +86,12 @@ ohos_source_set("faultlogger_service") { ] sources = [ + "dfx_bundle_util.cpp", "faultlog_database.cpp", "faultlog_formatter.cpp", "faultlog_manager.cpp", "faultlogger.cpp", "freeze_json_generator.cpp", - "sanitizer_collector/zip_helper.cpp", ] deps = [ @@ -135,12 +135,12 @@ ohos_source_set("faultlogger_service_with_cfi") { ] sources = [ + "dfx_bundle_util.cpp", "faultlog_database.cpp", "faultlog_formatter.cpp", "faultlog_manager.cpp", "faultlogger.cpp", "freeze_json_generator.cpp", - "sanitizer_collector/zip_helper.cpp", ] deps = [ @@ -180,12 +180,12 @@ ohos_source_set("faultlogger_service_fuzz_src") { defines = [ "UNIT_TEST" ] sources = [ + "dfx_bundle_util.cpp", "faultlog_database.cpp", "faultlog_formatter.cpp", "faultlog_manager.cpp", "faultlogger.cpp", "freeze_json_generator.cpp", - "sanitizer_collector/zip_helper.cpp", ] deps = [ diff --git a/plugins/faultlogger/service/sanitizer_collector/zip_helper.cpp b/plugins/faultlogger/service/dfx_bundle_util.cpp similarity index 97% rename from plugins/faultlogger/service/sanitizer_collector/zip_helper.cpp rename to plugins/faultlogger/service/dfx_bundle_util.cpp index 8696344b..463a3713 100644 --- a/plugins/faultlogger/service/sanitizer_collector/zip_helper.cpp +++ b/plugins/faultlogger/service/dfx_bundle_util.cpp @@ -13,7 +13,7 @@ * limitations under the License. */ -#include "zip_helper.h" +#include "dfx_bundle_util.h" #include #include @@ -42,10 +42,10 @@ #include "parameter_ex.h" #undef LOG_DOMAIN -#define LOG_DOMAIN 0xD002D12 +#define LOG_DOMAIN 0xD002D11 #undef LOG_TAG -#define LOG_TAG "Sanitizer" +#define LOG_TAG "DfxBundleUtil" namespace OHOS { namespace HiviewDFX { diff --git a/plugins/faultlogger/service/sanitizer_collector/zip_helper.h b/plugins/faultlogger/service/dfx_bundle_util.h similarity index 93% rename from plugins/faultlogger/service/sanitizer_collector/zip_helper.h rename to plugins/faultlogger/service/dfx_bundle_util.h index 294a5ef9..7b7f0a82 100644 --- a/plugins/faultlogger/service/sanitizer_collector/zip_helper.h +++ b/plugins/faultlogger/service/dfx_bundle_util.h @@ -13,8 +13,8 @@ * limitations under the License. */ -#ifndef SANITIZERD_ZIPHELPER_H -#define SANITIZERD_ZIPHELPER_H +#ifndef DFX_BUNDLE_UTIL_H +#define DFX_BUNDLE_UTIL_H #include #include #include @@ -40,5 +40,5 @@ bool GetDfxBundleInfo(const std::string& bundleName, DfxBundleInfo& bundleInfo); } // namespace HiviewDFX } // namespace OHOS -#endif // SANITIZERD_ZIPHELPER_H +#endif // DFX_BUNDLE_UTIL_H diff --git a/plugins/faultlogger/service/faultlogger.cpp b/plugins/faultlogger/service/faultlogger.cpp index f6260fbb..e6706289 100644 --- a/plugins/faultlogger/service/faultlogger.cpp +++ b/plugins/faultlogger/service/faultlogger.cpp @@ -66,7 +66,7 @@ #include "string_util.h" #include "sys_event_dao.h" #include "time_util.h" -#include "zip_helper.h" +#include "dfx_bundle_util.h" #include "freeze_json_generator.h" #include "freeze_json_util.h" diff --git a/plugins/faultlogger/test/BUILD.gn b/plugins/faultlogger/test/BUILD.gn index 86ff7fb4..a0af05a4 100644 --- a/plugins/faultlogger/test/BUILD.gn +++ b/plugins/faultlogger/test/BUILD.gn @@ -40,16 +40,16 @@ ohos_unittest("FaultloggerUnittest") { cflags = [ "-Dprivate=public" ] sources = [ + "$hiview_faultlogger/service/dfx_bundle_util.cpp", "$hiview_faultlogger/service/faultlog_database.cpp", "$hiview_faultlogger/service/faultlog_formatter.cpp", "$hiview_faultlogger/service/faultlog_manager.cpp", "$hiview_faultlogger/service/faultlogger.cpp", "$hiview_faultlogger/service/freeze_json_generator.cpp", - "$hiview_faultlogger/service/sanitizer_collector/zip_helper.cpp", "common/faultevent_listener.cpp", + "common/unittest/dfx_bundle_util_unittest.cpp", "common/unittest/faultlog_formatter_unittest.cpp", "common/unittest/faultlogger_unittest.cpp", - "common/unittest/zip_helper_unittest.cpp", ] cflags_cc = [ "-Dprivate=public", diff --git a/plugins/faultlogger/test/common/unittest/zip_helper_unittest.cpp b/plugins/faultlogger/test/common/unittest/dfx_bundle_util_unittest.cpp similarity index 86% rename from plugins/faultlogger/test/common/unittest/zip_helper_unittest.cpp rename to plugins/faultlogger/test/common/unittest/dfx_bundle_util_unittest.cpp index cb5a29f7..410cd878 100644 --- a/plugins/faultlogger/test/common/unittest/zip_helper_unittest.cpp +++ b/plugins/faultlogger/test/common/unittest/dfx_bundle_util_unittest.cpp @@ -15,19 +15,19 @@ #include #include -#include "zip_helper.h" +#include "dfx_bundle_util.h" using namespace testing::ext; namespace OHOS { namespace HiviewDFX { -class ZipHeloerUnittest : public testing::Test {}; +class DfxBundleUtilUnittest : public testing::Test {}; /** * @tc.name: IsModuleNameValidTest001 * @tc.desc: Test IsModuleNameValid error branch * @tc.type: FUNC */ -HWTEST_F(ZipHeloerUnittest, IsModuleNameValidTest001, testing::ext::TestSize.Level1) +HWTEST_F(DfxBundleUtilUnittest, IsModuleNameValidTest001, testing::ext::TestSize.Level1) { std::string name; auto result = IsModuleNameValid(name); diff --git a/plugins/faultlogger/test/common/unittest/faultlogger_unittest.cpp b/plugins/faultlogger/test/common/unittest/faultlogger_unittest.cpp index 6049b5d6..9c587ad3 100644 --- a/plugins/faultlogger/test/common/unittest/faultlogger_unittest.cpp +++ b/plugins/faultlogger/test/common/unittest/faultlogger_unittest.cpp @@ -46,7 +46,7 @@ #include "log_analyzer.h" #include "sys_event.h" #include "sys_event_dao.h" -#include "zip_helper.h" +#include "dfx_bundle_util.h" using namespace testing::ext; using namespace OHOS::HiviewDFX;