Fix ScopedFD usage in unit test

Fixes a minor detail in the CrashReportDatabaseTest.CleanBrokenDatabase
test wherein a ScopedFD is explicitly closed before being released.
Despite being technically safe in this instance, an impending upstream
Chromium change to track and enforce ScopedFD ownership will catch this
as a potential bug and intentionally crash the test.

Change-Id: Ie5c2c84d7501036d16f990bb6093fcd406fa598d
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2898048
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Commit-Queue: Ken Rockot <rockot@google.com>
This commit is contained in:
Ken Rockot 2021-05-14 13:13:23 -07:00 committed by Commit Bot
parent e841b92e18
commit a6494f9df6

View File

@ -828,8 +828,7 @@ TEST_F(CrashReportDatabaseTest, CleanBrokenDatabase) {
ASSERT_TRUE(LoggingWriteFile(
handle.get(), &expired_timestamp, sizeof(expired_timestamp)));
ASSERT_TRUE(LoggingCloseFile(handle.get()));
ignore_result(handle.release());
ASSERT_TRUE(LoggingCloseFile(handle.release()));
EXPECT_EQ(db()->CleanDatabase(0), 1);