| Flutter Impeller |

archivist_fixture.cc
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "impeller/archivist/archivist_fixture.h"
6
7 #include "flutter/fml/paths.h"
8
9 namespace impeller {
10 namespace testing {
11
12 ArchivistFixture::ArchivistFixture() {
13 std::stringstream stream;
14 stream << "Test" << flutter::testing::GetCurrentTestName() << ".db";
15 archive_file_name_ = stream.str();
16 }
17
18 ArchivistFixture::~ArchivistFixture() = default;
19
20 const std::string ArchivistFixture::GetArchiveFileName() const {
21 return fml::paths::JoinPaths(
22 {flutter::testing::GetFixturesPath(), archive_file_name_});
23 }
24
25 void ArchivistFixture::SetUp() {
26 DeleteArchiveFile();
27 }
28
29 void ArchivistFixture::TearDown() {
30 DeleteArchiveFile();
31 }
32
33 void ArchivistFixture::DeleteArchiveFile() const {
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 }
38 }
39
40 } // namespace testing
41 } // namespace impeller
impeller::testing::ArchivistFixture::SetUp
void SetUp() override
Definition: archivist_fixture.cc:25
impeller::testing::ArchivistFixture::~ArchivistFixture
~ArchivistFixture()
archivist_fixture.h
impeller::testing::ArchivistFixture::GetArchiveFileName
const std::string GetArchiveFileName() const
Definition: archivist_fixture.cc:20
impeller::testing::ArchivistFixture::TearDown
void TearDown() override
Definition: archivist_fixture.cc:29
impeller::testing::ArchivistFixture::ArchivistFixture
ArchivistFixture()
Definition: archivist_fixture.cc:12
impeller
Definition: aiks_context.cc:10