diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2024-02-02 18:37:48 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2024-02-07 16:21:33 +0300 |
commit | 567871f6803756cec9eb0793ad937579d4864c51 (patch) | |
tree | d23718571621b63b0bc795992b9462dd4dd9107d /odb-tests/evolution/drop-column/driver.cxx | |
parent | 01bf760a937cc80901dac5b14fa8d165761ebd11 (diff) |
Add evolution tests to odb-tests
Also clean up some buildfiles and manifests.
Diffstat (limited to 'odb-tests/evolution/drop-column/driver.cxx')
-rw-r--r-- | odb-tests/evolution/drop-column/driver.cxx | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/odb-tests/evolution/drop-column/driver.cxx b/odb-tests/evolution/drop-column/driver.cxx index 7f0c253..6f2a735 100644 --- a/odb-tests/evolution/drop-column/driver.cxx +++ b/odb-tests/evolution/drop-column/driver.cxx @@ -4,21 +4,23 @@ // Test dropping a column. // -#include <memory> // std::auto_ptr -#include <cassert> +#include <memory> // std::unique_ptr #include <iostream> #include <odb/database.hxx> #include <odb/transaction.hxx> #include <odb/schema-catalog.hxx> -#include <common/common.hxx> +#include <libcommon/common.hxx> #include "test2.hxx" #include "test3.hxx" #include "test2-odb.hxx" #include "test3-odb.hxx" +#undef NDEBUG +#include <cassert> + using namespace std; using namespace odb::core; @@ -27,7 +29,10 @@ main (int argc, char* argv[]) { try { - auto_ptr<database> db (create_database (argc, argv, false)); + unique_ptr<database> db (create_database (argc, argv, false)); + + db->schema_version_table ("evo_drop_c_sv"); + bool embedded (schema_catalog::exists (*db)); // 1 - base version @@ -79,7 +84,7 @@ main (int argc, char* argv[]) // { transaction t (db->begin ()); - auto_ptr<object> p (db->load<object> (1)); + unique_ptr<object> p (db->load<object> (1)); assert (p->str == "abc"); assert (p->num == 123); @@ -104,7 +109,7 @@ main (int argc, char* argv[]) // { transaction t (db->begin ()); - auto_ptr<object> p (db->load<object> (1)); + unique_ptr<object> p (db->load<object> (1)); assert (p->str == "" && p->ptr == 0); db->erase<object1> (value (1, 2)); // SQLite logical delete test. t.commit (); |