aboutsummaryrefslogtreecommitdiff
path: root/common/container/change-tracking/driver.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'common/container/change-tracking/driver.cxx')
-rw-r--r--common/container/change-tracking/driver.cxx35
1 files changed, 8 insertions, 27 deletions
diff --git a/common/container/change-tracking/driver.cxx b/common/container/change-tracking/driver.cxx
index f7407bd..4894ed9 100644
--- a/common/container/change-tracking/driver.cxx
+++ b/common/container/change-tracking/driver.cxx
@@ -4,26 +4,23 @@
// Test change-tracking containers.
//
-#include <common/config.hxx> // HAVE_CXX11
-
-#include <memory> // std::auto_ptr
-#include <cassert>
+#include <memory> // std::unique_ptr
+#include <utility> // std::move
#include <iostream>
-#ifdef HAVE_CXX11
-# include <utility> // std::move
-#endif
-
#include <odb/tracer.hxx>
#include <odb/session.hxx>
#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;
@@ -58,8 +55,7 @@ static counting_tracer tr;
//
#ifndef _RWSTD_NO_CLASS_PARTIAL_SPEC
-#if !defined (HAVE_CXX11) || \
- (defined (__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 7)
+#if defined (__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 7
struct item {};
template class odb::vector<item>;
template class odb::vector_iterator<odb::vector<item>,
@@ -111,7 +107,7 @@ main (int argc, char* argv[])
#endif
}
- auto_ptr<database> db (create_database (argc, argv));
+ unique_ptr<database> db (create_database (argc, argv));
// Test traits logic.
//
@@ -136,11 +132,7 @@ main (int argc, char* argv[])
//
{
transaction t (db->begin ());
-#ifdef HAVE_CXX11
unique_ptr<object> p (db->load<object> ("1"));
-#else
- auto_ptr<object> p (db->load<object> ("1"));
-#endif
assert (p->s._tracking ());
t.commit ();
}
@@ -554,11 +546,7 @@ main (int argc, char* argv[])
// Armed copy.
//
{
-#ifdef HAVE_CXX11
unique_ptr<object> c;
-#else
- auto_ptr<object> c;
-#endif
{
o.s.pop_back ();
@@ -621,7 +609,6 @@ main (int argc, char* argv[])
// Armed move.
//
-#ifdef HAVE_CXX11
{
unique_ptr<object> c;
@@ -652,7 +639,6 @@ main (int argc, char* argv[])
t.commit ();
}
}
-#endif
// Test mixing "smart" and "dumb" container (specifically, erase(obj)).
//
@@ -699,13 +685,8 @@ main (int argc, char* argv[])
{
session s;
transaction t (db->begin ());
-#ifdef HAVE_CXX11
unique_ptr<inv_object1> p1 (db->load<inv_object1> (o1.id_));
unique_ptr<inv_object2> p2 (db->load<inv_object2> (o2.id_));
-#else
- auto_ptr<inv_object1> p1 (db->load<inv_object1> (o1.id_));
- auto_ptr<inv_object2> p2 (db->load<inv_object2> (o2.id_));
-#endif
assert (p2->o1[0] == p1.get ());
assert (!p2->o1._tracking ());
t.commit ();