From 8fc1b2f223b41480f2fc7b79776409a5f0fec85a Mon Sep 17 00:00:00 2001 From: prabatuty Date: Sat, 7 May 2011 17:57:23 +0000 Subject: [PATCH] trie index tests addition --- test/dbapi/DataType/Makefile | 11 ++++++++++- test/dbapi/DataType/byteinttest.c | 11 +++++++++++ test/dbapi/DataType/chartest.c | 11 +++++++++++ test/dbapi/DataType/exp.test002b | 22 ++++++++++++++++++++++ test/dbapi/DataType/exp.test004b | 22 ++++++++++++++++++++++ test/dbapi/DataType/exp.test006b | 22 ++++++++++++++++++++++ test/dbapi/DataType/exp.test016b | 22 ++++++++++++++++++++++ test/dbapi/DataType/inttest.c | 11 +++++++++++ test/dbapi/DataType/longlongtest.c | 11 +++++++++++ test/dbapi/DataType/longtest.c | 11 +++++++++++ test/dbapi/DataType/shorttest.c | 11 ++++++++++- 11 files changed, 163 insertions(+), 2 deletions(-) create mode 100644 test/dbapi/DataType/exp.test002b create mode 100644 test/dbapi/DataType/exp.test004b create mode 100644 test/dbapi/DataType/exp.test006b create mode 100644 test/dbapi/DataType/exp.test016b diff --git a/test/dbapi/DataType/Makefile b/test/dbapi/DataType/Makefile index 5cd18819..c195b702 100644 --- a/test/dbapi/DataType/Makefile +++ b/test/dbapi/DataType/Makefile @@ -29,7 +29,8 @@ TARGETS = \ test008 test009 test010 test011 test012 test013 test014 \ test015 test016 test017 test018 test019 test020 test021 \ test022 test002a test004a test006a test008a test010a \ - test012a test014a test016a test018a test020a test022a + test012a test014a test016a test018a test020a test022a test002b \ + test004b test006b test016b ifeq ($(PlatForm), supported) all: $(TARGETS) @@ -45,18 +46,24 @@ test002: inttest.c $(CPlus) -DWITHINDEX $(CPlusFlags) -o $@ $< $(INCL) $(LIBS) $(SYSLIBS) test002a: inttest.c $(CPlus) -DWITHTREEINDEX $(CPlusFlags) -o $@ $< $(INCL) $(LIBS) $(SYSLIBS) +test002b: inttest.c + $(CPlus) -DWITHTRIEINDEX $(CPlusFlags) -o $@ $< $(INCL) $(LIBS) $(SYSLIBS) test003: longtest.c $(CPlus) $(CPlusFlags) -o $@ $< $(INCL) $(LIBS) $(SYSLIBS) test004: longtest.c $(CPlus) -DWITHINDEX $(CPlusFlags) -o $@ $< $(INCL) $(LIBS) $(SYSLIBS) test004a: longtest.c $(CPlus) -DWITHTREEINDEX $(CPlusFlags) -o $@ $< $(INCL) $(LIBS) $(SYSLIBS) +test004b: longtest.c + $(CPlus) -DWITHTRIEINDEX $(CPlusFlags) -o $@ $< $(INCL) $(LIBS) $(SYSLIBS) test005: longlongtest.c $(CPlus) $(CPlusFlags) -o $@ $< $(INCL) $(LIBS) $(SYSLIBS) test006: longlongtest.c $(CPlus) $(CPlusFlags) -DWITHINDEX -o $@ $< $(INCL) $(LIBS) $(SYSLIBS) test006a: longlongtest.c $(CPlus) $(CPlusFlags) -DWITHTREEINDEX -o $@ $< $(INCL) $(LIBS) $(SYSLIBS) +test006b: longlongtest.c + $(CPlus) $(CPlusFlags) -DWITHTRIEINDEX -o $@ $< $(INCL) $(LIBS) $(SYSLIBS) test007: shorttest.c $(CPlus) $(CPlusFlags) -o $@ $< $(INCL) $(LIBS) $(SYSLIBS) test008: shorttest.c @@ -87,6 +94,8 @@ test016: chartest.c $(CPlus) -DWITHINDEX $(CPlusFlags) -o $@ $< $(INCL) $(LIBS) $(SYSLIBS) test016a: chartest.c $(CPlus) -DWITHTREEINDEX $(CPlusFlags) -o $@ $< $(INCL) $(LIBS) $(SYSLIBS) +test016b: chartest.c + $(CPlus) -DWITHTRIEINDEX $(CPlusFlags) -o $@ $< $(INCL) $(LIBS) $(SYSLIBS) test017: datetest.c $(CPlus) $(CPlusFlags) -o $@ $< $(INCL) $(LIBS) $(SYSLIBS) test018: datetest.c diff --git a/test/dbapi/DataType/byteinttest.c b/test/dbapi/DataType/byteinttest.c index da64404d..b84c0b0e 100644 --- a/test/dbapi/DataType/byteinttest.c +++ b/test/dbapi/DataType/byteinttest.c @@ -58,6 +58,17 @@ int main() printf("Index created\n"); delete idxInfo; #endif +#ifdef WITHTRIEINDEX + HashIndexInitInfo *idxInfo = new HashIndexInitInfo(); + strcpy(idxInfo->tableName, "t1"); + idxInfo->list.append("f1"); + idxInfo->indType = trieIndex; + rv = dbMgr->createIndex("indx1", idxInfo); + if (rv != OK) { printf("Index creation failed\n"); return -1; } + printf("Index created\n"); + delete idxInfo; +#endif + Table *table = dbMgr->openTable("t1"); if (table == NULL) { printf("Unable to open table\n"); return 4; } diff --git a/test/dbapi/DataType/chartest.c b/test/dbapi/DataType/chartest.c index 44f41992..1c61094c 100644 --- a/test/dbapi/DataType/chartest.c +++ b/test/dbapi/DataType/chartest.c @@ -58,6 +58,17 @@ int main() printf("Index created\n"); delete idxInfo; #endif +#ifdef WITHTRIEINDEX + HashIndexInitInfo *idxInfo = new HashIndexInitInfo(); + strcpy(idxInfo->tableName, "t1"); + idxInfo->list.append("f1"); + idxInfo->indType = trieIndex; + rv = dbMgr->createIndex("indx1", idxInfo); + if (rv != OK) { printf("Index creation failed\n"); return -1; } + printf("Index created\n"); + delete idxInfo; +#endif + Table *table = dbMgr->openTable("t1"); if (table == NULL) { printf("Unable to open table\n"); return 4; } diff --git a/test/dbapi/DataType/exp.test002b b/test/dbapi/DataType/exp.test002b new file mode 100644 index 00000000..0d6b9e58 --- /dev/null +++ b/test/dbapi/DataType/exp.test002b @@ -0,0 +1,22 @@ +Table created +Index created +Operator test for 0 +Operator test for 1 +tuple value is 0 PRABAKARAN0123456750590 +tuple value is 1 PRABAKARAN0123456750590 +tuple value is 2 PRABAKARAN0123456750590 +tuple value is 4 PRABAKARAN0123456750590 +Operator test for 2 +tuple value is 0 PRABAKARAN0123456750590 +tuple value is 1 PRABAKARAN0123456750590 +tuple value is 2 PRABAKARAN0123456750590 +Operator test for 3 +tuple value is 0 PRABAKARAN0123456750590 +tuple value is 1 PRABAKARAN0123456750590 +tuple value is 2 PRABAKARAN0123456750590 +tuple value is 3 PRABAKARAN0123456750590 +Operator test for 4 +tuple value is 4 PRABAKARAN0123456750590 +Operator test for 5 +tuple value is 3 PRABAKARAN0123456750590 +tuple value is 4 PRABAKARAN0123456750590 diff --git a/test/dbapi/DataType/exp.test004b b/test/dbapi/DataType/exp.test004b new file mode 100644 index 00000000..0d6b9e58 --- /dev/null +++ b/test/dbapi/DataType/exp.test004b @@ -0,0 +1,22 @@ +Table created +Index created +Operator test for 0 +Operator test for 1 +tuple value is 0 PRABAKARAN0123456750590 +tuple value is 1 PRABAKARAN0123456750590 +tuple value is 2 PRABAKARAN0123456750590 +tuple value is 4 PRABAKARAN0123456750590 +Operator test for 2 +tuple value is 0 PRABAKARAN0123456750590 +tuple value is 1 PRABAKARAN0123456750590 +tuple value is 2 PRABAKARAN0123456750590 +Operator test for 3 +tuple value is 0 PRABAKARAN0123456750590 +tuple value is 1 PRABAKARAN0123456750590 +tuple value is 2 PRABAKARAN0123456750590 +tuple value is 3 PRABAKARAN0123456750590 +Operator test for 4 +tuple value is 4 PRABAKARAN0123456750590 +Operator test for 5 +tuple value is 3 PRABAKARAN0123456750590 +tuple value is 4 PRABAKARAN0123456750590 diff --git a/test/dbapi/DataType/exp.test006b b/test/dbapi/DataType/exp.test006b new file mode 100644 index 00000000..0d6b9e58 --- /dev/null +++ b/test/dbapi/DataType/exp.test006b @@ -0,0 +1,22 @@ +Table created +Index created +Operator test for 0 +Operator test for 1 +tuple value is 0 PRABAKARAN0123456750590 +tuple value is 1 PRABAKARAN0123456750590 +tuple value is 2 PRABAKARAN0123456750590 +tuple value is 4 PRABAKARAN0123456750590 +Operator test for 2 +tuple value is 0 PRABAKARAN0123456750590 +tuple value is 1 PRABAKARAN0123456750590 +tuple value is 2 PRABAKARAN0123456750590 +Operator test for 3 +tuple value is 0 PRABAKARAN0123456750590 +tuple value is 1 PRABAKARAN0123456750590 +tuple value is 2 PRABAKARAN0123456750590 +tuple value is 3 PRABAKARAN0123456750590 +Operator test for 4 +tuple value is 4 PRABAKARAN0123456750590 +Operator test for 5 +tuple value is 3 PRABAKARAN0123456750590 +tuple value is 4 PRABAKARAN0123456750590 diff --git a/test/dbapi/DataType/exp.test016b b/test/dbapi/DataType/exp.test016b new file mode 100644 index 00000000..143f2d32 --- /dev/null +++ b/test/dbapi/DataType/exp.test016b @@ -0,0 +1,22 @@ +Table created +Index created +Operator test for 0 +Operator test for 1 +tuple value is Value0 PRABAKARAN0123456750590 +tuple value is Value1 PRABAKARAN0123456750590 +tuple value is Value2 PRABAKARAN0123456750590 +tuple value is Value4 PRABAKARAN0123456750590 +Operator test for 2 +tuple value is Value0 PRABAKARAN0123456750590 +tuple value is Value1 PRABAKARAN0123456750590 +tuple value is Value2 PRABAKARAN0123456750590 +Operator test for 3 +tuple value is Value0 PRABAKARAN0123456750590 +tuple value is Value1 PRABAKARAN0123456750590 +tuple value is Value2 PRABAKARAN0123456750590 +tuple value is Value3 PRABAKARAN0123456750590 +Operator test for 4 +tuple value is Value4 PRABAKARAN0123456750590 +Operator test for 5 +tuple value is Value3 PRABAKARAN0123456750590 +tuple value is Value4 PRABAKARAN0123456750590 diff --git a/test/dbapi/DataType/inttest.c b/test/dbapi/DataType/inttest.c index b036468b..eb8a5503 100644 --- a/test/dbapi/DataType/inttest.c +++ b/test/dbapi/DataType/inttest.c @@ -58,6 +58,17 @@ int main() printf("Index created\n"); delete idxInfo; #endif +#ifdef WITHTRIEINDEX + HashIndexInitInfo *idxInfo = new HashIndexInitInfo(); + strcpy(idxInfo->tableName, "t1"); + idxInfo->list.append("f1"); + idxInfo->indType = trieIndex; + rv = dbMgr->createIndex("indx1", idxInfo); + if (rv != OK) { printf("Index creation failed\n"); return -1; } + printf("Index created\n"); + delete idxInfo; +#endif + Table *table = dbMgr->openTable("t1"); if (table == NULL) { printf("Unable to open table\n"); return 4; } table->bindFld("f1", &id); diff --git a/test/dbapi/DataType/longlongtest.c b/test/dbapi/DataType/longlongtest.c index 75ec5962..572fbc0f 100644 --- a/test/dbapi/DataType/longlongtest.c +++ b/test/dbapi/DataType/longlongtest.c @@ -58,6 +58,17 @@ int main() printf("Index created\n"); delete idxInfo; #endif +#ifdef WITHTRIEINDEX + HashIndexInitInfo *idxInfo = new HashIndexInitInfo(); + strcpy(idxInfo->tableName, "t1"); + idxInfo->list.append("f1"); + idxInfo->indType = trieIndex; + rv = dbMgr->createIndex("indx1", idxInfo); + if (rv != OK) { printf("Index creation failed\n"); return -1; } + printf("Index created\n"); + delete idxInfo; +#endif + Table *table = dbMgr->openTable("t1"); if (table == NULL) { printf("Unable to open table\n"); return 4; } diff --git a/test/dbapi/DataType/longtest.c b/test/dbapi/DataType/longtest.c index b0819809..62473de0 100644 --- a/test/dbapi/DataType/longtest.c +++ b/test/dbapi/DataType/longtest.c @@ -58,6 +58,17 @@ int main() printf("Index created\n"); delete idxInfo; #endif +#ifdef WITHTRIEINDEX + HashIndexInitInfo *idxInfo = new HashIndexInitInfo(); + strcpy(idxInfo->tableName, "t1"); + idxInfo->list.append("f1"); + idxInfo->indType = trieIndex; + rv = dbMgr->createIndex("indx1", idxInfo); + if (rv != OK) { printf("Index creation failed\n"); return -1; } + printf("Index created\n"); + delete idxInfo; +#endif + Table *table = dbMgr->openTable("t1"); if (table == NULL) { printf("Unable to open table\n"); return 4; } diff --git a/test/dbapi/DataType/shorttest.c b/test/dbapi/DataType/shorttest.c index f3a4a125..ac0a3e37 100644 --- a/test/dbapi/DataType/shorttest.c +++ b/test/dbapi/DataType/shorttest.c @@ -59,7 +59,16 @@ int main() printf("Index created\n"); delete idxInfo; #endif - +#ifdef WITHTRIEINDEX + HashIndexInitInfo *idxInfo = new HashIndexInitInfo(); + strcpy(idxInfo->tableName, "t1"); + idxInfo->list.append("f1"); + idxInfo->indType = trieIndex; + rv = dbMgr->createIndex("indx1", idxInfo); + if (rv != OK) { printf("Index creation failed\n"); return -1; } + printf("Index created\n"); + delete idxInfo; +#endif Table *table = dbMgr->openTable("t1"); if (table == NULL) { printf("Unable to open table\n"); return 4; } table->bindFld("f1", &id); -- 2.11.4.GIT