summaryrefslogtreecommitdiff
path: root/server/src/pracrodaopgsql.cc
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/pracrodaopgsql.cc')
-rw-r--r--server/src/pracrodaopgsql.cc21
1 files changed, 20 insertions, 1 deletions
diff --git a/server/src/pracrodaopgsql.cc b/server/src/pracrodaopgsql.cc
index 7159b03..c1ec9b1 100644
--- a/server/src/pracrodaopgsql.cc
+++ b/server/src/pracrodaopgsql.cc
@@ -60,7 +60,7 @@ PracroDAOPgsql::PracroDAOPgsql(std::string _host, std::string _port, std::string
PracroDAOPgsql::~PracroDAOPgsql()
{
- if(conn) delete conn;
+ if(conn) delete conn;
}
void PracroDAOPgsql::commitTransaction(std::string user, std::string patientid, Macro &_macro, Fields &fields, time_t now)
@@ -305,3 +305,22 @@ std::vector<Fieldname> PracroDAOPgsql::getFieldnames()
}
#endif/*WITHOUT_DB*/
+
+#ifdef TEST_PRACRODAOPGSQL
+
+#include "configuration.h"
+#include "exception.h"
+
+int main()
+{
+#ifndef WITHOUT_DB
+ try {
+ PracroDAOPgsql db(Conf::database_addr, "", Conf::database_user, Conf::database_passwd, "");
+ } catch(Exception &e) {
+ printf("ERROR: %s\n", e.what());
+ return 1;
+ }
+#endif/*WITHOUT_DB*/
+ return 0;
+}
+#endif/*TEST_PRACRODAOPGSQL*/