From fc3fb39c90ab7fe5fccbe3f3bc0eb2645157bb96 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Wed, 13 Dec 2023 21:57:53 +0300 Subject: Switch to build2 --- common/threads/driver.cxx | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'common/threads/driver.cxx') diff --git a/common/threads/driver.cxx b/common/threads/driver.cxx index 3a2d408..1add011 100644 --- a/common/threads/driver.cxx +++ b/common/threads/driver.cxx @@ -5,9 +5,8 @@ // #include -#include // std::auto_ptr +#include // std::unique_ptr #include // std::size_t -#include #include #include @@ -16,16 +15,19 @@ #include #include -#include // DATABASE_* -#include +#include // DATABASE_* +#include -#if defined(DATABASE_SQLITE) || defined(DATABASE_COMMON) +#if defined(DATABASE_SQLITE) # include #endif #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; using namespace odb::core; namespace details = odb::details; @@ -61,6 +63,7 @@ struct task try { transaction t (db_.begin ()); + db_.persist (o1); db_.persist (o2); db_.persist (o3); @@ -74,7 +77,7 @@ struct task { try { -#if !defined(DATABASE_SQLITE) && !defined(DATABASE_COMMON) +#if !defined(DATABASE_SQLITE) transaction t (db_.begin ()); #else // SQLite has a peculiar table locking mode (shared cache) @@ -93,7 +96,7 @@ struct task static_cast (db_).begin_immediate ()); } #endif - auto_ptr o (db_.load (id)); + unique_ptr o (db_.load (id)); assert (o->str_ == "first object"); o->str_ = "another value"; db_.update (*o); @@ -178,7 +181,7 @@ struct task bool test (int argc, char* argv[], size_t max_connections) { - auto_ptr db (create_database (argc, argv, true, max_connections)); + unique_ptr db (create_database (argc, argv, true, max_connections)); vector > threads; vector > tasks; -- cgit v1.1