diff options
Diffstat (limited to 'odb-tests/sqlite/database')
-rw-r--r-- | odb-tests/sqlite/database/buildfile | 14 | ||||
-rw-r--r-- | odb-tests/sqlite/database/driver.cxx | 40 | ||||
-rw-r--r-- | odb-tests/sqlite/database/testscript | 6 |
3 files changed, 60 insertions, 0 deletions
diff --git a/odb-tests/sqlite/database/buildfile b/odb-tests/sqlite/database/buildfile new file mode 100644 index 0000000..01e4c38 --- /dev/null +++ b/odb-tests/sqlite/database/buildfile @@ -0,0 +1,14 @@ +# file : sqlite/database/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +if ($build.meta_operation != 'dist') +{ + assert ($sqlite) "sqlite should be configured for this test" + assert (!$multi) "multi-database mode is not supported by this test" +} + +import libs = libodb-sqlite%lib{odb-sqlite} + +exe{driver}: {hxx cxx}{*} $libs testscript + +cxx.poptions =+ "-I$out_base" "-I$src_base" diff --git a/odb-tests/sqlite/database/driver.cxx b/odb-tests/sqlite/database/driver.cxx new file mode 100644 index 0000000..5e16653 --- /dev/null +++ b/odb-tests/sqlite/database/driver.cxx @@ -0,0 +1,40 @@ +// file : sqlite/database/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test that database constructors are unambiguous and some other things. +// + +#include <odb/sqlite/database.hxx> + +#undef NDEBUG +#include <cassert> + +namespace sqlite = odb::sqlite; +using namespace sqlite; + +int +main (int argc, char* argv[]) +{ + // Test UTF-16 to UTF-8 conversion. + // +#ifdef _WIN32 + { + database d (L"t\x00C8st"); + assert (d.name () == "t\xC3\x88st"); + } +#endif + + // This code should not execute. + // + if (argc != 0) + return 0; + + { + database d1 ("db1"); + } + + { + database d1 (argc, argv); + database d2 (argc, argv, false); + } +} diff --git a/odb-tests/sqlite/database/testscript b/odb-tests/sqlite/database/testscript new file mode 100644 index 0000000..b9c0f5f --- /dev/null +++ b/odb-tests/sqlite/database/testscript @@ -0,0 +1,6 @@ +# file : sqlite/database/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +: basics +: +$* |