Skip to content

Commit 2f63392

Browse files
authored
cleaning test created files after test completion (#1232)
1 parent 7d1a165 commit 2f63392

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

tests/functests/LogSessionDataFuncTests.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,14 @@ std::pair<unsigned long long, std::string> ReadPropertiesFromSessionFile(const c
6969
return std::make_pair(std::stoull(sessionFirstTime), skuID);
7070
}
7171

72-
TEST(LogSessionDataFuncTests, Constructor_SessionFile_FileCreated)
72+
TEST_F(LogSessionDataFuncTests, Constructor_SessionFile_FileCreated)
7373
{
7474
auto logSessionDataProvider = LogSessionDataProvider(SessionFileArgument);
7575
logSessionDataProvider.CreateLogSessionData();
7676
ASSERT_TRUE(MAT::FileExists(SessionFile));
7777
}
7878

79-
TEST(LogSessionDataFuncTests, Constructor_ValidSessionFileExists_MembersSetToExistingFile)
79+
TEST_F(LogSessionDataFuncTests, Constructor_ValidSessionFileExists_MembersSetToExistingFile)
8080
{
8181
const std::string validSessionFirstTime{ "123456" };
8282
const std::string validSkuId{ "abc123" };
@@ -90,7 +90,7 @@ TEST(LogSessionDataFuncTests, Constructor_ValidSessionFileExists_MembersSetToExi
9090
ASSERT_EQ(logSessionData->getSessionSDKUid(), validSkuId);
9191
}
9292

93-
TEST(LogSessionDataFuncTests, Constructor_InvalidSessionFileExists_MembersRegenerated)
93+
TEST_F(LogSessionDataFuncTests, Constructor_InvalidSessionFileExists_MembersRegenerated)
9494
{
9595
const std::string invalidSessionFirstTime{ "not-a-number" };
9696
const std::string validSkuId{ "abc123" };
@@ -104,7 +104,7 @@ TEST(LogSessionDataFuncTests, Constructor_InvalidSessionFileExists_MembersRegene
104104
ASSERT_NE(logSessionData->getSessionSDKUid(), validSkuId);
105105
}
106106

107-
TEST(LogSessionDataFuncTests, Constructor_InvalidSessionFileExists_NewFileWritten)
107+
TEST_F(LogSessionDataFuncTests, Constructor_InvalidSessionFileExists_NewFileWritten)
108108
{
109109
const std::string invalidSessionFirstTime{ "not-a-number" };
110110
const std::string validSkuId{ "abc123" };

tests/unittests/LogSessionDataTests.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -82,5 +82,8 @@ TEST(LogSessionDataTests, getLogSessionData_ValidInput_SessionDataPersists)
8282

8383
ASSERT_EQ(logSessionData1->getSessionFirstTime(), logSessionData2->getSessionFirstTime());
8484
ASSERT_EQ(logSessionData1->getSessionSDKUid(), logSessionData2->getSessionSDKUid());
85+
86+
logSessionDataProvider1.DeleteLogSessionData();
87+
logSessionDataProvider2.DeleteLogSessionData();
8588
}
8689

0 commit comments

Comments
 (0)