From 35662787f479b93b3205310934574132609461cc Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 8 Nov 2011 12:36:25 +0200 Subject: Get rid of special tracer database The include, types, and pragma tests have been moved to the common/ directory while the object test has been merged into common/lifecycle. The transaction test will be re-implemented as common/ test as soon as SQL statement tracing support is merged. --- tracer/transaction/driver.cxx | 92 ------------------------------------------- 1 file changed, 92 deletions(-) delete mode 100644 tracer/transaction/driver.cxx (limited to 'tracer/transaction/driver.cxx') diff --git a/tracer/transaction/driver.cxx b/tracer/transaction/driver.cxx deleted file mode 100644 index e1c7849..0000000 --- a/tracer/transaction/driver.cxx +++ /dev/null @@ -1,92 +0,0 @@ -// file : tracer/transaction/driver.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -// Test transaction operations. -// - -#include -#include - -#include -#include -#include -#include - -using namespace std; -using namespace odb::core; -namespace tracer = odb::tracer; - -int -main () -{ - tracer::database db; - - assert (!transaction::has_current ()); - - // Current and db accessors. - // - cout << "test 001" << endl; - { - transaction t (db.begin ()); - assert (&t.database () == &db); - assert (transaction::has_current ()); - assert (&transaction::current () == &t); - transaction::reset_current (); - assert (!transaction::has_current ()); - transaction t2 (db.begin (), false); - assert (!transaction::has_current ()); - transaction::current (t2); - assert (&transaction::current () == &t2); - } - - // Commit. - // - cout << "test 002" << endl; - { - transaction t (db.begin ()); - t.commit (); - } - - // Rollback. - // - cout << "test 003" << endl; - { - transaction t (db.begin ()); - t.rollback (); - } - - // Auto rollback. - // - cout << "test 004" << endl; - { - transaction t (db.begin ()); - } - - // Nested transaction. - // - cout << "test 005" << endl; - { - transaction t (db.begin ()); - try - { - transaction n (db.begin ()); - } - catch (const already_in_transaction&) - { - cout << "already_in_transaction" << endl; - } - } - - // Concrete transaction type. - // - cout << "test 006" << endl; - { - assert (sizeof (tracer::transaction) == sizeof (transaction)); - - tracer::transaction t (db.begin ()); - tracer::transaction& r (tracer::transaction::current ()); - assert (&t == &r); - } -} -- cgit v1.1