From 82731e1feb209ed9bdcc53ec459c6bda332b4197 Mon Sep 17 00:00:00 2001 From: "@ran-zhao-yu" Date: Tue, 3 Jun 2025 19:54:23 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dtdd=E4=B8=AD=E9=80=94?= =?UTF-8?q?=E9=80=80=E5=87=BA=E5=91=8A=E8=AD=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: @ran-zhao-yu --- .../fontmgr/test/unittest/src/font_manager_test.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/frameworks/fontmgr/test/unittest/src/font_manager_test.cpp b/frameworks/fontmgr/test/unittest/src/font_manager_test.cpp index 30514c4..86fe9cc 100644 --- a/frameworks/fontmgr/test/unittest/src/font_manager_test.cpp +++ b/frameworks/fontmgr/test/unittest/src/font_manager_test.cpp @@ -376,6 +376,7 @@ HWTEST_F(FontManagerTest, FontManagerFuncTest012, TestSize.Level1) } EXPECT_EQ(ret, SUCCESS); fd = open(fontPath4.c_str(), O_RDONLY); + ASSERT_TRUE(FileUtils::CheckPathExist("/data/test/testRepeats/")); FileUtils::CopyFile(fd, fontPath5); if (fd > 0) { close(fd); @@ -387,9 +388,6 @@ HWTEST_F(FontManagerTest, FontManagerFuncTest012, TestSize.Level1) close(fd); } EXPECT_EQ(ret, SUCCESS); - if (!FileUtils::CheckPathExist("/data/test/testRepeats/")) { - return; - } std::filesystem::path rPath("/data/test/testRepeats/"); for (const auto &file : std::filesystem::directory_iterator(rPath)) { if (file.is_regular_file()) { @@ -419,6 +417,7 @@ HWTEST_F(FontManagerTest, FontManagerFuncTest013, TestSize.Level1) } EXPECT_EQ(ret, SUCCESS); fd = open(fontPath3.c_str(), O_RDONLY); + ASSERT_TRUE(FileUtils::CheckPathExist("/data/test/testRepeats/")); FileUtils::CopyFile(fd, fontPath6); if (fd > 0) { close(fd); @@ -430,9 +429,6 @@ HWTEST_F(FontManagerTest, FontManagerFuncTest013, TestSize.Level1) close(fd); } EXPECT_EQ(ret, SUCCESS); - if (!FileUtils::CheckPathExist("/data/test/testRepeats/")) { - return; - } std::filesystem::path rPath("/data/test/testRepeats/"); for (const auto &file : std::filesystem::directory_iterator(rPath)) { if (file.is_regular_file()) { -- Gitee From b43bf0c1b91299ef3031f4ded35844ca24c80656 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=89=E5=8F=AC=E5=AE=87?= Date: Wed, 4 Jun 2025 01:53:20 +0000 Subject: [PATCH 2/2] update frameworks/fontmgr/test/unittest/src/font_manager_test.cpp. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 冉召宇 --- frameworks/fontmgr/test/unittest/src/font_manager_test.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frameworks/fontmgr/test/unittest/src/font_manager_test.cpp b/frameworks/fontmgr/test/unittest/src/font_manager_test.cpp index 86fe9cc..9c821a3 100644 --- a/frameworks/fontmgr/test/unittest/src/font_manager_test.cpp +++ b/frameworks/fontmgr/test/unittest/src/font_manager_test.cpp @@ -375,8 +375,8 @@ HWTEST_F(FontManagerTest, FontManagerFuncTest012, TestSize.Level1) close(fd); } EXPECT_EQ(ret, SUCCESS); - fd = open(fontPath4.c_str(), O_RDONLY); ASSERT_TRUE(FileUtils::CheckPathExist("/data/test/testRepeats/")); + fd = open(fontPath4.c_str(), O_RDONLY); FileUtils::CopyFile(fd, fontPath5); if (fd > 0) { close(fd); @@ -416,8 +416,8 @@ HWTEST_F(FontManagerTest, FontManagerFuncTest013, TestSize.Level1) close(fd); } EXPECT_EQ(ret, SUCCESS); - fd = open(fontPath3.c_str(), O_RDONLY); ASSERT_TRUE(FileUtils::CheckPathExist("/data/test/testRepeats/")); + fd = open(fontPath3.c_str(), O_RDONLY); FileUtils::CopyFile(fd, fontPath6); if (fd > 0) { close(fd); -- Gitee