Line data Source code
1 : /*
2 : * confaccessor_test.cpp
3 : *
4 : * Created on: 24 May 2016
5 : * Author: Leonidas Georgopoulos
6 : */
7 :
8 : #define BOOST_TEST_MAIN
9 :
10 : #include "dbe_test_defs.hpp"
11 : #include "dbe/confaccessor.hpp"
12 :
13 : #include <boost/test/unit_test.hpp>
14 :
15 : namespace dbe
16 : {
17 : namespace config
18 : {
19 :
20 : namespace test
21 : {
22 : struct okstestfix:
23 : dbe::test::oksfix
24 : {
25 1 : okstestfix()
26 1 : {
27 1 : ::dbe::confaccessor::setdbinfo(QString::fromStdString(cdbpath + fn), dbtype);
28 1 : }
29 : };
30 :
31 : /*
32 : * Check that the database can be loaded and unloaded
33 : */
34 2 : BOOST_FIXTURE_TEST_CASE(load_test,okstestfix)
35 : {
36 1 : BOOST_TEST_MESSAGE(std::string("Database location:")+cdbpath+fn);
37 :
38 1 : BOOST_CHECK(confaccessor::is_database_loaded()==false);
39 1 : BOOST_CHECK(confaccessor::load());
40 1 : BOOST_CHECK(confaccessor::is_database_loaded());
41 1 : }
42 :
43 : } /* namespace test */
44 :
45 : } /* namespace config */
46 : } /* namespace dbe */
47 :
|