diff options
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; +} |