From 503bfe805df89e8246fa382c7ab663cfb12372f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=BC=E5=8F=A4=E6=8B=89=E6=96=AF=E8=B5=B5=E5=85=AD?= Date: Thu, 14 Aug 2025 10:49:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B5=8B=E8=AF=95=E7=94=A8?= =?UTF-8?q?=E4=BE=8B=E4=B8=AD=E7=9A=84=E6=96=87=E4=BB=B6=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=EF=BC=8C=E9=98=B2=E6=AD=A2=E5=A4=9A=E7=94=A8=E4=BE=8B=E5=90=8C?= =?UTF-8?q?=E6=97=B6=E8=AE=BF=E9=97=AE=E5=90=8C=E4=B8=80=E4=B8=AA=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=AF=BC=E8=87=B4=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 尼古拉斯赵六 --- .../tests/js_pandafile_manager_test.cpp | 54 +++++++++---------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/ecmascript/jspandafile/tests/js_pandafile_manager_test.cpp b/ecmascript/jspandafile/tests/js_pandafile_manager_test.cpp index 0f2e3ea25f..57a4a59c04 100644 --- a/ecmascript/jspandafile/tests/js_pandafile_manager_test.cpp +++ b/ecmascript/jspandafile/tests/js_pandafile_manager_test.cpp @@ -73,7 +73,7 @@ HWTEST_F_L0(JSPandaFileManagerTest, GetInstance) HWTEST_F_L0(JSPandaFileManagerTest, NewJSPandaFile) { Parser parser; - std::string fileName = "__JSPandaFileManagerTest.pa"; + std::string fileName = "__JSPandaFileManagerTest0.pa"; const char *source = R"( .function void foo() {} )"; @@ -86,14 +86,14 @@ HWTEST_F_L0(JSPandaFileManagerTest, NewJSPandaFile) EXPECT_TRUE(pf != nullptr); auto expectFileName = pf->GetJSPandaFileDesc(); - EXPECT_STREQ(expectFileName.c_str(), "__JSPandaFileManagerTest.pa"); + EXPECT_STREQ(expectFileName.c_str(), "__JSPandaFileManagerTest0.pa"); remove(fileName.c_str()); pfManager->RemoveJSPandaFile(pf.get()); } HWTEST_F_L0(JSPandaFileManagerTest, OpenJSPandaFile) { - const char *filename = "__JSPandaFileManagerTest.pa"; + const char *filename = "__JSPandaFileManagerTest1.pa"; const char *data = R"( .function void foo() {} )"; @@ -107,7 +107,7 @@ HWTEST_F_L0(JSPandaFileManagerTest, OpenJSPandaFile) ojspf = pfManager->OpenJSPandaFile(filename); EXPECT_TRUE(ojspf != nullptr); - EXPECT_STREQ(ojspf->GetJSPandaFileDesc().c_str(), "__JSPandaFileManagerTest.pa"); + EXPECT_STREQ(ojspf->GetJSPandaFileDesc().c_str(), "__JSPandaFileManagerTest1.pa"); pfManager->RemoveJSPandaFile(ojspf.get()); remove(filename); @@ -117,8 +117,8 @@ HWTEST_F_L0(JSPandaFileManagerTest, OpenJSPandaFile) HWTEST_F_L0(JSPandaFileManagerTest, Add_Find_Remove_JSPandaFile) { - const char *filename1 = "__JSPandaFileManagerTest1.pa"; - const char *filename2 = "__JSPandaFileManagerTest2.pa"; + const char *filename1 = "__JSPandaFileManagerTest2.pa"; + const char *filename2 = "__JSPandaFileManagerTest3.pa"; const char *data = R"( .function void foo() {} )"; @@ -133,8 +133,8 @@ HWTEST_F_L0(JSPandaFileManagerTest, Add_Find_Remove_JSPandaFile) pfManager->AddJSPandaFile(pf2); std::shared_ptr foundPf1 = pfManager->FindJSPandaFile(filename1); std::shared_ptr foundPf2 = pfManager->FindJSPandaFile(filename2); - EXPECT_STREQ(foundPf1->GetJSPandaFileDesc().c_str(), "__JSPandaFileManagerTest1.pa"); - EXPECT_STREQ(foundPf2->GetJSPandaFileDesc().c_str(), "__JSPandaFileManagerTest2.pa"); + EXPECT_STREQ(foundPf1->GetJSPandaFileDesc().c_str(), "__JSPandaFileManagerTest2.pa"); + EXPECT_STREQ(foundPf2->GetJSPandaFileDesc().c_str(), "__JSPandaFileManagerTest3.pa"); pfManager->RemoveJSPandaFile(pf1.get()); pfManager->RemoveJSPandaFile(pf2.get()); @@ -146,8 +146,8 @@ HWTEST_F_L0(JSPandaFileManagerTest, Add_Find_Remove_JSPandaFile) HWTEST_F_L0(JSPandaFileManagerTest, MultiEcmaVM_Add_Find_Remove_JSPandaFile) { - const char *filename1 = "__JSPandaFileManagerTest1.pa"; - const char *filename2 = "__JSPandaFileManagerTest2.pa"; + const char *filename1 = "__JSPandaFileManagerTest4.pa"; + const char *filename2 = "__JSPandaFileManagerTest5.pa"; const char *data = R"( .function void foo() {} )"; @@ -196,7 +196,7 @@ HWTEST_F_L0(JSPandaFileManagerTest, MultiEcmaVM_Add_Find_Remove_JSPandaFile) void CreateJSPandaFileAndConstpool(EcmaVM *vm) { - const char *filename = "__JSPandaFileManagerTest1.pa"; + const char *filename = "__JSPandaFileManagerTest6.pa"; const char *data = R"( .function void foo() {} )"; @@ -216,7 +216,7 @@ void CreateJSPandaFileAndConstpool(EcmaVM *vm) HWTEST_F_L0(JSPandaFileManagerTest, GC_Add_Find_Remove_JSPandaFile) { - const char *filename = "__JSPandaFileManagerTest1.pa"; + const char *filename = "__JSPandaFileManagerTest7.pa"; JSPandaFileManager *pfManager = JSPandaFileManager::GetInstance(); CreateJSPandaFileAndConstpool(instance); @@ -230,9 +230,9 @@ HWTEST_F_L0(JSPandaFileManagerTest, GC_Add_Find_Remove_JSPandaFile) HWTEST_F_L0(JSPandaFileManagerTest, LoadJSPandaFile) { - const char *filename1 = "__JSPandaFileManagerTest1.pa"; - const char *filename2 = "__JSPandaFileManagerTest2.pa"; - const char *filename3 = "__JSPandaFileManagerTest3.abc"; + const char *filename1 = "__JSPandaFileManagerTest8.pa"; + const char *filename2 = "__JSPandaFileManagerTest9.pa"; + const char *filename3 = "__JSPandaFileManagerTest10.abc"; const char *data = R"( .function void foo() {} )"; @@ -260,9 +260,9 @@ HWTEST_F_L0(JSPandaFileManagerTest, LoadJSPandaFile) EXPECT_TRUE(pf1 == loadedPf1); EXPECT_TRUE(pf2 == loadedPf2); EXPECT_TRUE(pf3 == loadedPf3); - EXPECT_STREQ(loadedPf1->GetJSPandaFileDesc().c_str(), "__JSPandaFileManagerTest1.pa"); - EXPECT_STREQ(loadedPf2->GetJSPandaFileDesc().c_str(), "__JSPandaFileManagerTest2.pa"); - EXPECT_STREQ(loadedPf3->GetJSPandaFileDesc().c_str(), "__JSPandaFileManagerTest3.abc"); + EXPECT_STREQ(loadedPf1->GetJSPandaFileDesc().c_str(), "__JSPandaFileManagerTest8.pa"); + EXPECT_STREQ(loadedPf2->GetJSPandaFileDesc().c_str(), "__JSPandaFileManagerTest9.pa"); + EXPECT_STREQ(loadedPf3->GetJSPandaFileDesc().c_str(), "__JSPandaFileManagerTest10.abc"); pfManager->RemoveJSPandaFile(pf1.get()); pfManager->RemoveJSPandaFile(pf2.get()); @@ -273,7 +273,7 @@ HWTEST_F_L0(JSPandaFileManagerTest, GenerateProgram) { Parser parser; auto vm = thread->GetEcmaVM(); - const char *filename = "__JSPandaFileManagerTest.pa"; + const char *filename = "__JSPandaFileManagerTest11.pa"; const uint8_t *typeDesc = utf::CStringAsMutf8("L_GLOBAL;"); const char *data = R"( .function void foo() {} @@ -304,7 +304,7 @@ HWTEST_F_L0(JSPandaFileManagerTest, GenerateProgram) HWTEST_F_L0(JSPandaFileManagerTest, GetJSPtExtractor) { - const char *filename = "__JSPandaFileManagerTest.pa"; + const char *filename = "__JSPandaFileManagerTest12.pa"; const char *data = R"( .function void foo() {} )"; @@ -322,8 +322,8 @@ HWTEST_F_L0(JSPandaFileManagerTest, GetJSPtExtractor) HWTEST_F_L0(JSPandaFileManagerTest, EnumerateJSPandaFiles) { - const char *filename1 = "__JSPandaFileManagerTest3.pa"; - const char *filename2 = "__JSPandaFileManagerTest4.pa"; + const char *filename1 = "__JSPandaFileManagerTest13.pa"; + const char *filename2 = "__JSPandaFileManagerTest14.pa"; const char *data = R"( .function void foo() {} )"; @@ -347,8 +347,8 @@ HWTEST_F_L0(JSPandaFileManagerTest, EnumerateJSPandaFiles) }); EXPECT_EQ(count, 2); // 2 : test number of files // Sort by the hash value of the element, the output is unordered - EXPECT_STREQ(descList[0].c_str(), "__JSPandaFileManagerTest4.pa"); - EXPECT_STREQ(descList[1].c_str(), "__JSPandaFileManagerTest3.pa"); + EXPECT_STREQ(descList[0].c_str(), "__JSPandaFileManagerTest14.pa"); + EXPECT_STREQ(descList[1].c_str(), "__JSPandaFileManagerTest13.pa"); pfManager->RemoveJSPandaFile(pf1.get()); pfManager->RemoveJSPandaFile(pf2.get()); @@ -357,7 +357,7 @@ HWTEST_F_L0(JSPandaFileManagerTest, EnumerateJSPandaFiles) HWTEST_F_L0(JSPandaFileManagerTest, CheckFilePath) { JSPandaFileManager *pfManager = JSPandaFileManager::GetInstance(); - const char *fileName = "__JSPandaFileManagerTest3.abc"; + const char *fileName = "__JSPandaFileManagerTest15.abc"; const char *data = R"( .function void foo() {} )"; @@ -374,7 +374,7 @@ HWTEST_F_L0(JSPandaFileManagerTest, CheckFilePath) HWTEST_F_L0(JSPandaFileManagerTest, GetJSPandaFileByBufferFiles) { JSPandaFileManager *pfManager = JSPandaFileManager::GetInstance(); - const char *fileName = "__JSPandaFileManagerTest3.abc"; + const char *fileName = "__JSPandaFileManagerTest16.abc"; const char *data = R"( .function void foo() {} )"; @@ -398,7 +398,7 @@ HWTEST_F_L0(JSPandaFileManagerTest, ReleaseSecureMem) JSNApi::SetReleaseSecureMemCallback(FakeReleaseSecureMemCallback); JSPandaFileManager *pfManager = JSPandaFileManager::GetInstance(); - const char *fileName = "__JSPandaFileManagerTest3.abc"; + const char *fileName = "__JSPandaFileManagerTest17.abc"; const char *data = R"( .function void foo() {} )"; -- Gitee