diff --git a/interfaces/inner_api/file_access/src/js_file_access_ext_ability.cpp b/interfaces/inner_api/file_access/src/js_file_access_ext_ability.cpp index 0af42686c445c7b9b7f4b49e4dd53f5acfeaedad..bb9da3dc09b4f9bff22a2467f0a580337e5e063e 100644 --- a/interfaces/inner_api/file_access/src/js_file_access_ext_ability.cpp +++ b/interfaces/inner_api/file_access/src/js_file_access_ext_ability.cpp @@ -244,7 +244,7 @@ int JsFileAccessExtAbility::CallJsMethod(const std::string &funcName, JsRuntime CallJsParam *param = reinterpret_cast(work->data); if (param == nullptr) { HILOG_ERROR("failed to get CallJsParam."); - return; + return; } napi_handle_scope scope = nullptr; diff --git a/test/unittest/external_notify_test.cpp b/test/unittest/external_notify_test.cpp index dbe74f90fab6b388fb1704a8a1281717746c82cf..b419a7cf72b632565000301784beb21746e331c9 100644 --- a/test/unittest/external_notify_test.cpp +++ b/test/unittest/external_notify_test.cpp @@ -49,6 +49,7 @@ vector g_notifyUris; const int SLEEP_TIME = 600 * 1000; const int UID_TRANSFORM_TMP = 20000000; const int UID_DEFAULT = 0; +const int SLEEP_TIME_TWO = 2; shared_ptr g_context = nullptr; void SetNativeToken() @@ -862,7 +863,7 @@ static void RegisterDirNotify(Uri parentUri, std::string dirName, IFileAccessObs usleep(SLEEP_TIME); EXPECT_EQ(g_notifyEvent, DELETE_EVENT); EXPECT_EQ(g_notifyUri, newDirUriTest.ToString()); - sleep(2); + sleep(SLEEP_TIME_TWO); g_fah->UnregisterNotify(newDirUriTest, myObserver); } diff --git a/utils/user_access_tracer.h b/utils/user_access_tracer.h index d0e9c2fbd1db652571d30ae989321cbccfeedfc2..e1d596bf916007bd42f3006a19a51e06788c7da2 100644 --- a/utils/user_access_tracer.h +++ b/utils/user_access_tracer.h @@ -25,7 +25,7 @@ public: virtual ~UserAccessTracer() { - for (int32_t i = 0; i < count_; i++ ) { + for (int32_t i = 0; i < count_; i++) { FinishTrace(HITRACE_TAG_FILEMANAGEMENT); } count_ = 0; @@ -44,7 +44,6 @@ public: } private: int32_t count_ = 0; - }; #endif // OHOS_USER_ACCESS_TRACER