Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add file size to DirectoryEntry #24176

Merged
merged 20 commits into from
Dec 7, 2022
Merged
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions test/common/filesystem/directory_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class DirectoryTest : public testing::Test {
const std::string full_path = dir_path_ + "/" + file_name;
{
const std::ofstream file(full_path);
ASSERT_TRUE(file) << "failed to open test file";
EXPECT_TRUE(file) << "failed to open test file";
jmarantz marked this conversation as resolved.
Show resolved Hide resolved
}
files_to_remove_.push(full_path);
}
Expand All @@ -60,10 +60,10 @@ class DirectoryTest : public testing::Test {
const std::string full_path = absl::StrCat(dir_path_, "/", file_name);
{
std::ofstream file(full_path);
ASSERT_TRUE(file) << "failed to open test file";
EXPECT_TRUE(file) << "failed to open test file";
file << contents;
jmarantz marked this conversation as resolved.
Show resolved Hide resolved
file.close();
ASSERT_TRUE(file) << "failed to write to test file";
EXPECT_TRUE(file) << "failed to write to test file";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry ignorance of ostream but if you fail to write will file become null/false?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It becomes "falsy", because it overrides the bool-cast operator. Can't be null or false, because it's not a pointer.

}
files_to_remove_.push(full_path);
}
Expand Down