WriteSQLiteDB_t.cc
Go to the documentation of this file.
1 #define BOOST_TEST_MODULE (writesqlitedb test)
2 
3 #include "boost/test/unit_test.hpp"
4 
6 
7 #include "sqlite3.h"
8 
9 BOOST_AUTO_TEST_SUITE(write_sqlitedb_test)
10 
11 BOOST_AUTO_TEST_CASE(write_sqlite)
12 {
13  // Create an empty sqlite db on the filesystem, with no schema.
14  sqlite3* db = nullptr;
15  int rc = sqlite3_open_v2(
16  "test.db", &db, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, nullptr);
17 
18  BOOST_TEST(rc == SQLITE_OK);
19  fhicl::parse_file_and_fill_db("db_2.fcl", db);
20  rc = sqlite3_close(db);
21  BOOST_TEST(rc == SQLITE_OK);
22 }
23 
24 BOOST_AUTO_TEST_SUITE_END()
void parse_file_and_fill_db(std::string const &filename, sqlite3 *db)
BOOST_AUTO_TEST_CASE(write_sqlite)
struct sqlite3 sqlite3