Skip to content

Commit

Permalink
Fix path to string conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristianFeldmann committed Jul 26, 2024
1 parent 3a8c9ec commit ca79bfe
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
5 changes: 5 additions & 0 deletions YUViewUnitTest/common/TemporaryFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,9 @@ std::filesystem::path TemporaryFile::getFilePath() const
return this->temporaryFilePath;
}

std::string TemporaryFile::getFilePathString() const
{
return this->temporaryFilePath.string();
}

} // namespace yuviewTest
3 changes: 2 additions & 1 deletion YUViewUnitTest/common/TemporaryFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ class TemporaryFile
~TemporaryFile();

std::filesystem::path getFilePath() const;
std::string getFilePathString() const;

private:
private:
std::filesystem::path temporaryFilePath;
};

Expand Down
2 changes: 1 addition & 1 deletion YUViewUnitTest/filesource/FileSourceAnnexBTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ TEST_P(FileSourceAnnexBTest, TestNalUnitParsing)
const auto [nalSizes, data] = generateAnnexBStream(testParameters);
yuviewTest::TemporaryFile temporaryFile(data);

FileSourceAnnexBFile annexBFile(QString::fromStdString(temporaryFile.getFilePath().string()));
FileSourceAnnexBFile annexBFile(QString::fromStdString(temporaryFile.getFilePathString()));
EXPECT_EQ(static_cast<int>(annexBFile.getNrBytesBeforeFirstNAL()),
testParameters.startCodePositions.at(0));

Expand Down
3 changes: 1 addition & 2 deletions YUViewUnitTest/statistics/StatisticsFileCSVTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,7 @@ TEST(StatisticsFileCSV, testCSVFileParsing)
yuviewTest::TemporaryFile csvFile(getCSVTestData());

stats::StatisticsData statData;
stats::StatisticsFileCSV statFile(QString::fromStdString(csvFile.getFilePath().string()),
statData);
stats::StatisticsFileCSV statFile(QString::fromStdString(csvFile.getFilePathString()), statData);

EXPECT_EQ(statData.getFrameSize(), Size(1920, 1080));

Expand Down
3 changes: 2 additions & 1 deletion YUViewUnitTest/statistics/StatisticsFileVTMBMSTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ TEST(StatisticsFileCSV, testCSVFileParsing)
yuviewTest::TemporaryFile vtmbmsFile(getVTMBSTestData());

stats::StatisticsData statData;
stats::StatisticsFileVTMBMS statFile(QString::fromStdString(vtmbmsFile.getFilePath()), statData);
stats::StatisticsFileVTMBMS statFile(QString::fromStdString(vtmbmsFile.getFilePathString()),
statData);

EXPECT_EQ(statData.getFrameSize(), Size(2048, 872));

Expand Down

0 comments on commit ca79bfe

Please sign in to comment.