diff --git a/interfaces/kits/js/src/mod_fs/fs_utils.cpp b/interfaces/kits/js/src/mod_fs/fs_utils.cpp index ef2e3963b4f65fad8d6fe244db0170d9d0b2a49e..d8331b21bc4480a94e9b1c0acdf3b52035a1a268 100644 --- a/interfaces/kits/js/src/mod_fs/fs_utils.cpp +++ b/interfaces/kits/js/src/mod_fs/fs_utils.cpp @@ -36,8 +36,7 @@ tuple FsUtils::GetActualLen(size_t bufLen, size_t bufOff, const op if (length.has_value()) { int64_t opLength = length.value(); if (opLength < 0 || static_cast(opLength) > retLen) { - HILOGE("Invalid option.length: option.length (%{public}lld), bufLen (%{public}zu), bufOff (%{public}zu)", - opLength, bufLen, bufOff); + HILOGE("Invalid option.length: option.length=%{public}" PRId64 ", retLen=%{public}zu", opLength, retLen); return { false, 0 }; } retLen = static_cast(opLength); diff --git a/interfaces/test/unittest/js/BUILD.gn b/interfaces/test/unittest/js/BUILD.gn index dd2a447577459e321f27b41b2bbd41d1972daf61..31b84da705a2c4753b92d8cf0e770cf9e761bd52 100644 --- a/interfaces/test/unittest/js/BUILD.gn +++ b/interfaces/test/unittest/js/BUILD.gn @@ -67,6 +67,8 @@ ohos_unittest("ani_file_fs_mock_test") { defines = [ "private=public", ] + + use_exceptions = true } ohos_unittest("ani_file_fs_test") { @@ -127,6 +129,8 @@ ohos_unittest("ani_file_fs_test") { defines = [ "private=public", ] + + use_exceptions = true } ohos_unittest("ani_file_hash_test") { @@ -156,6 +160,8 @@ ohos_unittest("ani_file_hash_test") { "googletest:gmock_main", "googletest:gtest_main", ] + + use_exceptions = true } ohos_unittest("ani_file_securitylabel_test") { @@ -183,4 +189,6 @@ ohos_unittest("ani_file_securitylabel_test") { "googletest:gmock_main", "googletest:gtest_main", ] + + use_exceptions = true } \ No newline at end of file diff --git a/interfaces/test/unittest/js/mod_fs/class_stat/fs_stat_mock_test.cpp b/interfaces/test/unittest/js/mod_fs/class_stat/fs_stat_mock_test.cpp index 98093ee64d597f1f91178e95ca74953a6a746321..ea2e168d5195bee7530999b4e7c3c56b30cc8a98 100644 --- a/interfaces/test/unittest/js/mod_fs/class_stat/fs_stat_mock_test.cpp +++ b/interfaces/test/unittest/js/mod_fs/class_stat/fs_stat_mock_test.cpp @@ -13,13 +13,13 @@ * limitations under the License. */ -#include -#include - -#include "fs_stat_entity.h" #include "fs_stat.h" +#include "../properties/mock/system_mock.h" +#include "fs_stat_entity.h" #include "securec.h" -#include "system_mock.h" + +#include +#include namespace OHOS::FileManagement::ModuleFileIO::Test { using namespace testing;