Macros | Functions
WriteSQLiteDB_t.cc File Reference
#include "boost/test/unit_test.hpp"
#include "fhiclcpp/DatabaseSupport.h"
#include "sqlite3.h"

Go to the source code of this file.

Macros

#define BOOST_TEST_MODULE   (writesqlitedb test)
 

Functions

 BOOST_AUTO_TEST_CASE (write_sqlite)
 

Macro Definition Documentation

#define BOOST_TEST_MODULE   (writesqlitedb test)

Definition at line 1 of file WriteSQLiteDB_t.cc.

Function Documentation

BOOST_AUTO_TEST_CASE ( write_sqlite  )

Definition at line 11 of file WriteSQLiteDB_t.cc.

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 }
void parse_file_and_fill_db(std::string const &filename, sqlite3 *db)
struct sqlite3 sqlite3