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/optimistic/driver.cxx | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'common/optimistic/driver.cxx') 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 // std::auto_ptr -#include +#include // std::unique_ptr #include #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; using namespace odb::core; unsigned long -version (const auto_ptr& db, unsigned long id) +version (const unique_ptr& db, unsigned long id) { typedef odb::query query; typedef odb::result result; @@ -34,7 +36,7 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + unique_ptr 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 o1 (db->load (1)); + unique_ptr o1 (db->load (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 o1 (db->load (1)); + unique_ptr o1 (db->load (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 o1 (db->load ("abc")); + unique_ptr o1 (db->load ("abc")); assert (o1->nums.size () == 2 && o1->nums[0] == 1 && o1->nums[1] == 2); t.commit (); -- cgit v1.1