Skip to content

Commit

Permalink
Fix test case
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristianFeldmann committed Dec 3, 2024
1 parent 0a3c5fe commit cba6c64
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion YUViewLib/src/dataSource/DataSourceLocalFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ std::int64_t DataSourceLocalFile::read(ByteVector &buffer, const std::int64_t nr

std::optional<std::int64_t> DataSourceLocalFile::getFileSize() const
{
if (this->filePath.empty())
if (!this->isOk())
return {};

const auto size = std::filesystem::file_size(this->filePath);
Expand Down
2 changes: 1 addition & 1 deletion YUViewUnitTest/dataSource/DataSourceLocalFileTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ TEST(DataSourceLocalFileTest, OpenFileThatDoesNotExist)
DataSourceLocalFile file("/path/to/file/that/does/not/exist");
EXPECT_FALSE(file.isOk());
EXPECT_FALSE(file);
EXPECT_TRUE(file.getFilePath().empty());
EXPECT_FALSE(file.getFilePath().empty());
EXPECT_EQ(file.getInfoList().size(), 0u);
EXPECT_FALSE(file.atEnd());
EXPECT_EQ(file.getPosition(), 0);
Expand Down

0 comments on commit cba6c64

Please sign in to comment.