aboutsummaryrefslogtreecommitdiff
path: root/sqlite
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2011-08-24 17:13:55 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2011-08-24 17:13:55 +0200
commitff3950866c0f756a5b6f379b9f95f01fff4a9ec7 (patch)
tree1171b1c1ecd9cffc5022d34d8d411846b98adf09 /sqlite
parent1fca8273447e0048941bbfe8ca23466f103c42f3 (diff)
Make tests use unique table prefixes
Diffstat (limited to 'sqlite')
-rw-r--r--sqlite/native/driver.cxx18
-rw-r--r--sqlite/template/makefile3
-rw-r--r--sqlite/truncation/makefile2
-rw-r--r--sqlite/types/makefile4
4 files changed, 17 insertions, 10 deletions
diff --git a/sqlite/native/driver.cxx b/sqlite/native/driver.cxx
index 73e0450..7f1d319 100644
--- a/sqlite/native/driver.cxx
+++ b/sqlite/native/driver.cxx
@@ -30,8 +30,8 @@ main (int argc, char* argv[])
{
transaction t (db->begin ());
- db->execute ("DROP TABLE IF EXISTS test");
- db->execute ("CREATE TABLE test (n INTEGER PRIMARY KEY)");
+ db->execute ("DROP TABLE IF EXISTS sqlitex_native_test");
+ db->execute ("CREATE TABLE sqlitex_native_test (n INTEGER PRIMARY KEY)");
t.commit ();
}
@@ -41,8 +41,11 @@ main (int argc, char* argv[])
{
transaction t (db->begin ());
- assert (db->execute ("INSERT INTO test (n) VALUES (1)") == 1);
- assert (db->execute ("INSERT INTO test (n) VALUES (2)") == 1);
+ assert (
+ db->execute ("INSERT INTO sqlitex_native_test (n) VALUES (1)") == 1);
+
+ assert (
+ db->execute ("INSERT INTO sqlitex_native_test (n) VALUES (2)") == 1);
t.commit ();
}
@@ -52,8 +55,11 @@ main (int argc, char* argv[])
{
transaction t (db->begin ());
- assert (db->execute ("SELECT n FROM test WHERE n < 3") == 2);
- assert (db->execute ("SELECT n FROM test WHERE n > 3") == 0);
+ assert (
+ db->execute ("SELECT n FROM sqlitex_native_test WHERE n < 3") == 2);
+
+ assert (
+ db->execute ("SELECT n FROM sqlitex_native_test WHERE n > 3") == 0);
t.commit ();
}
diff --git a/sqlite/template/makefile b/sqlite/template/makefile
index bf2f178..bb63095 100644
--- a/sqlite/template/makefile
+++ b/sqlite/template/makefile
@@ -35,7 +35,8 @@ gen := $(addprefix $(out_base)/,$(genf))
$(gen): $(odb)
$(gen): odb := $(odb)
-$(gen) $(dist): export odb_options += --database sqlite --generate-schema
+$(gen) $(dist): export odb_options += --database sqlite --generate-schema \
+--table-prefix sqlitex_template_ #@@ CHANGE THIS
$(gen): cpp_options := -I$(src_base)
$(gen): $(common.l.cpp-options)
diff --git a/sqlite/truncation/makefile b/sqlite/truncation/makefile
index 8b00a1c..33c7f46 100644
--- a/sqlite/truncation/makefile
+++ b/sqlite/truncation/makefile
@@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf))
$(gen): $(odb)
$(gen): odb := $(odb)
$(gen) $(dist): export odb_options += --database sqlite --generate-query \
---generate-schema
+--generate-schema --table-prefix sqlitex_truncation_
$(gen): cpp_options := -I$(src_base)
$(gen): $(common.l.cpp-options)
diff --git a/sqlite/types/makefile b/sqlite/types/makefile
index 7836a39..bf6235f 100644
--- a/sqlite/types/makefile
+++ b/sqlite/types/makefile
@@ -36,8 +36,8 @@ gen := $(addprefix $(out_base)/,$(genf))
$(gen): $(odb)
$(gen): odb := $(odb)
$(gen) $(dist): export odb_options += --database sqlite --generate-schema \
---generate-query --cxx-prologue '\#include "traits.hxx"'
-
+--generate-query --cxx-prologue '\#include "traits.hxx"' \
+--table-prefix sqlitex_types_
$(gen): cpp_options := -I$(src_base)
$(gen): $(common.l.cpp-options)