From: Adam Dickmeiss Date: Wed, 16 Apr 2008 10:40:13 +0000 (+0200) Subject: Moved test/sort and test/sort to test/api. X-Git-Tag: v2.0.30~7 X-Git-Url: http://sru.miketaylor.org.uk/cgi-bin?a=commitdiff_plain;h=5a4d40ae6b8372f38c1871b493866e2848d125b4;p=idzebra-moved-to-github.git Moved test/sort and test/sort to test/api. --- diff --git a/configure.ac b/configure.ac index 1b539d9..717bd11 100644 --- a/configure.ac +++ b/configure.ac @@ -317,9 +317,9 @@ AC_OUTPUT([ test/xpath/Makefile test/rusmarc/Makefile test/cddb/Makefile test/malxml/Makefile test/mbox/Makefile - test/config/Makefile test/sort2/Makefile + test/config/Makefile test/xelm/Makefile - test/dmoz/Makefile test/sort/Makefile test/zsh/Makefile + test/dmoz/Makefile test/zsh/Makefile test/marcxml/Makefile test/charmap/Makefile test/codec/Makefile test/espec/Makefile test/filters/Makefile diff --git a/test/Makefile.am b/test/Makefile.am index 6d3d247..37edfd9 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS=codec api filters xslt xpath malxml config usmarc dmoz sort \ - sort2 xelm cddb rusmarc zsh marcxml charmap mbox espec gils +SUBDIRS=codec api filters xslt xpath malxml config usmarc dmoz \ + xelm cddb rusmarc zsh marcxml charmap mbox espec gils diff --git a/test/api/.gitignore b/test/api/.gitignore index 2ca133e..c3d3367 100644 --- a/test/api/.gitignore +++ b/test/api/.gitignore @@ -19,6 +19,8 @@ test_special_elements test_zebra_fork test_safari test_sortindex +test_sort1 +test_sort2 *.mf *.LCK *.log diff --git a/test/api/Makefile.am b/test/api/Makefile.am index 1f83bdb..0564f32 100644 --- a/test/api/Makefile.am +++ b/test/api/Makefile.am @@ -7,7 +7,7 @@ check_PROGRAMS = test_start_stop test_result_sets \ test_rank test_private_attset \ test_scan test_create_databases test_resources test_update_record \ test_zebra_fork test_special_elements test_icu_indexing \ - test_sortindex test_safari + test_sortindex test_safari test_sort1 test_sort2 TESTS = $(check_PROGRAMS) @@ -15,7 +15,9 @@ EXTRA_DIST=zebra.cfg test_trunc.cfg test_private_attset.cfg \ private_attset.att private_attset.abs \ test_zebra_fork.cfg \ test_icu_indexing.cfg test_icu_indexing.idx \ - test_safari.cfg test_sortindex.cfg + test_safari.cfg test_sortindex.cfg \ + test_sort1.cfg test_sort1.idx test_sort1.chr sort1.abs \ + test_sort2.cfg test_sort2.idx test_sort2.chr sort2.abs noinst_LIBRARIES = libtestlib.a @@ -31,13 +33,15 @@ test_rank_SOURCES = test_rank.c test_private_attset_SOURCES = test_private_attset.c test_scan_SOURCES = test_scan.c test_create_databases_SOURCES = test_create_databases.c -test_resouces_SOURCES = test_resouces.c +test_resources_SOURCES = test_resources.c test_update_record_SOURCES = test_update_record.c test_zebra_fork_SOURCES = test_zebra_fork.c test_special_elements_SOURCES = test_special_elements.c test_icu_indexing_SOURCES = test_icu_indexing.c test_sortindex_SOURCES = test_sortindex.c -test_safari_SOURCES = test_safari.c testlib.c +test_safari_SOURCES = test_safari.c +test_sort1_SOURCES = test_sort1.c +test_sort2_SOURCES = test_sort2.c AM_CPPFLAGS = -I$(top_srcdir)/include $(YAZINC) diff --git a/test/api/sort1.abs b/test/api/sort1.abs new file mode 100644 index 0000000..27e6237 --- /dev/null +++ b/test/api/sort1.abs @@ -0,0 +1,14 @@ + +name my +reference WAIS-schema +attset bib1.att +tagset generic.tag + +varset var1.var + +esetname B @ +esetname F @ + +elm (2,1) Title !:p,!:w +elm (2,8) Date !:s +elm (2,26) Cost Bib-level:S diff --git a/test/api/sort2.abs b/test/api/sort2.abs new file mode 100644 index 0000000..0c9f8a0 --- /dev/null +++ b/test/api/sort2.abs @@ -0,0 +1,13 @@ + +name my +reference WAIS-schema +attset bib1.att +tagset generic.tag +xpath enable + +varset var1.var + +esetname B @ +esetname F @ + +elm title Title !:p,!:w,!:s diff --git a/test/api/test_sort1.c b/test/api/test_sort1.c new file mode 100644 index 0000000..cbe4ca3 --- /dev/null +++ b/test/api/test_sort1.c @@ -0,0 +1,91 @@ +/* This file is part of the Zebra server. + Copyright (C) 1995-2008 Index Data + +Zebra is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 2, or (at your option) any later +version. + +Zebra is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +*/ + +#include "testlib.h" + +const char *myrec[] = { + "\n" + " first computer\n" + " 2\n" + " 2\n" + "\n" + , + "\n" + " second computer\n" + " 1\n" + " 21\n" + "\n" + , + "\n" + " 3rd computer\n" +" a^3\n" + " 15\n" + "\n" + , + "\n" + " fourth computer\n" + " 4\n" + " 11\n" + "\n" + , + 0 +}; + +static void tst(int argc, char **argv) +{ + ZebraService zs = tl_start_up("test_sort1.cfg", argc, argv); + ZebraHandle zh = zebra_open(zs, 0); + zint ids[5]; + + YAZ_CHECK(tl_init_data(zh, myrec)); + + ids[0] = 3; + ids[1] = 2; + ids[2] = 4; + ids[3] = 5; + YAZ_CHECK(tl_sort(zh, "@or @attr 1=4 computer @attr 7=1 @attr 1=30 0", 4, ids)); + YAZ_CHECK(tl_sort(zh, "@or @attr 1=4 computer @attr 7=1 @attr 1=Date 0", 4, ids)); + + ids[0] = 5; + ids[1] = 4; + ids[2] = 2; + ids[3] = 3; + YAZ_CHECK(tl_sort(zh, "@or @attr 1=4 computer @attr 7=1 @attr 1=1021 0", 4, ids)); + YAZ_CHECK(tl_sort(zh, "@or @attr 1=4 computer @attr 7=1 @attr 1=Bib-Level 0", 4, ids)); + + ids[0] = 2; + ids[1] = 5; + ids[2] = 4; + ids[3] = 3; + YAZ_CHECK(tl_sort(zh, "@or @attr 1=4 computer @attr 7=1 @attr 1=1021 @attr 4=109 0", 4, ids)); + YAZ_CHECK(tl_sort(zh, "@or @attr 1=4 computer @attr 7=1 @attr 1=Bib-Level @attr 4=109 0", 4, ids)); + + YAZ_CHECK(tl_close_down(zh, zs)); +} + + +TL_MAIN +/* + * Local variables: + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + * vim: shiftwidth=4 tabstop=8 expandtab + */ + diff --git a/test/api/test_sort1.cfg b/test/api/test_sort1.cfg new file mode 100644 index 0000000..378a753 --- /dev/null +++ b/test/api/test_sort1.cfg @@ -0,0 +1,13 @@ +# Simple Zebra configuration file +# +# Where the schema files, attribute files, etc are located. +profilePath: ${srcdir:-.}:${srcdir:-.}/../../tab + +# Files that describe the attribute sets supported. +attset: bib1.att +attset: explain.att + +recordtype: grs.sgml +isam: b + +index: test_sort1.idx diff --git a/test/api/test_sort1.chr b/test/api/test_sort1.chr new file mode 100644 index 0000000..8353e8f --- /dev/null +++ b/test/api/test_sort1.chr @@ -0,0 +1,43 @@ +# Generic character map but with ^ as cut char +# + +# Define the basic value-set. *Beware* of changing this without re-indexing +# your databases. + +lowercase {0-9}{a-y}üzæäøöå +uppercase {0-9}{A-Y}ÜZÆÄØÖÅ + +cut ^ + +# Breaking characters + +space {\001-\040}!"#$%&'\()*+,-./:;<=>?@\[\\]_`\{|}~ + +# Characters to be considered equivalent for searching purposes. + +# equivalent æä(ae) +# equivalent øö(oe) +# equivalent å(aa) +# equivalent uü + +# Supplemental mappings + +#map (ä) ä +#map (æ) æ +#map (ø) ø +#map (å) å +#map (ö) ö +#map (Ä) Ä +#map (&Aelig;) Æ +#map (Ø) Ø +#map (Å) Å +#map (Ö) Ö + +#map éÉ e +#map á a +#map ó o +#map í i + +#map (Aa) (AA) + +#map (aa) a diff --git a/test/api/test_sort1.idx b/test/api/test_sort1.idx new file mode 100644 index 0000000..d77ea50 --- /dev/null +++ b/test/api/test_sort1.idx @@ -0,0 +1,58 @@ +# Zebra indexes as referred to from the *.abs-files. +# + +# Traditional word index +# Used if completenss is 'incomplete field' (@attr 6=1) and +# structure is word/phrase/word-list/free-form-text/document-text +index w +completeness 0 +position 1 +charmap string.chr + +# Phrase index +# Used if completeness is 'complete {sub}field' (@attr 6=2, @attr 6=1) +# and structure is word/phrase/word-list/free-form-text/document-text +index p +completeness 1 +charmap string.chr + +# URX (URL) index +# Used if structure=urx (@attr 4=104) +index u +completeness 0 +charmap urx.chr + +# Numeric index +# Used if structure=numeric (@attr 4=109) +index n +completeness 0 +charmap numeric.chr + +# Null map index (no mapping at all) +# Used if structure=key (@attr 4=3) +index 0 +completeness 0 +position 1 +charmap @ + +# Year +# Used if structure=year (@attr 4=4) +index y +completeness 0 +charmap @ + +# Date +# Used if structure=date (@attr 4=5) +index d +completeness 0 +charmap @ + +# Sort register as usual but specify another map : string-hat. +sort s +completeness 1 +charmap test_sort1.chr + +# Sort register with no map +sort S +completeness 1 +charmap string.chr diff --git a/test/api/test_sort2.c b/test/api/test_sort2.c new file mode 100644 index 0000000..95c748e --- /dev/null +++ b/test/api/test_sort2.c @@ -0,0 +1,66 @@ +/* This file is part of the Zebra server. + Copyright (C) 1995-2008 Index Data + +Zebra is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 2, or (at your option) any later +version. + +Zebra is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +*/ + +#include "testlib.h" + +const char *myrec[] = { + "\n" + " first computer\n" + "\n" + , + "\n" + " second computer\n" + "\n" + , + "\n" + " A third computer\n" + "\n" + , + "\n" + " the fourth computer\n" + "\n" + , + 0 }; + +static void tst(int argc, char **argv) +{ + ZebraService zs = tl_start_up("test_sort2.cfg", argc, argv); + ZebraHandle zh = zebra_open(zs, 0); + zint ids[5]; + + YAZ_CHECK(tl_init_data(zh, myrec)); + + ids[0] = 2; + ids[1] = 5; + ids[2] = 3; + ids[3] = 4; + YAZ_CHECK(tl_sort(zh, "@or @attr 1=4 computer @attr 7=1 @attr 1=4 0", 4, ids)); + + YAZ_CHECK(tl_close_down(zh, zs)); +} + +TL_MAIN +/* + * Local variables: + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + * vim: shiftwidth=4 tabstop=8 expandtab + */ + diff --git a/test/api/test_sort2.cfg b/test/api/test_sort2.cfg new file mode 100644 index 0000000..f5596f0 --- /dev/null +++ b/test/api/test_sort2.cfg @@ -0,0 +1,13 @@ +# Simple Zebra configuration file +# +# Where the schema files, attribute files, etc are located. +profilePath: ${srcdir:-.}:${srcdir:-.}/../../tab + +# Files that describe the attribute sets supported. +attset: bib1.att +attset: explain.att + +recordtype: grs.sgml +isam: b + +index: test_sort2.idx diff --git a/test/api/test_sort2.chr b/test/api/test_sort2.chr new file mode 100644 index 0000000..66d260b --- /dev/null +++ b/test/api/test_sort2.chr @@ -0,0 +1,33 @@ +# character map that removes some leading prefixes +# + +# Define the basic value-set. *Beware* of changing this without re-indexing +# your databases. + +lowercase {0-9}{a-y}üzæäøöå +uppercase {0-9}{A-Y}ÜZÆÄØÖÅ + +# Breaking characters + +space {\001-\040}!"#$%&'\()*+,-./:;<=>?@\[\\]^_`\{|}~ + +# Characters to be considered equivalent for searching purposes. + +# equivalent æä(ae) +# equivalent øö(oe) +# equivalent å(aa) +# equivalent uü + +map (^The\s) @ +map (^the\s) @ +map (^a\s) @ +map (^A\s) @ + +#map éÉ e +#map á a +#map ó o +#map í i + +#map (Aa) (AA) + +#map (aa) a diff --git a/test/api/test_sort2.idx b/test/api/test_sort2.idx new file mode 100644 index 0000000..f0988de --- /dev/null +++ b/test/api/test_sort2.idx @@ -0,0 +1,54 @@ +# Zebra indexes as referred to from the *.abs-files. +# + +# Traditional word index +# Used if completenss is 'incomplete field' (@attr 6=1) and +# structure is word/phrase/word-list/free-form-text/document-text +index w +completeness 0 +position 1 +charmap test_sort2.chr + +# Phrase index +# Used if completeness is 'complete {sub}field' (@attr 6=2, @attr 6=1) +# and structure is word/phrase/word-list/free-form-text/document-text +index p +completeness 1 +charmap test_sort2.chr + +# URX (URL) index +# Used if structure=urx (@attr 4=104) +index u +completeness 0 +charmap urx.chr + +# Numeric index +# Used if structure=numeric (@attr 4=109) +index n +completeness 0 +charmap numeric.chr + +# Null map index (no mapping at all) +# Used if structure=key (@attr 4=3) +index 0 +completeness 0 +position 1 +charmap @ + +# Year +# Used if structure=year (@attr 4=4) +index y +completeness 0 +charmap @ + +# Date +# Used if structure=date (@attr 4=5) +index d +completeness 0 +charmap @ + +# Sort, with prefixes to ignore +sort s +completeness 1 +charmap test_sort2.chr + diff --git a/test/sort/.gitignore b/test/sort/.gitignore deleted file mode 100644 index 55ebcd9..0000000 --- a/test/sort/.gitignore +++ /dev/null @@ -1,13 +0,0 @@ -*.mf -*.LCK -*.in -zebrasrv.pid -Makefile -tmp? -*.log -.libs -.deps -test_sort1 -*.lo -*.o -*~ diff --git a/test/sort/Makefile.am b/test/sort/Makefile.am deleted file mode 100644 index 22e646d..0000000 --- a/test/sort/Makefile.am +++ /dev/null @@ -1,18 +0,0 @@ - -check_PROGRAMS = test_sort1 - -TESTS = $(check_PROGRAMS) - -EXTRA_DIST = test_sort1.cfg test_sort1.idx test_sort1.chr \ - test_sort1_rec.xml sort1.abs - -test_sort1_SOURCES = test_sort1.c - -AM_CPPFLAGS = -I$(top_srcdir)/include $(YAZINC) - -LDADD = ../api/libtestlib.a ../../$(main_zebralib) $(YAZLALIB) - -clean-local: - -rm -rf *.LCK - -rm -rf *.log - -rm -rf *.mf diff --git a/test/sort/sort1.abs b/test/sort/sort1.abs deleted file mode 100644 index 27e6237..0000000 --- a/test/sort/sort1.abs +++ /dev/null @@ -1,14 +0,0 @@ - -name my -reference WAIS-schema -attset bib1.att -tagset generic.tag - -varset var1.var - -esetname B @ -esetname F @ - -elm (2,1) Title !:p,!:w -elm (2,8) Date !:s -elm (2,26) Cost Bib-level:S diff --git a/test/sort/test_sort1.c b/test/sort/test_sort1.c deleted file mode 100644 index 4fdf308..0000000 --- a/test/sort/test_sort1.c +++ /dev/null @@ -1,72 +0,0 @@ -/* This file is part of the Zebra server. - Copyright (C) 1995-2008 Index Data - -Zebra is free software; you can redistribute it and/or modify it under -the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later -version. - -Zebra is distributed in the hope that it will be useful, but WITHOUT ANY -WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -*/ - -#include "../api/testlib.h" - -static void tst(int argc, char **argv) -{ - ZebraService zs = tl_start_up("test_sort1.cfg", argc, argv); - ZebraHandle zh = zebra_open(zs, 0); - zint ids[5]; - char path[256]; - - YAZ_CHECK_EQ(zebra_select_database(zh, "Default"), ZEBRA_OK); - - zebra_init(zh); - - YAZ_CHECK(zebra_begin_trans(zh, 1) == ZEBRA_OK); - sprintf(path, "%.200s/test_sort1_rec.xml", tl_get_srcdir()); - zebra_repository_update(zh, path); - YAZ_CHECK(zebra_end_trans(zh) == ZEBRA_OK); - zebra_commit(zh); - - ids[0] = 3; - ids[1] = 2; - ids[2] = 4; - ids[3] = 5; - YAZ_CHECK(tl_sort(zh, "@or @attr 1=4 computer @attr 7=1 @attr 1=30 0", 4, ids)); - YAZ_CHECK(tl_sort(zh, "@or @attr 1=4 computer @attr 7=1 @attr 1=Date 0", 4, ids)); - - ids[0] = 5; - ids[1] = 4; - ids[2] = 2; - ids[3] = 3; - YAZ_CHECK(tl_sort(zh, "@or @attr 1=4 computer @attr 7=1 @attr 1=1021 0", 4, ids)); - YAZ_CHECK(tl_sort(zh, "@or @attr 1=4 computer @attr 7=1 @attr 1=Bib-Level 0", 4, ids)); - - ids[0] = 2; - ids[1] = 5; - ids[2] = 4; - ids[3] = 3; - YAZ_CHECK(tl_sort(zh, "@or @attr 1=4 computer @attr 7=1 @attr 1=1021 @attr 4=109 0", 4, ids)); - YAZ_CHECK(tl_sort(zh, "@or @attr 1=4 computer @attr 7=1 @attr 1=Bib-Level @attr 4=109 0", 4, ids)); - - YAZ_CHECK(tl_close_down(zh, zs)); -} - - -TL_MAIN -/* - * Local variables: - * c-basic-offset: 4 - * indent-tabs-mode: nil - * End: - * vim: shiftwidth=4 tabstop=8 expandtab - */ - diff --git a/test/sort/test_sort1.cfg b/test/sort/test_sort1.cfg deleted file mode 100644 index e050994..0000000 --- a/test/sort/test_sort1.cfg +++ /dev/null @@ -1,13 +0,0 @@ -# Simple Zebra configuration file -# -# Where the schema files, attribute files, etc are located. -profilePath: ${srcdir:-.}:${srcdir:-.}/../../tab - -# Files that describe the attribute sets supported. -attset: bib1.att -attset: explain.att - -recordtype.xml: grs.sgml -isam: b - -index: test_sort1.idx diff --git a/test/sort/test_sort1.chr b/test/sort/test_sort1.chr deleted file mode 100644 index 8353e8f..0000000 --- a/test/sort/test_sort1.chr +++ /dev/null @@ -1,43 +0,0 @@ -# Generic character map but with ^ as cut char -# - -# Define the basic value-set. *Beware* of changing this without re-indexing -# your databases. - -lowercase {0-9}{a-y}üzæäøöå -uppercase {0-9}{A-Y}ÜZÆÄØÖÅ - -cut ^ - -# Breaking characters - -space {\001-\040}!"#$%&'\()*+,-./:;<=>?@\[\\]_`\{|}~ - -# Characters to be considered equivalent for searching purposes. - -# equivalent æä(ae) -# equivalent øö(oe) -# equivalent å(aa) -# equivalent uü - -# Supplemental mappings - -#map (ä) ä -#map (æ) æ -#map (ø) ø -#map (å) å -#map (ö) ö -#map (Ä) Ä -#map (&Aelig;) Æ -#map (Ø) Ø -#map (Å) Å -#map (Ö) Ö - -#map éÉ e -#map á a -#map ó o -#map í i - -#map (Aa) (AA) - -#map (aa) a diff --git a/test/sort/test_sort1.idx b/test/sort/test_sort1.idx deleted file mode 100644 index d77ea50..0000000 --- a/test/sort/test_sort1.idx +++ /dev/null @@ -1,58 +0,0 @@ -# Zebra indexes as referred to from the *.abs-files. -# - -# Traditional word index -# Used if completenss is 'incomplete field' (@attr 6=1) and -# structure is word/phrase/word-list/free-form-text/document-text -index w -completeness 0 -position 1 -charmap string.chr - -# Phrase index -# Used if completeness is 'complete {sub}field' (@attr 6=2, @attr 6=1) -# and structure is word/phrase/word-list/free-form-text/document-text -index p -completeness 1 -charmap string.chr - -# URX (URL) index -# Used if structure=urx (@attr 4=104) -index u -completeness 0 -charmap urx.chr - -# Numeric index -# Used if structure=numeric (@attr 4=109) -index n -completeness 0 -charmap numeric.chr - -# Null map index (no mapping at all) -# Used if structure=key (@attr 4=3) -index 0 -completeness 0 -position 1 -charmap @ - -# Year -# Used if structure=year (@attr 4=4) -index y -completeness 0 -charmap @ - -# Date -# Used if structure=date (@attr 4=5) -index d -completeness 0 -charmap @ - -# Sort register as usual but specify another map : string-hat. -sort s -completeness 1 -charmap test_sort1.chr - -# Sort register with no map -sort S -completeness 1 -charmap string.chr diff --git a/test/sort/test_sort1_rec.xml b/test/sort/test_sort1_rec.xml deleted file mode 100644 index 4b215b4..0000000 --- a/test/sort/test_sort1_rec.xml +++ /dev/null @@ -1,20 +0,0 @@ - - first computer - 2 - 2 - - - second computer - 1 - 21 - - - 3rd computer - a^3 - 15 - - - fourth computer - 4 - 11 - diff --git a/test/sort2/.gitignore b/test/sort2/.gitignore deleted file mode 100644 index 45d6808..0000000 --- a/test/sort2/.gitignore +++ /dev/null @@ -1,13 +0,0 @@ -*.mf -*.LCK -*.in -zebrasrv.pid -Makefile -tmp? -*.log -.libs -.deps -test_sort2 -*.lo -*.o -*~ diff --git a/test/sort2/Makefile.am b/test/sort2/Makefile.am deleted file mode 100644 index dcf6e68..0000000 --- a/test/sort2/Makefile.am +++ /dev/null @@ -1,19 +0,0 @@ - -check_PROGRAMS = test_sort2 - -TESTS = $(check_PROGRAMS) - -EXTRA_DIST = test_sort2.cfg test_sort2.idx \ - test_sort2_rec.xml test_sort2.cfg sort2.abs test_sort2.chr - -test_sort2_SOURCES = test_sort2.c - -AM_CPPFLAGS = -I$(top_srcdir)/include $(YAZINC) - -LDADD = ../api/libtestlib.a ../../$(main_zebralib) $(YAZLALIB) - -clean-local: - -rm -rf *.LCK - -rm -rf *.log - -rm -rf *.mf - diff --git a/test/sort2/sort2.abs b/test/sort2/sort2.abs deleted file mode 100644 index 0c9f8a0..0000000 --- a/test/sort2/sort2.abs +++ /dev/null @@ -1,13 +0,0 @@ - -name my -reference WAIS-schema -attset bib1.att -tagset generic.tag -xpath enable - -varset var1.var - -esetname B @ -esetname F @ - -elm title Title !:p,!:w,!:s diff --git a/test/sort2/test_sort2.c b/test/sort2/test_sort2.c deleted file mode 100644 index 38b4264..0000000 --- a/test/sort2/test_sort2.c +++ /dev/null @@ -1,57 +0,0 @@ -/* This file is part of the Zebra server. - Copyright (C) 1995-2008 Index Data - -Zebra is free software; you can redistribute it and/or modify it under -the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later -version. - -Zebra is distributed in the hope that it will be useful, but WITHOUT ANY -WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -*/ - -#include "../api/testlib.h" - -static void tst(int argc, char **argv) -{ - ZebraService zs = tl_start_up("test_sort2.cfg", argc, argv); - ZebraHandle zh = zebra_open(zs, 0); - char path[256]; - zint ids[5]; - - YAZ_CHECK(zebra_select_database(zh, "Default") == ZEBRA_OK); - - zebra_init(zh); - - YAZ_CHECK(zebra_begin_trans(zh, 1) == ZEBRA_OK); - sprintf(path, "%.200s/test_sort2_rec.xml", tl_get_srcdir()); - zebra_repository_update(zh, path); - - YAZ_CHECK(zebra_end_trans(zh) == ZEBRA_OK); - zebra_commit(zh); - - ids[0] = 2; - ids[1] = 5; - ids[2] = 3; - ids[3] = 4; - YAZ_CHECK(tl_sort(zh, "@or @attr 1=4 computer @attr 7=1 @attr 1=4 0", 4, ids)); - - YAZ_CHECK(tl_close_down(zh, zs)); -} - -TL_MAIN -/* - * Local variables: - * c-basic-offset: 4 - * indent-tabs-mode: nil - * End: - * vim: shiftwidth=4 tabstop=8 expandtab - */ - diff --git a/test/sort2/test_sort2.cfg b/test/sort2/test_sort2.cfg deleted file mode 100644 index 59c371d..0000000 --- a/test/sort2/test_sort2.cfg +++ /dev/null @@ -1,13 +0,0 @@ -# Simple Zebra configuration file -# -# Where the schema files, attribute files, etc are located. -profilePath: ${srcdir:-.}:${srcdir:-.}/../../tab - -# Files that describe the attribute sets supported. -attset: bib1.att -attset: explain.att - -recordtype.xml: grs.sgml -isam: b - -index: test_sort2.idx diff --git a/test/sort2/test_sort2.chr b/test/sort2/test_sort2.chr deleted file mode 100644 index 66d260b..0000000 --- a/test/sort2/test_sort2.chr +++ /dev/null @@ -1,33 +0,0 @@ -# character map that removes some leading prefixes -# - -# Define the basic value-set. *Beware* of changing this without re-indexing -# your databases. - -lowercase {0-9}{a-y}üzæäøöå -uppercase {0-9}{A-Y}ÜZÆÄØÖÅ - -# Breaking characters - -space {\001-\040}!"#$%&'\()*+,-./:;<=>?@\[\\]^_`\{|}~ - -# Characters to be considered equivalent for searching purposes. - -# equivalent æä(ae) -# equivalent øö(oe) -# equivalent å(aa) -# equivalent uü - -map (^The\s) @ -map (^the\s) @ -map (^a\s) @ -map (^A\s) @ - -#map éÉ e -#map á a -#map ó o -#map í i - -#map (Aa) (AA) - -#map (aa) a diff --git a/test/sort2/test_sort2.idx b/test/sort2/test_sort2.idx deleted file mode 100644 index f0988de..0000000 --- a/test/sort2/test_sort2.idx +++ /dev/null @@ -1,54 +0,0 @@ -# Zebra indexes as referred to from the *.abs-files. -# - -# Traditional word index -# Used if completenss is 'incomplete field' (@attr 6=1) and -# structure is word/phrase/word-list/free-form-text/document-text -index w -completeness 0 -position 1 -charmap test_sort2.chr - -# Phrase index -# Used if completeness is 'complete {sub}field' (@attr 6=2, @attr 6=1) -# and structure is word/phrase/word-list/free-form-text/document-text -index p -completeness 1 -charmap test_sort2.chr - -# URX (URL) index -# Used if structure=urx (@attr 4=104) -index u -completeness 0 -charmap urx.chr - -# Numeric index -# Used if structure=numeric (@attr 4=109) -index n -completeness 0 -charmap numeric.chr - -# Null map index (no mapping at all) -# Used if structure=key (@attr 4=3) -index 0 -completeness 0 -position 1 -charmap @ - -# Year -# Used if structure=year (@attr 4=4) -index y -completeness 0 -charmap @ - -# Date -# Used if structure=date (@attr 4=5) -index d -completeness 0 -charmap @ - -# Sort, with prefixes to ignore -sort s -completeness 1 -charmap test_sort2.chr - diff --git a/test/sort2/test_sort2_rec.xml b/test/sort2/test_sort2_rec.xml deleted file mode 100644 index 54d9295..0000000 --- a/test/sort2/test_sort2_rec.xml +++ /dev/null @@ -1,12 +0,0 @@ - - first computer - - - second computer - - - A third computer - - - the fourth computer -