aboutsummaryrefslogtreecommitdiff
path: root/common/erase-query/driver.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2013-06-21 10:39:59 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2013-06-21 10:39:59 +0200
commit6cd8b9f561b912f264ba4f723845935c40a3cb95 (patch)
tree5983e0af3d2ee621242ca6707a58c89b9914d8f0 /common/erase-query/driver.cxx
parent236cd9bb1dd022e64d690c9b0080d1a15c5f61c7 (diff)
Add support for running tests in dynamic multi-database mode
Only possible in the development build system at this stage.
Diffstat (limited to 'common/erase-query/driver.cxx')
-rw-r--r--common/erase-query/driver.cxx30
1 files changed, 15 insertions, 15 deletions
diff --git a/common/erase-query/driver.cxx b/common/erase-query/driver.cxx
index 6c69bfc..302e506 100644
--- a/common/erase-query/driver.cxx
+++ b/common/erase-query/driver.cxx
@@ -12,7 +12,6 @@
#include <odb/database.hxx>
#include <odb/transaction.hxx>
-#include <common/config.hxx> // DATABASE_XXX
#include <common/common.hxx>
#include "test.hxx"
@@ -62,13 +61,14 @@ main (int argc, char* argv[])
{
transaction t (db->begin ());
-#ifndef DATABASE_ORACLE
- assert (db->erase_query<object> (
- "erase_query_object.id < 3") == 2);
-#else
- assert (db->erase_query<object> (
- "\"erase_query_object\".\"id\" < 3") == 2);
-#endif
+
+ if (db->id () != odb::id_oracle)
+ assert (db->erase_query<object> (
+ "erase_query_object.id < 3") == 2);
+ else
+ assert (db->erase_query<object> (
+ "\"erase_query_object\".\"id\" < 3") == 2);
+
db->erase_query<object> ();
t.commit ();
}
@@ -162,13 +162,13 @@ main (int argc, char* argv[])
{
transaction t (db->begin ());
-#ifndef DATABASE_ORACLE
- assert (db->execute ("SELECT * FROM erase_query_object_v "
- "WHERE object_id = 1") == 0);
-#else
- assert (db->execute ("SELECT * FROM \"erase_query_object_v\" "
- "WHERE \"object_id\" = 1") == 0);
-#endif
+
+ if (db->id () != odb::id_oracle)
+ assert (db->execute ("SELECT * FROM erase_query_object_v "
+ "WHERE object_id = 1") == 0);
+ else
+ assert (db->execute ("SELECT * FROM \"erase_query_object_v\" "
+ "WHERE \"object_id\" = 1") == 0);
t.commit ();
}
}