diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2024-02-01 15:48:30 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2024-02-01 15:48:30 +0300 |
commit | 16577c5292bf23956a5ce81e7e1fe1c3633b3016 (patch) | |
tree | c8f57395975a0f805aaf33893775b6ba18bd2b49 /libodb-oracle/tests/basics/driver.cxx | |
parent | 1c7f67f47770a0c8591aeff7c54766c6f5d00cca (diff) | |
parent | 62e234c114d2b6ead93a1d39593c66b648c3d0a6 (diff) |
Merge branch 'libodb-oracle' into multi-package
Diffstat (limited to 'libodb-oracle/tests/basics/driver.cxx')
-rw-r--r-- | libodb-oracle/tests/basics/driver.cxx | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/libodb-oracle/tests/basics/driver.cxx b/libodb-oracle/tests/basics/driver.cxx new file mode 100644 index 0000000..38ec6d2 --- /dev/null +++ b/libodb-oracle/tests/basics/driver.cxx @@ -0,0 +1,37 @@ +// file : tests/basics/driver.cxx +// license : ODB NCUEL; see accompanying LICENSE file + +// Basic test to make sure the library is usable. Functionality testing +// is done in the odb-tests package. + +#include <cassert> +#include <sstream> + +#include <odb/oracle/database.hxx> +#include <odb/oracle/exceptions.hxx> +#include <odb/oracle/transaction.hxx> + +using namespace odb::oracle; + +int +main () +{ + { + std::ostringstream os; + database::print_usage (os); + assert (!os.str ().empty ()); + } + + // We can't really do much here since that would require a database. We can + // create a fake database object as long as we don't expect to get a valid + // connection. + // + database db ("john", "secret", "dummy whammy"); + + try + { + transaction t (db.begin ()); + assert (false); + } + catch (const database_exception&) {} +} |