simplify test use case

This commit is contained in:
Martin Brodbeck 2018-07-11 11:53:15 +02:00
parent 1778f48bc6
commit 59e7634712

View file

@ -8,18 +8,8 @@
BOOST_AUTO_TEST_CASE(create_database) BOOST_AUTO_TEST_CASE(create_database)
{ {
std::filesystem::path testPath = std::filesystem::temp_directory_path() / "kima2test.db";
if (std::filesystem::exists(testPath)) {
std::filesystem::remove(testPath);
}
std::string filename = testPath.generic_string(); Database db(":memory:");
BOOST_CHECK_NO_THROW(db.init());
Database db(filename);
db.init();
BOOST_TEST(std::filesystem::exists(testPath) == true);
if (std::filesystem::exists(testPath)) {
std::filesystem::remove(testPath);
}
} }