diff options
author | methodus <methodus@web.de> | 2012-10-28 20:16:19 +0100 |
---|---|---|
committer | methodus <methodus@web.de> | 2012-10-28 20:16:19 +0100 |
commit | 6dd746005c921dc2c49bf19a3524ea3bfb5e2d30 (patch) | |
tree | 876a7075f299982ef4c0eb188731349c357ad683 /tests | |
parent | 735900e78b42329b6548ff67612c672f5a3fdceb (diff) | |
download | vdr-plugin-upnp-6dd746005c921dc2c49bf19a3524ea3bfb5e2d30.tar.gz vdr-plugin-upnp-6dd746005c921dc2c49bf19a3524ea3bfb5e2d30.tar.bz2 |
Added database wrapper replacement for tntdb. Added a test_programm to verify its functionality.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Makefile | 8 | ||||
-rw-r--r-- | tests/test_database.cpp | 25 |
2 files changed, 30 insertions, 3 deletions
diff --git a/tests/Makefile b/tests/Makefile index c8e6192..35914be 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -1,6 +1,8 @@ - parser: test_parser.cpp ../common/parser.cpp g++ -o test_parser test_parser.cpp ../common/parser.cpp -g -I../include -I/usr/include -I/usr/local/include - + dllloader: dll_loader.cpp ../media/pluginManager.cpp ../common/tools.cpp - g++ -o test_dllloader dll_loader.cpp ../media/pluginManager.cpp ../common/tools.cpp -g -ldl -Wl,--export-dynamic -I../include -I/usr/include -I/usr/local/include
\ No newline at end of file + g++ -o test_dllloader dll_loader.cpp ../media/pluginManager.cpp ../common/tools.cpp -g -ldl -Wl,--export-dynamic -I../include -I/usr/include -I/usr/local/include + +database: test_database.cpp + g++ -o test_database test_database.cpp -g -lsqlite3 -I../include -I/usr/include -I/usr/local/include
\ No newline at end of file diff --git a/tests/test_database.cpp b/tests/test_database.cpp new file mode 100644 index 0000000..da11cb9 --- /dev/null +++ b/tests/test_database.cpp @@ -0,0 +1,25 @@ +/* + * test_database.cpp + * + * Created on: 28.10.2012 + * Author: savop + */ + +#include <iostream> +#include "../include/db/connection.h" + +int main(){ + + try { + db::Connection connection = db::Connect("/tmp/test_db.sqlite"); + + connection.BeginTransaction(); + + connection.RollbackTransaction(); + + } catch (const db::SQLiteException& e){ + std::cerr << "Exception: "<< e.what() << std::endl; + } + + return 0; +} |