From 33615c685523e5f282bc585efa0ff31df7dd3742 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Thu, 20 Oct 2011 11:04:13 +0200 Subject: Add common tests for Oracle Due to the 30 character limit imposed by Oracle on identifiers, some of the common tests code and/or makefiles had to be modified. --- common/auto/makefile | 2 +- common/container/makefile | 2 +- common/container/test.hxx | 6 +++++- common/lazy-ptr/driver.cxx | 1 - common/lazy-ptr/makefile | 2 +- common/lifecycle/makefile | 2 +- common/makefile | 40 +++++++++++++++++++++++++--------------- common/schema/makefile | 2 +- common/wrapper/makefile | 2 +- common/wrapper/test.hxx | 21 ++++++++++++++------- 10 files changed, 50 insertions(+), 30 deletions(-) (limited to 'common') diff --git a/common/auto/makefile b/common/auto/makefile index 1d5b66a..1880cba 100644 --- a/common/auto/makefile +++ b/common/auto/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---table-prefix common_auto_ +--table-prefix cmn_auto_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/container/makefile b/common/container/makefile index fb14cb0..c1b1124 100644 --- a/common/container/makefile +++ b/common/container/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---table-prefix common_container_ +--table-prefix cmn_ctnr_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/container/test.hxx b/common/container/test.hxx index 2e267f6..ec392ec 100644 --- a/common/container/test.hxx +++ b/common/container/test.hxx @@ -54,6 +54,7 @@ struct cont_comp1 { // This composite value does not have any columns. // + #pragma db id_column("obj_id") num_vector sv; // Have the name "conflic" with the one in the object. }; @@ -63,11 +64,14 @@ struct cont_comp2 cont_comp2 (): num (777), str ("ggg") {} int num; + + #pragma db id_column("obj_id") str_list sl; + std::string str; }; -#pragma db object +#pragma db object table("obj") struct object { object (): nv (comp1_.sv), sl (comp2_.sl) {} diff --git a/common/lazy-ptr/driver.cxx b/common/lazy-ptr/driver.cxx index 5f95c9a..d215240 100644 --- a/common/lazy-ptr/driver.cxx +++ b/common/lazy-ptr/driver.cxx @@ -217,7 +217,6 @@ main (int argc, char* argv[]) t.commit (); } - } // TR1. diff --git a/common/lazy-ptr/makefile b/common/lazy-ptr/makefile index 24e6e43..45a6779 100644 --- a/common/lazy-ptr/makefile +++ b/common/lazy-ptr/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---table-prefix common_lazy_ptr_ +--table-prefix cmn_lazy_ptr_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/lifecycle/makefile b/common/lifecycle/makefile index a47d6bf..3fcafce 100644 --- a/common/lifecycle/makefile +++ b/common/lifecycle/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---table-prefix common_lifecycle_ +--table-prefix cmn_lifecycle_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/makefile b/common/makefile index 371ad13..603ea60 100644 --- a/common/makefile +++ b/common/makefile @@ -5,29 +5,39 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make +# @@ Uncomment all tests once Oracle tests have been fully +# implemented +# tests := \ auto \ -callback \ -composite \ -const \ container \ -ctor \ -default \ -enum \ -erase-query \ -inheritance \ -inverse \ lazy-ptr \ lifecycle \ -query \ -relationship \ -relationship-query \ schema \ -template \ -view \ wrapper -thread_tests := threads +#auto \ +#callback \ +#composite \ +#const \ +#container \ +#ctor \ +#default \ +#enum \ +#erase-query \ +#inheritance \ +#inverse \ +#lazy-ptr \ +#lifecycle \ +#query \ +#relationship \ +#relationship-query \ +#schema \ +#template \ +#view \ +#wrapper + +#thread_tests := threads all_tests := $(tests) $(thread_tests) build_tests := $(tests) $(thread_tests) diff --git a/common/schema/makefile b/common/schema/makefile index a0e81eb..e6e36e9 100644 --- a/common/schema/makefile +++ b/common/schema/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---table-prefix common_schema_ +--table-prefix cmn_schema_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/wrapper/makefile b/common/wrapper/makefile index a8477de..7cb4171 100644 --- a/common/wrapper/makefile +++ b/common/wrapper/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---table-prefix common_wrapper_ +--table-prefix cmn_wpr_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/wrapper/test.hxx b/common/wrapper/test.hxx index 6a1e0a9..70bb682 100644 --- a/common/wrapper/test.hxx +++ b/common/wrapper/test.hxx @@ -31,7 +31,7 @@ typedef nullable nullable_string; typedef std::tr1::shared_ptr tr1_nullable_string; #endif -#pragma db object +#pragma db object table("obj") struct object { #pragma db id auto @@ -39,17 +39,17 @@ struct object std::auto_ptr num; - #pragma db null std::auto_ptr str; - nullable_string nstr; + + #pragma db id_column ("id") std::vector nstrs; #ifdef HAVE_TR1_MEMORY #pragma db null tr1_nullable_string tr1_str; - #pragma db value_null + #pragma db value_null id_column("id") std::vector tr1_strs; #endif }; @@ -84,6 +84,7 @@ struct comp2 std::string str; int num; + #pragma db id_column("id") index_column("i") std::vector strs; }; @@ -93,14 +94,17 @@ operator== (const comp2& x, const comp2& y) return x.str == y.str && x.num == y.num && x.strs == y.strs; } -#pragma db object +#pragma db object table("comp_obj") struct comp_object { #pragma db id auto unsigned long id_; std::auto_ptr c1; // Wrapped comp value. + + #pragma db id_column("id") index_column("i") std::vector > vc1; // Container of wrapped comp values. + std::auto_ptr c2; // Container inside wrapped comp value. }; @@ -110,10 +114,12 @@ struct comp_object struct comp3: comp2 { std::auto_ptr c1; + + #pragma db id_column("id") index_column("i") std::vector > vc1; }; -#pragma db object +#pragma db object table("comp_obj2") struct comp_object2 { #pragma db id auto @@ -130,6 +136,7 @@ struct comp_object2 struct cont_comp { int num; + #pragma db id_column("id") std::auto_ptr > strs; }; @@ -139,7 +146,7 @@ operator== (const cont_comp& x, const cont_comp& y) return x.num == y.num && *x.strs == *y.strs; } -#pragma db object +#pragma db object table("cont_obj") struct cont_object { #pragma db id auto -- cgit v1.1