Skip to content

Commit 4ca5af4

Browse files
chinmaygardednfield
authored andcommitted
Fix temporary database file deletion.
1 parent 85b8a00 commit 4ca5af4

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

impeller/archivist/archivist_fixture.cc

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,29 +11,30 @@ namespace testing {
1111

1212
ArchivistFixture::ArchivistFixture() {
1313
std::stringstream stream;
14-
stream << flutter::testing::GetCurrentTestName() << ".db";
15-
archive_file_name_ = fml::paths::JoinPaths(
16-
{flutter::testing::GetFixturesPath(), stream.str()});
14+
stream << "Test" << flutter::testing::GetCurrentTestName() << ".db";
15+
archive_file_name_ = stream.str();
1716
}
1817

1918
ArchivistFixture::~ArchivistFixture() = default;
2019

2120
const std::string ArchivistFixture::GetArchiveFileName() const {
22-
return archive_file_name_;
21+
return fml::paths::JoinPaths(
22+
{flutter::testing::GetFixturesPath(), archive_file_name_});
2323
}
2424

2525
void ArchivistFixture::SetUp() {
2626
DeleteArchiveFile();
2727
}
2828

2929
void ArchivistFixture::TearDown() {
30-
// TODO: Tear this down. For now, I am inspecting the files for readability of
31-
// schema.
32-
// DeleteArchiveFile();
30+
DeleteArchiveFile();
3331
}
3432

3533
void ArchivistFixture::DeleteArchiveFile() const {
36-
fml::UnlinkFile(archive_file_name_.c_str());
34+
auto fixtures = flutter::testing::OpenFixturesDirectory();
35+
if (fml::FileExists(fixtures, archive_file_name_.c_str())) {
36+
fml::UnlinkFile(fixtures, archive_file_name_.c_str());
37+
}
3738
}
3839

3940
} // namespace testing

0 commit comments

Comments
 (0)