diff options
author | Andriy Byzhynar (GitHub) <AByzhynar@luxoft.com> | 2016-06-23 17:33:32 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-06-23 17:33:32 +0300 |
commit | 827bcaf0aa39348fa7ec4df796c4e124f7143169 (patch) | |
tree | 517a69ced2f09b702cb2368e7ae412efec2ea838 /src/components/policy/src/sql_pt_representation.cc | |
parent | 833cac1b1de464f53d5709904a4ee24634be2936 (diff) | |
download | sdl_core-827bcaf0aa39348fa7ec4df796c4e124f7143169.tar.gz |
Revert "Cover resumption with unit tests"revert-618-feature/Cover_resumption_with_unit_tests
Diffstat (limited to 'src/components/policy/src/sql_pt_representation.cc')
-rw-r--r-- | src/components/policy/src/sql_pt_representation.cc | 34 |
1 files changed, 8 insertions, 26 deletions
diff --git a/src/components/policy/src/sql_pt_representation.cc b/src/components/policy/src/sql_pt_representation.cc index afd804c722..1cbcd6ccf5 100644 --- a/src/components/policy/src/sql_pt_representation.cc +++ b/src/components/policy/src/sql_pt_representation.cc @@ -45,7 +45,7 @@ #include "utils/file_system.h" #include "utils/gen_hash.h" #include "policy/sql_pt_representation.h" -#include "utils/sql_wrapper.h" +#include "policy/sql_wrapper.h" #include "policy/sql_pt_queries.h" #include "policy/policy_helper.h" #include "policy/cache_manager.h" @@ -69,32 +69,15 @@ void InsertUnique(K value, T* array) { const char* kDatabaseName = "policy"; } // namespace -SQLPTRepresentation::SQLPTRepresentation() - : db_(new utils::dbms::SQLDatabaseImpl(kDatabaseName)) { - is_in_memory = false; -} - -SQLPTRepresentation::SQLPTRepresentation(bool in_memory) { - is_in_memory = in_memory; -#ifdef __QNX__ - db_ = new utils::dbms::SQLDatabaseImpl(kDatabaseName); -#else // __QNX__ - if (in_memory) { - db_ = new utils::dbms::SQLDatabaseImpl(); - } else { - db_ = new utils::dbms::SQLDatabaseImpl(kDatabaseName); - } -#endif // __QNX__ -} - SQLPTRepresentation::SQLPTRepresentation(const std::string& app_storage_folder, uint16_t attempts_to_open_policy_db, uint16_t open_attempt_timeout_ms) #if defined(__QNX__) - : db_(new utils::dbms::SQLDatabaseImpl(kDatabaseName) + : db_(new utils::dbms::SQLDatabase(kDatabaseName) #else - : db_(new utils::dbms::SQLDatabaseImpl( - file_system::ConcatPath(app_storage_folder, kDatabaseName))) + : db_(new utils::dbms::SQLDatabase( + file_system::ConcatPath(app_storage_folder, kDatabaseName), + "PolicyDatabase")) #endif {} @@ -1641,15 +1624,14 @@ const int32_t SQLPTRepresentation::GetDBVersion() const { } utils::dbms::SQLDatabase* SQLPTRepresentation::db() const { -#ifdef __QNX__ - utils::dbms::SQLDatabase* db = - new utils::dbms::SQLDatabaseImpl(kDatabaseName); +#if defined(__QNX__) + utils::dbms::SQLDatabase* db = new utils::dbms::SQLDatabase(kDatabaseName); const bool result = db->Open(); DCHECK(result); return db; #else return db_; -#endif // __QNX__ +#endif } bool SQLPTRepresentation::CopyApplication(const std::string& source, |