diff options
author | deva <deva> | 2009-07-22 15:00:29 +0000 |
---|---|---|
committer | deva <deva> | 2009-07-22 15:00:29 +0000 |
commit | 7e349e2789a633a6014baea63aeb7932e024c917 (patch) | |
tree | 0b7b20adf693e3991f4410368255fd05aa8aab0d /server/src/pracrodaopgsql.cc | |
parent | 8109ada79a24f03e00ebc199ebfdb58e70b054d9 (diff) |
Changed the way the macros are looked up in the filesystem (now they are parsed and indexed using version numbers). Updated all unit tests, to compile and run again.
Diffstat (limited to 'server/src/pracrodaopgsql.cc')
-rw-r--r-- | server/src/pracrodaopgsql.cc | 21 |
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*/ |