blob: c478d647c41893784174518a2def47da1783e3e1 [file] [log] [blame]
Alexander Afanasyevb0c78ea2014-04-15 18:12:04 -07001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
Davide Pesavento11904062022-04-14 22:33:28 -04002/*
3 * Copyright (c) 2014-2022, Regents of the University of California.
Alexander Afanasyeve1e6f2a2014-04-25 11:28:12 -07004 *
5 * This file is part of NDN repo-ng (Next generation of NDN repository).
6 * See AUTHORS.md for complete list of repo-ng authors and contributors.
7 *
8 * repo-ng is free software: you can redistribute it and/or modify it under the terms
9 * of the GNU General Public License as published by the Free Software Foundation,
10 * either version 3 of the License, or (at your option) any later version.
11 *
12 * repo-ng is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
13 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 * PURPOSE. See the GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along with
17 * repo-ng, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
Alexander Afanasyevb0c78ea2014-04-15 18:12:04 -070018 */
19
20#ifndef REPO_TESTS_SQLITE_FIXTURE_HPP
21#define REPO_TESTS_SQLITE_FIXTURE_HPP
22
Weiqi Shif0330d52014-07-09 10:54:27 -070023#include "storage/sqlite-storage.hpp"
Alexander Afanasyevb0c78ea2014-04-15 18:12:04 -070024
25#include <boost/filesystem.hpp>
Alexander Afanasyevb0c78ea2014-04-15 18:12:04 -070026
Davide Pesavento11904062022-04-14 22:33:28 -040027namespace repo::tests {
Alexander Afanasyevb0c78ea2014-04-15 18:12:04 -070028
29class SqliteFixture
30{
31public:
32 SqliteFixture()
Weiqi Shif0330d52014-07-09 10:54:27 -070033 : handle(new SqliteStorage("unittestdb"))
Alexander Afanasyevb0c78ea2014-04-15 18:12:04 -070034 {
Alexander Afanasyevb0c78ea2014-04-15 18:12:04 -070035 }
36
37 ~SqliteFixture()
38 {
39 delete handle;
40 boost::filesystem::remove_all(boost::filesystem::path("unittestdb"));
41 }
42
43public:
Weiqi Shif0330d52014-07-09 10:54:27 -070044 SqliteStorage* handle;
Alexander Afanasyevb0c78ea2014-04-15 18:12:04 -070045};
46
Davide Pesavento11904062022-04-14 22:33:28 -040047} // namespace repo::tests
Alexander Afanasyevb0c78ea2014-04-15 18:12:04 -070048
49#endif // REPO_TESTS_SQLITE_FIXTURE_HPP