Lines Matching refs:store

29 #include "store/backend.hpp"
37 #include "store/exceptions.hpp"
38 #include "store/metadata.hpp"
57 store::detail::backup_database(fs::path("test.db"), 13);
69 store::detail::backup_database(fs::path("test.db"), 1);
80 ATF_REQUIRE_THROW_RE(store::error, "Cannot open.*foo.db",
81 store::detail::backup_database(fs::path("foo.db"), 5));
96 store::error, "Cannot create.*dir/test.db.v13.backup",
97 store::detail::backup_database(fs::path("dir/test.db"), 13));
105 set_md_var("require.files", store::detail::schema_file().c_str());
111 const store::metadata md = store::detail::initialize(db);
116 ATF_REQUIRE_EQ(store::detail::current_schema_version, md.schema_version());
134 store::detail::current_schema_version = 712;
137 ATF_REQUIRE_THROW_RE(store::error,
139 store::detail::initialize(db));
147 store::detail::current_schema_version = 712;
152 ATF_REQUIRE_THROW_RE(store::error, "Failed to initialize.*:.*foo_bar_baz",
153 store::detail::initialize(db));
162 store::detail::migration_file(5, 9));
171 store::detail::migration_file(5, 9));
180 store::detail::schema_file());
188 store::detail::current_schema_version = 123;
190 store::detail::schema_file());
198 set_md_var("require.files", store::detail::schema_file().c_str());
205 store::detail::initialize(db);
207 store::backend backend = store::backend::open_ro(fs::path("test.db"));
215 ATF_REQUIRE_THROW_RE(store::error, "Cannot open 'missing.db': ",
216 store::backend::open_ro(fs::path("missing.db")));
225 set_md_var("require.files", store::detail::schema_file().c_str());
232 store::detail::initialize(db);
235 ATF_REQUIRE_THROW_RE(store::integrity_error, "metadata.*empty",
236 store::backend::open_ro(fs::path("test.db")));
244 set_md_var("require.files", store::detail::schema_file().c_str());
251 store::detail::initialize(db);
253 store::backend backend = store::backend::open_rw(fs::path("test.db"));
262 set_md_var("require.files", store::detail::schema_file().c_str());
266 store::backend backend = store::backend::open_rw(fs::path("test.db"));
275 set_md_var("require.files", store::detail::schema_file().c_str());
282 store::detail::initialize(db);
285 ATF_REQUIRE_THROW_RE(store::integrity_error, "metadata.*empty",
286 store::backend::open_rw(fs::path("test.db")));