diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2023-12-13 21:57:53 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2024-01-23 21:20:44 +0300 |
commit | fc3fb39c90ab7fe5fccbe3f3bc0eb2645157bb96 (patch) | |
tree | 6c8c1bfb5fe89f7378b92ac066b4ca8ecfd25228 /common/optimistic/driver.cxx | |
parent | 02367faedb16b6186e8852de47e5b749dc48c2df (diff) |
Switch to build2
Diffstat (limited to 'common/optimistic/driver.cxx')
-rw-r--r-- | common/optimistic/driver.cxx | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/common/optimistic/driver.cxx b/common/optimistic/driver.cxx index 3d33eb4..6dfec6e 100644 --- a/common/optimistic/driver.cxx +++ b/common/optimistic/driver.cxx @@ -4,23 +4,25 @@ // Test optimistic concurrency support. // -#include <memory> // std::auto_ptr -#include <cassert> +#include <memory> // std::unique_ptr #include <iostream> #include <odb/database.hxx> #include <odb/transaction.hxx> -#include <common/common.hxx> +#include <libcommon/common.hxx> #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include <cassert> + using namespace std; using namespace odb::core; unsigned long -version (const auto_ptr<database>& db, unsigned long id) +version (const unique_ptr<database>& db, unsigned long id) { typedef odb::query<object_version> query; typedef odb::result<object_version> result; @@ -34,7 +36,7 @@ main (int argc, char* argv[]) { try { - auto_ptr<database> db (create_database (argc, argv)); + unique_ptr<database> db (create_database (argc, argv)); object o (1); o.num = 123; @@ -80,7 +82,7 @@ main (int argc, char* argv[]) // { transaction t (db->begin ()); - auto_ptr<object> o1 (db->load<object> (1)); + unique_ptr<object> o1 (db->load<object> (1)); t.commit (); assert (o1->ver == 2 && o1->num == 124 && o1->str == "abcd"); @@ -103,7 +105,7 @@ main (int argc, char* argv[]) // Verify the data hasn't changed. // - auto_ptr<object> o1 (db->load<object> (1)); + unique_ptr<object> o1 (db->load<object> (1)); assert (o1->ver == 2 && o1->num == 124 && o1->str == "abcd"); // Reload the object. @@ -201,7 +203,7 @@ main (int argc, char* argv[]) // Verify the container data hasn't changed. // - auto_ptr<container> o1 (db->load<container> ("abc")); + unique_ptr<container> o1 (db->load<container> ("abc")); assert (o1->nums.size () == 2 && o1->nums[0] == 1 && o1->nums[1] == 2); t.commit (); |